fuse: lockd support

Previous thread: fuse: nfs export special lookups by Linux Kernel Mailing List on Friday, July 25, 2008 - 12:12 pm. (1 message)

Next thread: edac: i5100 fix missing bits by Linux Kernel Mailing List on Friday, July 25, 2008 - 12:12 pm. (1 message)
From: Linux Kernel Mailing List
Date: Friday, July 25, 2008 - 12:12 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48e907...
Commit:     48e90761b570ff57f58b726229d229729949c5bb
Parent:     33670fa296860283f04a7975b8c790f101e43a6e
Author:     Miklos Szeredi <mszeredi@suse.cz>
AuthorDate: Fri Jul 25 01:49:02 2008 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Fri Jul 25 10:53:48 2008 -0700

    fuse: lockd support
    
    If fuse filesystem doesn't define it's own lock operations, then allow the
    lock manager to work with fuse.
    
    Adding lockd support for remote locking is also possible, but more rarely
    used, so leave it till later.
    
    Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
    Cc: "J. Bruce Fields" <bfields@fieldses.org>
    Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
    Cc: Matthew Wilcox <matthew@wil.cx>
    Cc: David Teigland <teigland@redhat.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 fs/fuse/file.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 8092f0d..67ff2c6 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -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;
@@ -1365,7 +1370,9 @@ 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) {
 ...
Previous thread: fuse: nfs export special lookups by Linux Kernel Mailing List on Friday, July 25, 2008 - 12:12 pm. (1 message)

Next thread: edac: i5100 fix missing bits by Linux Kernel Mailing List on Friday, July 25, 2008 - 12:12 pm. (1 message)