VFS: Switch init_mount_tree() to use the new create_mnt_ns() helper
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 23 Jun 2009 21:29:49 +0000 (17:29 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 24 Jun 2009 12:15:24 +0000 (08:15 -0400)
Eliminates some duplicated code...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c

index a7bea8c8bd469e7760aa1dc098478eef5b1be518..4a86b85951645ffe2d23b7f00ecf5919725eec78 100644 (file)
@@ -2222,16 +2222,9 @@ static void __init init_mount_tree(void)
        mnt = do_kern_mount("rootfs", 0, "rootfs", NULL);
        if (IS_ERR(mnt))
                panic("Can't create rootfs");
-       ns = kmalloc(sizeof(*ns), GFP_KERNEL);
-       if (!ns)
+       ns = create_mnt_ns(mnt);
+       if (IS_ERR(ns))
                panic("Can't allocate initial namespace");
-       atomic_set(&ns->count, 1);
-       INIT_LIST_HEAD(&ns->list);
-       init_waitqueue_head(&ns->poll);
-       ns->event = 0;
-       list_add(&mnt->mnt_list, &ns->list);
-       ns->root = mnt;
-       mnt->mnt_ns = ns;
 
        init_task.nsproxy->mnt_ns = ns;
        get_mnt_ns(ns);