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

Commit f0c1cd0e authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by J. Bruce Fields
Browse files

Use list_first_entry in locks_wake_up_blocks



This routine deletes all the elements from the list
with the "while (!list_empty())" loop, and we already
have a list_first_entry() macro to help it look nicer :)

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
parent 02888f41
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -534,7 +534,9 @@ static void locks_insert_block(struct file_lock *blocker,
static void locks_wake_up_blocks(struct file_lock *blocker)
{
	while (!list_empty(&blocker->fl_block)) {
		struct file_lock *waiter = list_entry(blocker->fl_block.next,
		struct file_lock *waiter;

		waiter = list_first_entry(&blocker->fl_block,
				struct file_lock, fl_block);
		__locks_delete_block(waiter);
		if (waiter->fl_lmops && waiter->fl_lmops->fl_notify)