]> err.no Git - linux-2.6/commitdiff
Use list_first_entry in locks_wake_up_blocks
authorPavel Emelyanov <xemul@openvz.org>
Wed, 19 Sep 2007 12:44:07 +0000 (16:44 +0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 9 Oct 2007 22:32:45 +0000 (18:32 -0400)
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>
fs/locks.c

index c7c69d29a576506ea93ce82899df8f2791abe7d0..282b6c11670aa1c2f80239d2524378f8cd7bc2b0 100644 (file)
@@ -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)