Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88335
b: refs/heads/master
c: 0de19a4
h: refs/heads/master
i:
  88333: b28341f
  88331: 5c74a58
  88327: 063d108
  88319: 58c8bd0
v: v3
  • Loading branch information
Linus Torvalds committed Apr 15, 2008
1 parent c219f81 commit 2c5d6da
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 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: fd785d6b18b930b76ad5076eed6e9af43195b281
refs/heads/master: 0de19a456cb59106420864927fdec152310f70b6
2 changes: 1 addition & 1 deletion trunk/fs/jffs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
struct inode *inode = mapping->host;
struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
pgoff_t index = pos >> PAGE_CACHE_SHIFT;
uint32_t pageofs = pos & (PAGE_CACHE_SIZE - 1);
uint32_t pageofs = index << PAGE_CACHE_SHIFT;
int ret = 0;

pg = __grab_cache_page(mapping, index);
Expand Down
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 2c5d6da

Please sign in to comment.