提交 f0c1cd0e 编写于 作者: P Pavel Emelyanov 提交者: J. Bruce Fields

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: NPavel Emelyanov <xemul@openvz.org>
上级 02888f41
...@@ -534,7 +534,9 @@ static void locks_insert_block(struct file_lock *blocker, ...@@ -534,7 +534,9 @@ static void locks_insert_block(struct file_lock *blocker,
static void locks_wake_up_blocks(struct file_lock *blocker) static void locks_wake_up_blocks(struct file_lock *blocker)
{ {
while (!list_empty(&blocker->fl_block)) { 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); struct file_lock, fl_block);
__locks_delete_block(waiter); __locks_delete_block(waiter);
if (waiter->fl_lmops && waiter->fl_lmops->fl_notify) if (waiter->fl_lmops && waiter->fl_lmops->fl_notify)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册