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 @@ -330,6 +330,27 @@ static void clear_initpid_store(void)
330
330
store_unlock ();
331
331
}
332
332
333
+ int iter_initpid_store (pidns_store_iter_func_t f , void * data )
334
+ {
335
+ int ret ;
336
+
337
+ if (!pidns_hash_table )
338
+ return 0 ;
339
+
340
+ store_lock ();
341
+ for (int i = 0 ; i < PIDNS_HASH_SIZE ; i ++ ) {
342
+ for (struct pidns_store * entry = pidns_hash_table [i ]; entry ; entry = entry -> next ) {
343
+ ret = f (entry , data );
344
+ if (ret )
345
+ goto out ;
346
+ }
347
+ }
348
+
349
+ out :
350
+ store_unlock ();
351
+ return ret ;
352
+ }
353
+
333
354
/* Must be called under store_lock */
334
355
static void save_initpid (ino_t pidns_inode , pid_t pid )
335
356
{
Original file line number Diff line number Diff line change @@ -170,7 +170,9 @@ typedef enum lxcfs_opt_t {
170
170
LXCFS_OPTS_MAX = LXCFS_CFS_ON ,
171
171
} lxcfs_opt_t ;
172
172
173
+ typedef int (* pidns_store_iter_func_t ) (struct pidns_store * cur , void * data );
173
174
175
+ extern int iter_initpid_store (pidns_store_iter_func_t f , void * data );
174
176
extern pid_t lookup_initpid_in_store (pid_t qpid );
175
177
extern void prune_init_slice (char * cg );
176
178
extern bool supports_pidfd (void );
You can’t perform that action at this time.
0 commit comments