From: Mr NeilBrown Date: Tue, 28 Apr 2020 23:27:51 +0000 (+1000) Subject: LU-10467 llite: clean up pcc_layout_wait() X-Git-Tag: 2.13.54~106 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c5a311781fc60c9a91483b737d3f59096949439e LU-10467 llite: clean up pcc_layout_wait() pcc_layout_wait() contains a pointless while loop (and an unnecessary blank line) and is a trivial function that is only called once. So move the code into __pcc_layout_invalidate(), remove the while loop, and generally tidy up. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I4a7c721a562682906dec4996bfbdad03e26a01dd Reviewed-on: https://review.whamcloud.com/38403 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Yingjin Qian Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/pcc.c b/lustre/llite/pcc.c index 70da52d..9b00644 100644 --- a/lustre/llite/pcc.c +++ b/lustre/llite/pcc.c @@ -2050,22 +2050,17 @@ int pcc_fault(struct vm_area_struct *vma, struct vm_fault *vmf, RETURN(rc); } -static void pcc_layout_wait(struct pcc_inode *pcci) -{ - - while (atomic_read(&pcci->pcci_active_ios) > 0) { - CDEBUG(D_CACHE, "Waiting for IO completion: %d\n", - atomic_read(&pcci->pcci_active_ios)); - wait_event_idle(pcci->pcci_waitq, - atomic_read(&pcci->pcci_active_ios) == 0); - } -} - static void __pcc_layout_invalidate(struct pcc_inode *pcci) { pcci->pcci_type = LU_PCC_NONE; pcc_layout_gen_set(pcci, CL_LAYOUT_GEN_NONE); - pcc_layout_wait(pcci); + if (atomic_read(&pcci->pcci_active_ios) == 0) + return; + + CDEBUG(D_CACHE, "Waiting for IO completion: %d\n", + atomic_read(&pcci->pcci_active_ios)); + wait_event_idle(pcci->pcci_waitq, + atomic_read(&pcci->pcci_active_ios) == 0); } void pcc_layout_invalidate(struct inode *inode)