File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,27 @@ static void clear_initpid_store(void)
312
312
store_unlock ();
313
313
}
314
314
315
+ int iter_initpid_store (pidns_store_iter_func_t f , void * data )
316
+ {
317
+ int ret ;
318
+
319
+ if (!pidns_hash_table )
320
+ return 0 ;
321
+
322
+ store_lock ();
323
+ for (int i = 0 ; i < PIDNS_HASH_SIZE ; i ++ ) {
324
+ for (struct pidns_store * entry = pidns_hash_table [i ]; entry ; entry = entry -> next ) {
325
+ ret = f (entry , data );
326
+ if (ret )
327
+ goto out ;
328
+ }
329
+ }
330
+
331
+ out :
332
+ store_unlock ();
333
+ return ret ;
334
+ }
335
+
315
336
/* Must be called under store_lock */
316
337
static void save_initpid (ino_t pidns_inode , pid_t pid )
317
338
{
Original file line number Diff line number Diff line change @@ -172,7 +172,9 @@ typedef enum lxcfs_opt_t {
172
172
LXCFS_OPTS_MAX = LXCFS_CFS_ON ,
173
173
} lxcfs_opt_t ;
174
174
175
+ typedef int (* pidns_store_iter_func_t ) (struct pidns_store * cur , void * data );
175
176
177
+ extern int iter_initpid_store (pidns_store_iter_func_t f , void * data );
176
178
extern pid_t lookup_initpid_in_store (pid_t qpid );
177
179
extern void prune_init_slice (char * cg );
178
180
extern bool supports_pidfd (void );
You can’t perform that action at this time.
0 commit comments