From: Trond Myklebust Date: Tue, 23 Jun 2009 21:29:49 +0000 (-0400) Subject: VFS: Switch init_mount_tree() to use the new create_mnt_ns() helper X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3b22edc5730b87d360ee7dd7143397ba09b73a47;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git VFS: Switch init_mount_tree() to use the new create_mnt_ns() helper Eliminates some duplicated code... Signed-off-by: Trond Myklebust Signed-off-by: Al Viro --- diff --git a/fs/namespace.c b/fs/namespace.c index a7bea8c8bd4..4a86b859516 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -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);