summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-08-04 22:24:51 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-06 03:37:44 -0700
commit3f6e5e670b7c1e30c64f2f11419947bd8982d51b (patch)
tree22453e61fbe87cdee6a393af5f31d8fb4403095c /xlators/performance
parente85069767b28fe12cf3dcc4ccf1a5cfc10753c4b (diff)
performance/io-cache: Disable caching when files are opened with GF_OPEN_NOWB
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> 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
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c5
-rw-r--r--xlators/performance/io-cache/src/io-cache.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index e4ca446cf5b..211f47ece8a 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 0b164efe4f4..d01344fef99 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;