[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1421125686-23765-1-git-send-email-jiang.liu@linux.intel.com>
Date: Tue, 13 Jan 2015 13:08:06 +0800
From: Jiang Liu <jiang.liu@...ux.intel.com>
To: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Jiang Liu <jiang.liu@...ux.intel.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fs: namespace: Simplify function commit_tree()
Simplify function commit_tree() in fs/namespace.c, it also improves code
readability.
Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
---
fs/namespace.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index cd1e9681a0cf..c2b6f6f676ec 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -846,18 +846,11 @@ static void attach_shadowed(struct mount *mnt,
static void commit_tree(struct mount *mnt, struct mount *shadows)
{
struct mount *parent = mnt->mnt_parent;
- struct mount *m;
- LIST_HEAD(head);
struct mnt_namespace *n = parent->mnt_ns;
BUG_ON(parent == mnt);
-
- list_add_tail(&head, &mnt->mnt_list);
- list_for_each_entry(m, &head, mnt_list)
- m->mnt_ns = n;
-
- list_splice(&head, n->list.prev);
-
+ mnt->mnt_ns = n;
+ list_add_tail(&mnt->mnt_list, &n->list);
attach_shadowed(mnt, parent, shadows);
touch_mnt_namespace(n);
}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists