summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@zresearch.com>2009-07-07 02:33:15 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-07 16:24:51 -0700
commitecc844dc15fffacaf37916e4570e520534f2545c (patch)
tree67e39526553cabd1e4dacadbab5f9152290358c4
parentc8ef6e541f4dacd58258b0448046d4fae2c511be (diff)
write-behind: Use O_ACCMODE while checking for access modes.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
-rw-r--r--xlators/performance/write-behind/src/write-behind.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index ebf6be062de..26981d4d8aa 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1127,7 +1127,7 @@ wb_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
if (frame->local) {
flags = (long)frame->local;
if (((flags & O_DIRECT) == O_DIRECT)
- || ((flags & O_RDONLY) == O_RDONLY)
+ || ((flags & O_ACCMODE) == O_RDONLY)
|| (((flags & O_SYNC) == O_SYNC)
&& conf->enable_O_SYNC == _gf_true)) {
file->window_size = 0;
@@ -1186,7 +1186,7 @@ wb_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (frame->local) {
flags = (long)frame->local;
if (((flags & O_DIRECT) == O_DIRECT)
- || ((flags & O_RDONLY) == O_RDONLY)
+ || ((flags & O_ACCMODE) == O_RDONLY)
|| (((flags & O_SYNC) == O_SYNC)
&& (conf->enable_O_SYNC == _gf_true))) {
file->window_size = 0;