Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3b3c562 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

mnt: Use hlist_move_list in namespace_unlock



Small cleanup to make the code more readable and maintainable.

Signed-off-by: default avatarEric Biederman <ebiederm@xmission.com>
parent e42391cd
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -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);