summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/performance/io-cache/src/io-cache.h1
-rw-r--r--xlators/performance/io-cache/src/page.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h
index 1ce4e90325a..c3c631dbace 100644
--- a/xlators/performance/io-cache/src/io-cache.h
+++ b/xlators/performance/io-cache/src/io-cache.h
@@ -127,6 +127,7 @@ struct ioc_page {
struct iobref *iobref;
pthread_mutex_t page_lock;
int32_t op_errno;
+ char stale;
};
struct ioc_cache {
diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c
index a809a80fd05..50357199f44 100644
--- a/xlators/performance/io-cache/src/page.c
+++ b/xlators/performance/io-cache/src/page.c
@@ -111,6 +111,7 @@ __ioc_page_destroy (ioc_page_t *page)
if (page->waitq) {
/* frames waiting on this page, do not destroy this page */
page_size = -1;
+ page->stale = 1;
} else {
rbthash_remove (page->inode->cache.page_table, &page->offset,
sizeof (page->offset));
@@ -956,6 +957,10 @@ __ioc_page_wakeup (ioc_page_t *page, int32_t op_errno)
}
}
+ if (page->stale) {
+ __ioc_page_destroy (page);
+ }
+
out:
return waitq;
}