summaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-09-19 14:44:07 +0200
committerJ. Bruce Fields <bfields@citi.umich.edu>2007-10-10 00:32:45 +0200
commitf0c1cd0eaf0b127356c2c09e40305453bc361b0f (patch)
treee522f8d83b439442aeb8c1b9c2a94941f6a95b1a /fs/locks.c
parentlocks: fix flock_lock_file() comment (diff)
downloadlinux-f0c1cd0eaf0b127356c2c09e40305453bc361b0f.tar.xz
linux-f0c1cd0eaf0b127356c2c09e40305453bc361b0f.zip
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 <xemul@openvz.org>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/locks.c b/fs/locks.c
index c7c69d29a576..282b6c11670a 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)