Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ns: uniformly initialize ns_common

No point in cargo-culting the same code across all the different types.
Use one common initializer.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+16
+16
include/linux/proc_ns.h
··· 72 72 return proc_alloc_inum(&ns->inum); 73 73 } 74 74 75 + static inline int ns_common_init(struct ns_common *ns, 76 + const struct proc_ns_operations *ops, 77 + bool alloc_inum) 78 + { 79 + if (alloc_inum) { 80 + int ret; 81 + ret = proc_alloc_inum(&ns->inum); 82 + if (ret) 83 + return ret; 84 + } 85 + refcount_set(&ns->count, 1); 86 + ns->stashed = NULL; 87 + ns->ops = ops; 88 + return 0; 89 + } 90 + 75 91 #define ns_free_inum(ns) proc_free_inum((ns)->inum) 76 92 77 93 #define get_proc_ns(inode) ((struct ns_common *)(inode)->i_private)