summaryrefslogtreecommitdiff
path: root/fs/locks.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-09-19 16:44:07 +0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2007-10-09 18:32:45 -0400
commitf0c1cd0eaf0b127356c2c09e40305453bc361b0f (patch)
treee522f8d83b439442aeb8c1b9c2a94941f6a95b1a /fs/locks.c
parent02888f41e9d7fa95d1f5b2f76e0f0af6ea8198cc (diff)
downloadlinux-3.10-f0c1cd0eaf0b127356c2c09e40305453bc361b0f.tar.gz
linux-3.10-f0c1cd0eaf0b127356c2c09e40305453bc361b0f.tar.bz2
linux-3.10-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 c7c69d29a57..282b6c11670 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)