aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-04-02 21:33:53 -0400
committerEric W. Biederman <ebiederm@xmission.com>2015-04-02 21:33:53 -0400
commita3b3c5627c8301ac850962b04f645dfab81e6a60 (patch)
treeafbb66cbfc7cdf454c729cf00b1e5e57acca9b93
parente42391cd048809d903291d07f86ed3934ce138e9 (diff)
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>
-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 */
1298 1298
1299static void namespace_unlock(void) 1299static void namespace_unlock(void)
1300{ 1300{
1301 struct hlist_head head = unmounted; 1301 struct hlist_head head;
1302 1302
1303 if (likely(hlist_empty(&head))) { 1303 hlist_move_list(&unmounted, &head);
1304 up_write(&namespace_sem);
1305 return;
1306 }
1307 1304
1308 head.first->pprev = &head.first;
1309 INIT_HLIST_HEAD(&unmounted);
1310 up_write(&namespace_sem); 1305 up_write(&namespace_sem);
1311 1306
1307 if (likely(hlist_empty(&head)))
1308 return;
1309
1312 synchronize_rcu(); 1310 synchronize_rcu();
1313 1311
1314 group_pin_kill(&head); 1312 group_pin_kill(&head);