mnt: Use hlist_move_list in namespace_unlock
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 3 Apr 2015 01:33:53 +0000 (20:33 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 3 Apr 2015 01:33:53 +0000 (20:33 -0500)
Small cleanup to make the code more readable and maintainable.

Signed-off-by: Eric Biederman <ebiederm@xmission.com>
fs/namespace.c

index 82ef1405260e1cfbe551ffba781fec25f881e918..e1ee57206eeff6797a89e12bbfc7b1b8a22884d0 100644 (file)
@@ -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);