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.

mnt: use ns_common_init()

Don't cargo-cult the same thing over and over.

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

+6 -9
+6 -9
fs/namespace.c
··· 4177 4177 dec_mnt_namespaces(ucounts); 4178 4178 return ERR_PTR(-ENOMEM); 4179 4179 } 4180 - if (!anon) { 4181 - ret = ns_alloc_inum(&new_ns->ns); 4182 - if (ret) { 4183 - kfree(new_ns); 4184 - dec_mnt_namespaces(ucounts); 4185 - return ERR_PTR(ret); 4186 - } 4180 + 4181 + ret = ns_common_init(&new_ns->ns, &mntns_operations, !anon); 4182 + if (ret) { 4183 + kfree(new_ns); 4184 + dec_mnt_namespaces(ucounts); 4185 + return ERR_PTR(ret); 4187 4186 } 4188 - new_ns->ns.ops = &mntns_operations; 4189 4187 if (!anon) 4190 4188 new_ns->seq = atomic64_inc_return(&mnt_ns_seq); 4191 - refcount_set(&new_ns->ns.count, 1); 4192 4189 refcount_set(&new_ns->passive, 1); 4193 4190 new_ns->mounts = RB_ROOT; 4194 4191 INIT_LIST_HEAD(&new_ns->mnt_ns_list);