]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fuse/file.c
fuse: add atomic open+truncate support
[linux-2.6-omap-h63xx.git] / fs / fuse / file.c
index 4a28c3d377322668bcbb78b7e9620f5b1c69b6ab..6726378661dae7d1063256ced2fbd6e334f46cf7 100644 (file)
@@ -28,7 +28,9 @@ static int fuse_send_open(struct inode *inode, struct file *file, int isdir,
                return PTR_ERR(req);
 
        memset(&inarg, 0, sizeof(inarg));
-       inarg.flags = file->f_flags & ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
+       inarg.flags = file->f_flags & ~(O_CREAT | O_EXCL | O_NOCTTY);
+       if (!fc->atomic_o_trunc)
+               inarg.flags &= ~O_TRUNC;
        req->in.h.opcode = isdir ? FUSE_OPENDIR : FUSE_OPEN;
        req->in.h.nodeid = get_node_id(inode);
        req->in.numargs = 1;