summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-05-05 07:59:03 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-07-29 18:37:53 -0700
commit3492f539a21223798dcadbb92e24cb7eb6cbf154 (patch)
treee407787bd8cdba344e7a25b7de7ffa5892e102ca /xlators
parent4a49d3116b00811b7a4ba98f51bb27da0fa63d5c (diff)
protocol/client: Filter o-direct in readv/writev
>Change-Id: I519c666b3a7c0db46d47e08a6a7e2dbecc05edf2 >BUG: 1322214 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> >Reviewed-on: http://review.gluster.org/14215 >Smoke: Gluster Build System <jenkins@build.gluster.com> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> >(cherry picked from commit 74837896c38bafdd862f164d147b75fcbb619e8f) BUG: 1360785 Pranith Kumar K <pkarampu@redhat.com> Change-Id: Ib4013b10598b0b988b9f9f163296b6afa425f8fd Reviewed-on: http://review.gluster.org/15050 Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/protocol/client/src/client.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 2e9fb4c..3191a98 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -36,6 +36,13 @@ int client_init_rpc (xlator_t *this);
int client_destroy_rpc (xlator_t *this);
int client_mark_fd_bad (xlator_t *this);
+static void
+client_filter_o_direct (clnt_conf_t *conf, int32_t *flags)
+{
+ if (conf->filter_o_direct)
+ *flags = (*flags & ~O_DIRECT);
+}
+
static int
client_fini_complete (xlator_t *this)
{
@@ -797,11 +804,9 @@ client_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
args.fd = fd;
args.umask = umask;
args.xdata = xdata;
+ args.flags = flags;
- if (!conf->filter_o_direct)
- args.flags = flags;
- else
- args.flags = (flags & ~O_DIRECT);
+ client_filter_o_direct (conf, &args.flags);
proc = &conf->fops->proctable[GF_FOP_CREATE];
if (proc->fn)
@@ -832,11 +837,9 @@ client_open (call_frame_t *frame, xlator_t *this, loc_t *loc,
args.loc = loc;
args.fd = fd;
args.xdata = xdata;
+ args.flags = flags;
- if (!conf->filter_o_direct)
- args.flags = flags;
- else
- args.flags = (flags & ~O_DIRECT);
+ client_filter_o_direct (conf, &args.flags);
proc = &conf->fops->proctable[GF_FOP_OPEN];
if (proc->fn)
@@ -870,6 +873,8 @@ client_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
args.flags = flags;
args.xdata = xdata;
+ client_filter_o_direct (conf, &args.flags);
+
proc = &conf->fops->proctable[GF_FOP_READ];
if (proc->fn)
ret = proc->fn (frame, this, &args);
@@ -908,6 +913,8 @@ client_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
args.iobref = iobref;
args.xdata = xdata;
+ client_filter_o_direct (conf, &args.flags);
+
proc = &conf->fops->proctable[GF_FOP_WRITE];
if (proc->fn)
ret = proc->fn (frame, this, &args);