aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse.c12
-rw-r--r--lib/fuse_lowlevel.c11
2 files changed, 17 insertions, 6 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 805833e..9c5dd0f 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -1230,9 +1230,11 @@ int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t size,
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);
@@ -1257,10 +1259,12 @@ int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *buf,
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);
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 048b2cc..df88f26 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -648,6 +648,10 @@ static void do_read(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
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);
@@ -664,10 +668,13 @@ static void do_write(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
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,