Skip to content

Commit

Permalink
Use list_first_entry in locks_wake_up_blocks
Browse files Browse the repository at this point in the history
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: Pavel Emelyanov <xemul@openvz.org>
  • Loading branch information
Pavel Emelyanov authored and J. Bruce Fields committed Oct 9, 2007
1 parent 02888f4 commit f0c1cd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f0c1cd0

Please sign in to comment.