File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,12 @@ static bool initpid_still_valid(struct pidns_store *entry)
192
192
return ret == 1 ;
193
193
}
194
194
195
+ static void free_initpid (struct pidns_store * entry )
196
+ {
197
+ close_prot_errno_disarm (entry -> init_pidfd );
198
+ free_disarm (entry );
199
+ }
200
+
195
201
/* Must be called under store_lock */
196
202
static void remove_initpid (struct pidns_store * entry )
197
203
{
@@ -207,17 +213,15 @@ static void remove_initpid(struct pidns_store *entry)
207
213
ino_hash = HASH (entry -> ino );
208
214
if (pidns_hash_table [ino_hash ] == entry ) {
209
215
pidns_hash_table [ino_hash ] = entry -> next ;
210
- close_prot_errno_disarm (entry -> init_pidfd );
211
- free_disarm (entry );
216
+ free_initpid (entry );
212
217
return ;
213
218
}
214
219
215
220
it = pidns_hash_table [ino_hash ];
216
221
while (it ) {
217
222
if (it -> next == entry ) {
218
223
it -> next = entry -> next ;
219
- close_prot_errno_disarm (entry -> init_pidfd );
220
- free_disarm (entry );
224
+ free_initpid (entry );
221
225
return ;
222
226
}
223
227
it = it -> next ;
@@ -267,8 +271,7 @@ static void prune_initpid_store(void)
267
271
else
268
272
pidns_hash_table [i ] = entry -> next ;
269
273
entry = entry -> next ;
270
- close_prot_errno_disarm (cur -> init_pidfd );
271
- free_disarm (cur );
274
+ free_initpid (cur );
272
275
} else {
273
276
lxcfs_debug ("Kept cache entry for pid %d in init pid cache" , cur -> initpid );
274
277
@@ -302,8 +305,7 @@ static void clear_initpid_store(void)
302
305
else
303
306
pidns_hash_table [i ] = entry -> next ;
304
307
entry = entry -> next ;
305
- close_prot_errno_disarm (cur -> init_pidfd );
306
- free_disarm (cur );
308
+ free_initpid (cur );
307
309
}
308
310
}
309
311
}
You can’t perform that action at this time.
0 commit comments