From 0e6df0100e13123fe38f28c5a090777e894d8f52 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 6 Feb 2012 17:49:14 +0530 Subject: 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 BUG: 782265 Reviewed-on: http://review.gluster.com/2723 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mount/fuse/src/fuse-bridge.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'xlators/mount/fuse/src/fuse-bridge.c') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 6537c0bcc..1da2dcdb2 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 */ -- cgit