summaryrefslogtreecommitdiffstats
path: root/xlators/performance/read-ahead
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-08-08 12:16:25 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-08-17 14:38:02 -0700
commitb28a47cea459658ae6a2c8a4126614ec04170a16 (patch)
tree5dc966a5388c94ecb0745ed526cb18fcf50fd530 /xlators/performance/read-ahead
parenteb25bfe02562b229600a1c23149868432992cf2f (diff)
read-ahead: use O_ACCMODE for checking file access modes.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 196 (write-behind window size getting set to 0.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=196
Diffstat (limited to 'xlators/performance/read-ahead')
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index b2703ad8d..c24565d8d 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -74,7 +74,7 @@ ra_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
/* If O_DIRECT open, we disable caching on it */
- if ((fd->flags & O_DIRECT) || (fd->flags & O_WRONLY))
+ if ((fd->flags & O_DIRECT) || ((fd->flags & O_ACCMODE) == O_WRONLY))
file->disabled = 1;
file->offset = (unsigned long long) 0;
@@ -143,7 +143,7 @@ ra_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
/* If O_DIRECT open, we disable caching on it */
- if ((fd->flags & O_DIRECT) || (fd->flags & O_WRONLY))
+ if ((fd->flags & O_DIRECT) || ((fd->flags & O_ACCMODE) == O_WRONLY))
file->disabled = 1;
file->offset = (unsigned long long) 0;