diff options
| author | Jeff Darcy <jdarcy@fb.com> | 2017-08-31 12:33:59 -0700 |
|---|---|---|
| committer | Jeff Darcy <jdarcy@fb.com> | 2017-08-31 12:33:59 -0700 |
| commit | ed23e379ee397b3fed479c15b7551d2dbba9a05f (patch) | |
| tree | fe9bc23b851e0ee5502a48f1362b3ef9b10052f3 /xlators/performance | |
| parent | f2d57485d57e14a064c9ca6e83fe6c92131a8e37 (diff) | |
| parent | d174f021a4e0667e60ce6abc038106ad9b74dc74 (diff) | |
Merge remote-tracking branch 'origin/release-3.8' into release-3.8-fb
Change-Id: Ie35cd1c8c7808949ddf79b3189f1f8bf0ff70ed8
Diffstat (limited to 'xlators/performance')
| -rw-r--r-- | xlators/performance/read-ahead/src/page.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/performance/read-ahead/src/page.c b/xlators/performance/read-ahead/src/page.c index 216e327af74..17e346ec947 100644 --- a/xlators/performance/read-ahead/src/page.c +++ b/xlators/performance/read-ahead/src/page.c @@ -139,6 +139,7 @@ ra_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ra_waitq_t *waitq = NULL; fd_t *fd = NULL; uint64_t tmp_file = 0; + gf_boolean_t stale = _gf_false; GF_ASSERT (frame); @@ -174,6 +175,13 @@ ra_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } + if (page->stale) { + page->stale = 0; + page->ready = 0; + stale = 1; + goto unlock; + } + /* * "Dirty" means that the request was a pure read-ahead; it's * set for requests we issue ourselves, and cleared when user @@ -219,6 +227,16 @@ ra_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this, unlock: ra_file_unlock (file); + if (stale) { + STACK_WIND (frame, ra_fault_cbk, + FIRST_CHILD (frame->this), + FIRST_CHILD (frame->this)->fops->readv, + local->fd, local->pending_size, + local->pending_offset, 0, NULL); + + return 0; + } + ra_waitq_return (waitq); fd_unref (local->fd); |
