diff options
author | Anand Avati <avati@redhat.com> | 2013-05-18 20:35:30 -0700 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-06-08 14:49:59 -0700 |
commit | aa51ae9d99ac5ee10849392352743d6d92cfed9f (patch) | |
tree | 7ce08cb36cf0c64c495c8fea7c6d5747bdea078e | |
parent | 76f6dfdf50e9bb8905fc485e3519510e29e283be (diff) |
quick-read: prune cache on write/[f]truncate
Cache needs to be pruned on write and [f]truncate. The lack of this
is causing Samba ping-pong test to return wierd 'data increment' values
during startup.
Change-Id: I9cd6a839bcd02de738d78638211b78f382f58e0a
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5158
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 1a0f8675e..c2ddd0df0 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -622,6 +622,46 @@ wind: int +qr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *iov, + int count, off_t offset, uint32_t flags, struct iobref *iobref, + dict_t *xdata) +{ + qr_inode_prune (this, fd->inode); + + STACK_WIND (frame, default_writev_cbk, + FIRST_CHILD (this), FIRST_CHILD (this)->fops->writev, + fd, iov, count, offset, flags, iobref, xdata); + return 0; +} + + +int +qr_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, + dict_t *xdata) +{ + qr_inode_prune (this, loc->inode); + + STACK_WIND (frame, default_truncate_cbk, + FIRST_CHILD (this), FIRST_CHILD (this)->fops->truncate, + loc, offset, xdata); + return 0; +} + + +int +qr_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, + dict_t *xdata) +{ + qr_inode_prune (this, fd->inode); + + STACK_WIND (frame, default_ftruncate_cbk, + FIRST_CHILD (this), FIRST_CHILD (this)->fops->ftruncate, + fd, offset, xdata); + return 0; +} + + +int qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd, dict_t *xdata) { @@ -1066,6 +1106,9 @@ struct xlator_fops fops = { .readdirp = qr_readdirp, .open = qr_open, .readv = qr_readv, + .writev = qr_writev, + .truncate = qr_truncate, + .ftruncate = qr_ftruncate }; struct xlator_cbks cbks = { |