From f114d4dac6f842212e248f2ed4a50ce3249109d8 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 10 Jul 2019 20:47:40 -0400 Subject: [PATCH] LU-12477 llite: use generic_error_remove_page() lustre's internal ll_invalidate_page() is behaviourally identical to generic_error_remove_page(). In the case of lustre it isn't a memory hardware error that requires the page being invalidated, it is the loss of a lock, which will likely result in the data changing on the server. In either case, we don't want the page to be accessed any more, so the same removal is appropriate. Linux-commit: d5419b40599b4d6e030695dad30f15347679be66 Change-Id: I92686b5332eec02580563c1bee779688e8e591a3 Acked-by: Oleg Drokin Signed-off-by: NeilBrown Reviewed-on: https://review.whamcloud.com/35461 Tested-by: jenkins Reviewed-by: Lai Siyao Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/llite/llite_internal.h | 17 ----------------- lustre/llite/vvp_io.c | 2 +- lustre/llite/vvp_page.c | 4 ++-- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 94af886..20bdcbb 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -1142,23 +1142,6 @@ void policy_from_vma(union ldlm_policy_data *policy, struct vm_area_struct *vma, struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr, size_t count); -static inline void ll_invalidate_page(struct page *vmpage) -{ - struct address_space *mapping = vmpage->mapping; - loff_t offset = vmpage->index << PAGE_SHIFT; - - LASSERT(PageLocked(vmpage)); - if (mapping == NULL) - return; - - /* - * truncate_complete_page() calls - * a_ops->invalidatepage()->cl_page_delete()->vvp_page_delete(). - */ - ll_teardown_mmaps(mapping, offset, offset + PAGE_SIZE); - truncate_complete_page(mapping, vmpage); -} - #define ll_s2sbi(sb) (s2lsi(sb)->lsi_llsbi) /* don't need an addref as the sb_info should be holding one */ diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index 44fb6ec..3588d6a 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -1239,7 +1239,7 @@ static int vvp_io_fault_start(const struct lu_env *env, LASSERT(PageLocked(vmpage)); if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_FAULT_TRUNC_RACE)) - ll_invalidate_page(vmpage); + generic_error_remove_page(vmpage->mapping, vmpage); size = i_size_read(inode); /* Though we have already held a cl_lock upon this page, but diff --git a/lustre/llite/vvp_page.c b/lustre/llite/vvp_page.c index 064e86e..8efcba8 100644 --- a/lustre/llite/vvp_page.c +++ b/lustre/llite/vvp_page.c @@ -153,7 +153,7 @@ static void vvp_page_discard(const struct lu_env *env, if (vpg->vpg_defer_uptodate && !vpg->vpg_ra_used) ll_ra_stats_inc(vmpage->mapping->host, RA_STAT_DISCARDED); - ll_invalidate_page(vmpage); + generic_error_remove_page(vmpage->mapping, vmpage); } static void vvp_page_delete(const struct lu_env *env, @@ -281,7 +281,7 @@ static void vvp_page_completion_read(const struct lu_env *env, /* mirror read failed, it needs to destroy the page * because subpage would be from wrong osc when trying * to read from a new mirror */ - ll_invalidate_page(vmpage); + generic_error_remove_page(vmpage->mapping, vmpage); } } -- 1.8.3.1