File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1143,13 +1143,14 @@ void rhashtable_free_and_destroy(struct rhashtable *ht,
1143
1143
void (* free_fn )(void * ptr , void * arg ),
1144
1144
void * arg )
1145
1145
{
1146
- struct bucket_table * tbl ;
1146
+ struct bucket_table * tbl , * next_tbl ;
1147
1147
unsigned int i ;
1148
1148
1149
1149
cancel_work_sync (& ht -> run_work );
1150
1150
1151
1151
mutex_lock (& ht -> mutex );
1152
1152
tbl = rht_dereference (ht -> tbl , ht );
1153
+ restart :
1153
1154
if (free_fn ) {
1154
1155
for (i = 0 ; i < tbl -> size ; i ++ ) {
1155
1156
struct rhash_head * pos , * next ;
@@ -1166,7 +1167,12 @@ void rhashtable_free_and_destroy(struct rhashtable *ht,
1166
1167
}
1167
1168
}
1168
1169
1170
+ next_tbl = rht_dereference (tbl -> future_tbl , ht );
1169
1171
bucket_table_free (tbl );
1172
+ if (next_tbl ) {
1173
+ tbl = next_tbl ;
1174
+ goto restart ;
1175
+ }
1170
1176
mutex_unlock (& ht -> mutex );
1171
1177
}
1172
1178
EXPORT_SYMBOL_GPL (rhashtable_free_and_destroy );
You can’t perform that action at this time.
0 commit comments