diff options
author | Amar Tumballi <amar@gluster.com> | 2012-02-06 17:49:14 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-02-14 01:09:02 -0800 |
commit | 0e6df0100e13123fe38f28c5a090777e894d8f52 (patch) | |
tree | 517c60cc953302172cb51f22f4b7aa52e557c1e9 /xlators/mount | |
parent | e17ac220e4bff53fb89f5bea636acb61e347cf50 (diff) |
core: add an extra flag to readv()/writev() API
needed to implement a proper handling of open flag alterations
using fcntl() on fd.
Change-Id: Ic280d5db6f1dc0418d5c439abb8db1d3ac21ced0
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2723
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 13 | ||||
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.h | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 6537c0bcc83..1da2dcdb223 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1902,7 +1902,7 @@ fuse_readv_resume (fuse_state_t *state) state->finh->unique, state->fd, state->size, state->off); FUSE_FOP (state, fuse_readv_cbk, GF_FOP_READ, - readv, state->fd, state->size, state->off); + readv, state->fd, state->size, state->off, state->io_flags); } static void @@ -1930,6 +1930,8 @@ fuse_readv (xlator_t *this, fuse_in_header_t *finh, void *msg) state->size = fri->size; state->off = fri->offset; + /* lets ignore 'fri->read_flags', but just consider 'fri->flags' */ + state->io_flags = fri->flags; fuse_resolve_and_resume (state, fuse_readv_resume); } @@ -1995,7 +1997,7 @@ fuse_write_resume (fuse_state_t *state) state->finh->unique, state->fd, state->size, state->off); FUSE_FOP (state, fuse_writev_cbk, GF_FOP_WRITE, writev, state->fd, - &state->vector, 1, state->off, iobref); + &state->vector, 1, state->off, state->io_flags, iobref); iobref_unref (iobref); } @@ -2021,6 +2023,13 @@ fuse_write (xlator_t *this, fuse_in_header_t *finh, void *msg) state->size = fwi->size; state->off = fwi->offset; + /* lets ignore 'fwi->write_flags', but just consider 'fwi->flags' */ + state->io_flags = fwi->flags; + /* TODO: may need to handle below flag + (fwi->write_flags & FUSE_WRITE_CACHE); + */ + + fuse_resolve_fd_init (state, &state->resolve, fd); /* See comment by similar code in fuse_settatr */ diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h index 489e6d6456d..d9783f2e054 100644 --- a/xlators/mount/fuse/src/fuse-bridge.h +++ b/xlators/mount/fuse/src/fuse-bridge.h @@ -292,6 +292,7 @@ typedef struct { struct iovec vector; uuid_t gfid; + uint32_t io_flags; } fuse_state_t; typedef struct fuse_fd_ctx { |