Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106041
b: refs/heads/master
c: 48e9076
h: refs/heads/master
i:
  106039: 906adfc
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jul 25, 2008
1 parent 84d3528 commit ddc67e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 33670fa296860283f04a7975b8c790f101e43a6e
refs/heads/master: 48e90761b570ff57f58b726229d229729949c5bb
11 changes: 9 additions & 2 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,11 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock)
pid_t pid = fl->fl_type != F_UNLCK ? current->tgid : 0;
int err;

if (fl->fl_lmops && fl->fl_lmops->fl_grant) {
/* NLM needs asynchronous locks, which we don't support yet */
return -ENOLCK;
}

/* Unlock on close is handled by the flush method */
if (fl->fl_flags & FL_CLOSE)
return 0;
Expand All @@ -1365,15 +1370,17 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl)
struct fuse_conn *fc = get_fuse_conn(inode);
int err;

if (cmd == F_GETLK) {
if (cmd == F_CANCELLK) {
err = 0;
} else if (cmd == F_GETLK) {
if (fc->no_lock) {
posix_test_lock(file, fl);
err = 0;
} else
err = fuse_getlk(file, fl);
} else {
if (fc->no_lock)
err = posix_lock_file_wait(file, fl);
err = posix_lock_file(file, fl, NULL);
else
err = fuse_setlk(file, fl, 0);
}
Expand Down

0 comments on commit ddc67e6

Please sign in to comment.