summaryrefslogtreecommitdiffstats
path: root/fs/fscache/page.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-07-21 16:32:06 +0200
committerArnd Bergmann <arnd@arndb.de>2011-07-21 16:32:06 +0200
commit5ddac6bc1c4bfcbf645d18668a5033ca257a8ea7 (patch)
treea8a74ef15a3622ecc3ab94a424321de8b111648b /fs/fscache/page.c
parentc33d4326b60a3aea5cd070a365043f488f81a3b0 (diff)
parent89e1c3d0fffa0d610fa7292bbfafb5e87dc6be34 (diff)
downloadop-kernel-dev-5ddac6bc1c4bfcbf645d18668a5033ca257a8ea7.zip
op-kernel-dev-5ddac6bc1c4bfcbf645d18668a5033ca257a8ea7.tar.gz
Merge branch 'next-samsung-board' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/board
Diffstat (limited to 'fs/fscache/page.c')
-rw-r--r--fs/fscache/page.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index a2a5d19..2f343b4 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -954,3 +954,47 @@ void fscache_mark_pages_cached(struct fscache_retrieval *op,
pagevec_reinit(pagevec);
}
EXPORT_SYMBOL(fscache_mark_pages_cached);
+
+/*
+ * Uncache all the pages in an inode that are marked PG_fscache, assuming them
+ * to be associated with the given cookie.
+ */
+void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
+ struct inode *inode)
+{
+ struct address_space *mapping = inode->i_mapping;
+ struct pagevec pvec;
+ pgoff_t next;
+ int i;
+
+ _enter("%p,%p", cookie, inode);
+
+ if (!mapping || mapping->nrpages == 0) {
+ _leave(" [no pages]");
+ return;
+ }
+
+ pagevec_init(&pvec, 0);
+ next = 0;
+ while (next <= (loff_t)-1 &&
+ pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)
+ ) {
+ for (i = 0; i < pagevec_count(&pvec); i++) {
+ struct page *page = pvec.pages[i];
+ pgoff_t page_index = page->index;
+
+ ASSERTCMP(page_index, >=, next);
+ next = page_index + 1;
+
+ if (PageFsCache(page)) {
+ __fscache_wait_on_page_write(cookie, page);
+ __fscache_uncache_page(cookie, page);
+ }
+ }
+ pagevec_release(&pvec);
+ cond_resched();
+ }
+
+ _leave("");
+}
+EXPORT_SYMBOL(__fscache_uncache_all_inode_pages);
OpenPOWER on IntegriCloud