From: Pavel Emelyanov Date: Wed, 19 Sep 2007 12:44:07 +0000 (+0400) Subject: Use list_first_entry in locks_wake_up_blocks X-Git-Tag: v2.6.24-rc1~1274^2~12 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0c1cd0eaf0b127356c2c09e40305453bc361b0f;p=linux-2.6 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: Pavel Emelyanov --- diff --git a/fs/locks.c b/fs/locks.c index c7c69d29a5..282b6c1167 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -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)