+2008-10-14 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Pass current file flags to read and write operations
+
2008-07-24 Miklos Szeredi <miklos@szeredi.hu>
* Clean up debug output in highlevel lib
*
* Changed in fuse 2.8.0 (regardless of API version)
* Previously, paths were limited to a length of PATH_MAX.
+ *
+ * See http://fuse.sourceforge.net/wiki/ for more information. There
+ * is also a snapshot of the relevant wiki pages in the doc/ folder.
*/
struct fuse_operations {
/** Get file attributes.
int res;
if (fs->debug)
- fprintf(stderr, "read[%llu] %lu bytes from %llu\n",
+ fprintf(stderr,
+ "read[%llu] %lu bytes from %llu flags: 0x%x\n",
(unsigned long long) fi->fh,
- (unsigned long) size, (unsigned long long) off);
+ (unsigned long) size, (unsigned long long) off,
+ fi->flags);
res = fs->op.read(path, buf, size, off, fi);
int res;
if (fs->debug)
- fprintf(stderr, "write%s[%llu] %lu bytes to %llu\n",
+ fprintf(stderr,
+ "write%s[%llu] %lu bytes to %llu flags: 0x%x\n",
fi->writepage ? "page" : "",
(unsigned long long) fi->fh,
- (unsigned long) size, (unsigned long long) off);
+ (unsigned long) size, (unsigned long long) off,
+ fi->flags);
res = fs->op.write(path, buf, size, off, fi);
memset(&fi, 0, sizeof(fi));
fi.fh = arg->fh;
fi.fh_old = fi.fh;
+ if (req->f->conn.proto_minor >= 9) {
+ fi.lock_owner = arg->lock_owner;
+ fi.flags = arg->flags;
+ }
req->f->op.read(req, nodeid, arg->size, arg->offset, &fi);
} else
fuse_reply_err(req, ENOSYS);
fi.fh_old = fi.fh;
fi.writepage = arg->write_flags & 1;
- if (req->f->conn.proto_minor < 9)
+ if (req->f->conn.proto_minor < 9) {
param = ((char *) arg) + FUSE_COMPAT_WRITE_IN_SIZE;
- else
+ } else {
+ fi.lock_owner = arg->lock_owner;
+ fi.flags = arg->flags;
param = PARAM(arg);
+ }
if (req->f->op.write)
req->f->op.write(req, nodeid, param, arg->size,