From 3f6e5e670b7c1e30c64f2f11419947bd8982d51b Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 4 Aug 2010 22:24:51 +0000 Subject: performance/io-cache: Disable caching when files are opened with GF_OPEN_NOWB Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 1168 (Disable caching when files are opened with GF_OPEN_NOWB) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1168 --- xlators/performance/io-cache/src/io-cache.c | 5 +++++ xlators/performance/io-cache/src/io-cache.h | 1 + 2 files changed, 6 insertions(+) (limited to 'xlators/performance/io-cache') diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index e4ca446c..211f47ec 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -555,6 +555,11 @@ ioc_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, fd_ctx_set (fd, this, 1); } + if ((local->wbflags & GF_OPEN_NOWB) != 0) { + /* disable caching as asked by NFS */ + fd_ctx_set (fd, this, 1); + } + /* weight = 0, we disable caching on it */ if (weight == 0) { /* we allow a pattern-matched cache disable this way diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h index 0b164efe..d01344fe 100644 --- a/xlators/performance/io-cache/src/io-cache.h +++ b/xlators/performance/io-cache/src/io-cache.h @@ -84,6 +84,7 @@ struct ioc_fill { struct ioc_local { mode_t mode; int32_t flags; + int32_t wbflags; loc_t file_loc; off_t offset; size_t size; -- cgit