From 4e9757859750eb3625828f83681845f1352af356 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Tue, 7 Jul 2009 02:33:31 +0000 Subject: read-ahead: use O_ACCMODE for checking file access modes. Signed-off-by: Anand V. Avati --- xlators/performance/read-ahead/src/read-ahead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index c4052e54..49cf0b9b 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; -- cgit