[lustre-devel] [PATCH 2/3] lustre: use delete_from_page_cache() for directory pages.

NeilBrown neilb at suse.com
Sun Jun 24 17:02:55 PDT 2018


lustre sometimes uses the internal function truncate_complete_page()
to remove a page of a directory.
Must of what this function does, does not apply to directory pages
as there is no invalidatepage function, and at these times, the
page is not dirty.
The only useful part of the function is delete_from_page_cache(),
so just call that directly.

Signed-off-by: NeilBrown <neilb at suse.com>
---
 drivers/staging/lustre/lustre/llite/dir.c       | 2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 688dddf3ca47..52a8ecc2e2e0 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -168,7 +168,7 @@ void ll_release_page(struct inode *inode, struct page *page, bool remove)
 	if (remove) {
 		lock_page(page);
 		if (likely(page->mapping))
-			truncate_complete_page(page->mapping, page);
+			delete_from_page_cache(page);
 		unlock_page(page);
 	}
 	put_page(page);
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index cff31cb0a9ac..827ed0ca0987 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -927,7 +927,7 @@ static void mdc_release_page(struct page *page, int remove)
 	if (remove) {
 		lock_page(page);
 		if (likely(page->mapping))
-			truncate_complete_page(page->mapping, page);
+			delete_from_page_cache(page);
 		unlock_page(page);
 	}
 	put_page(page);
-- 
2.14.0.rc0.dirty

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20180625/9f5eb849/attachment.sig>


More information about the lustre-devel mailing list