]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fuse/dir.c
fuse: add support for mandatory locking
[linux-2.6-omap-h63xx.git] / fs / fuse / dir.c
index 052327bd6c9dcb42587073ebb0de65cc0d94f5f1..6c83ed052026de1a7f89f222b7212bbcc5e44a88 100644 (file)
@@ -1108,6 +1108,11 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr,
                inarg.valid |= FATTR_FH;
                inarg.fh = ff->fh;
        }
+       if (attr->ia_valid & ATTR_SIZE) {
+               /* For mandatory locking in truncate */
+               inarg.valid |= FATTR_LOCKOWNER;
+               inarg.lock_owner = fuse_lock_owner_id(fc, current->files);
+       }
        req->in.h.opcode = FUSE_SETATTR;
        req->in.h.nodeid = get_node_id(inode);
        req->in.numargs = 1;