Skip to content

Commit 3b22edc

Browse files
Trond MyklebustAl Viro
authored andcommitted
VFS: Switch init_mount_tree() to use the new create_mnt_ns() helper
Eliminates some duplicated code... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 654f562 commit 3b22edc

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

‎fs/namespace.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,16 +2222,9 @@ static void __init init_mount_tree(void)
22222222
mnt = do_kern_mount("rootfs", 0, "rootfs", NULL);
22232223
if (IS_ERR(mnt))
22242224
panic("Can't create rootfs");
2225-
ns = kmalloc(sizeof(*ns), GFP_KERNEL);
2226-
if (!ns)
2225+
ns = create_mnt_ns(mnt);
2226+
if (IS_ERR(ns))
22272227
panic("Can't allocate initial namespace");
2228-
atomic_set(&ns->count, 1);
2229-
INIT_LIST_HEAD(&ns->list);
2230-
init_waitqueue_head(&ns->poll);
2231-
ns->event = 0;
2232-
list_add(&mnt->mnt_list, &ns->list);
2233-
ns->root = mnt;
2234-
mnt->mnt_ns = ns;
22352228

22362229
init_task.nsproxy->mnt_ns = ns;
22372230
get_mnt_ns(ns);

0 commit comments

Comments
 (0)