Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88329
b: refs/heads/master
c: 19e729a
h: refs/heads/master
i:
  88327: 063d108
v: v3
  • Loading branch information
J. Bruce Fields authored and Linus Torvalds committed Apr 14, 2008
1 parent 70b3bc4 commit 79b8422
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a985aabe4d7a720b109c2b63549f8641676a9c88
refs/heads/master: 19e729a928172103e101ffd0829fd13e68c13f78
48 changes: 28 additions & 20 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1801,17 +1801,21 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd,
if (error)
goto out;

for (;;) {
error = vfs_lock_file(filp, cmd, file_lock, NULL);
if (error != -EAGAIN || cmd == F_SETLK)
break;
error = wait_event_interruptible(file_lock->fl_wait,
!file_lock->fl_next);
if (!error)
continue;
if (filp->f_op && filp->f_op->lock != NULL)
error = filp->f_op->lock(filp, cmd, file_lock);
else {
for (;;) {
error = posix_lock_file(filp, file_lock, NULL);
if (error != -EAGAIN || cmd == F_SETLK)
break;
error = wait_event_interruptible(file_lock->fl_wait,
!file_lock->fl_next);
if (!error)
continue;

locks_delete_block(file_lock);
break;
locks_delete_block(file_lock);
break;
}
}

/*
Expand Down Expand Up @@ -1925,17 +1929,21 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd,
if (error)
goto out;

for (;;) {
error = vfs_lock_file(filp, cmd, file_lock, NULL);
if (error != -EAGAIN || cmd == F_SETLK64)
break;
error = wait_event_interruptible(file_lock->fl_wait,
!file_lock->fl_next);
if (!error)
continue;
if (filp->f_op && filp->f_op->lock != NULL)
error = filp->f_op->lock(filp, cmd, file_lock);
else {
for (;;) {
error = posix_lock_file(filp, file_lock, NULL);
if (error != -EAGAIN || cmd == F_SETLK64)
break;
error = wait_event_interruptible(file_lock->fl_wait,
!file_lock->fl_next);
if (!error)
continue;

locks_delete_block(file_lock);
break;
locks_delete_block(file_lock);
break;
}
}

/*
Expand Down

0 comments on commit 79b8422

Please sign in to comment.