summaryrefslogtreecommitdiff
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-04-03 04:33:53 +0300
committerEric W. Biederman <ebiederm@xmission.com>2015-04-03 04:33:53 +0300
commita3b3c5627c8301ac850962b04f645dfab81e6a60 (patch)
treeafbb66cbfc7cdf454c729cf00b1e5e57acca9b93 /fs/namespace.c
parente42391cd048809d903291d07f86ed3934ce138e9 (diff)
downloadlinux-a3b3c5627c8301ac850962b04f645dfab81e6a60.tar.xz
mnt: Use hlist_move_list in namespace_unlock
Small cleanup to make the code more readable and maintainable. Signed-off-by: Eric Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 82ef1405260e..e1ee57206eef 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1298,17 +1298,15 @@ static HLIST_HEAD(unmounted); /* protected by namespace_sem */
static void namespace_unlock(void)
{
- struct hlist_head head = unmounted;
+ struct hlist_head head;
- if (likely(hlist_empty(&head))) {
- up_write(&namespace_sem);
- return;
- }
+ hlist_move_list(&unmounted, &head);
- head.first->pprev = &head.first;
- INIT_HLIST_HEAD(&unmounted);
up_write(&namespace_sem);
+ if (likely(hlist_empty(&head)))
+ return;
+
synchronize_rcu();
group_pin_kill(&head);