From 5237c44194a5605257b09af5b421dd6995645e65 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 15 Jul 2013 22:27:17 +0800 Subject: [PATCH] staging/lustre: fix for invalidatepage() API change somehow this got dropped during merge window... Signed-off-by: Stephen Rothwell Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- .../lustre/lustre/include/linux/lustre_patchless_compat.h | 2 +- drivers/staging/lustre/lustre/llite/rw26.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h b/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h index a8e9c0c8ffd2..a260e99a4447 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h @@ -53,7 +53,7 @@ truncate_complete_page(struct address_space *mapping, struct page *page) return; if (PagePrivate(page)) - page->mapping->a_ops->invalidatepage(page, 0); + page->mapping->a_ops->invalidatepage(page, 0, PAGE_CACHE_SIZE); cancel_dirty_page(page, PAGE_SIZE); ClearPageMappedToDisk(page); diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c index 27e4e64bc1e7..f1a1c5f40a1d 100644 --- a/drivers/staging/lustre/lustre/llite/rw26.c +++ b/drivers/staging/lustre/lustre/llite/rw26.c @@ -72,7 +72,8 @@ * aligned truncate). Lustre leaves partially truncated page in the cache, * relying on struct inode::i_size to limit further accesses. */ -static void ll_invalidatepage(struct page *vmpage, unsigned long offset) +static void ll_invalidatepage(struct page *vmpage, unsigned int offset, + unsigned int length) { struct inode *inode; struct lu_env *env; @@ -89,7 +90,7 @@ static void ll_invalidatepage(struct page *vmpage, unsigned long offset) * below because they are run with page locked and all our io is * happening with locked page too */ - if (offset == 0) { + if (offset == 0 && length == PAGE_CACHE_SIZE) { env = cl_env_get(&refcheck); if (!IS_ERR(env)) { inode = vmpage->mapping->host; -- 2.20.1