瀏覽代碼

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>
Eric W. Biederman 10 年之前
父節點
當前提交
a3b3c5627c
共有 1 個文件被更改,包括 5 次插入7 次删除
  1. 5 7
      fs/namespace.c

+ 5 - 7
fs/namespace.c

@@ -1298,17 +1298,15 @@ static HLIST_HEAD(unmounted);	/* protected by namespace_sem */
 
 
 static void namespace_unlock(void)
 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);
 	up_write(&namespace_sem);
 
 
+	if (likely(hlist_empty(&head)))
+		return;
+
 	synchronize_rcu();
 	synchronize_rcu();
 
 
 	group_pin_kill(&head);
 	group_pin_kill(&head);