aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/dir.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2007-10-18 06:07:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:31 -0400
commitf33321141b273d60cbb3a8f56a5489baad82ba5e (patch)
treeb6443b674600dcdb8c33aa6d44b7a673edc255b4 /fs/fuse/dir.c
parentb25e82e5673c750116e8b01a4fc7d09be7809f8c (diff)
fuse: add support for mandatory locking
For mandatory locking the userspace filesystem needs to know the lock ownership for read, write and truncate operations. This patch adds the necessary fields to the protocol. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r--fs/fuse/dir.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 052327bd6c9d..6c83ed052026 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1108,6 +1108,11 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr,
1108 inarg.valid |= FATTR_FH; 1108 inarg.valid |= FATTR_FH;
1109 inarg.fh = ff->fh; 1109 inarg.fh = ff->fh;
1110 } 1110 }
1111 if (attr->ia_valid & ATTR_SIZE) {
1112 /* For mandatory locking in truncate */
1113 inarg.valid |= FATTR_LOCKOWNER;
1114 inarg.lock_owner = fuse_lock_owner_id(fc, current->files);
1115 }
1111 req->in.h.opcode = FUSE_SETATTR; 1116 req->in.h.opcode = FUSE_SETATTR;
1112 req->in.h.nodeid = get_node_id(inode); 1117 req->in.h.nodeid = get_node_id(inode);
1113 req->in.numargs = 1; 1118 req->in.numargs = 1;