From 5475b26fd48ba01e47eb410e56b6c40ba1c0d4a7 Mon Sep 17 00:00:00 2001 From: "Mr. NeilBrown" Date: Mon, 23 Jan 2023 16:45:05 -0500 Subject: [PATCH] LU-6142 ldlm: use list_first_entry in ldlm_lockd.c This is only a small simplification, but it makes the code a little clearer. Linux-commit: 7378caf4fe5198ce572654c926437fba12fb2255 Change-Id: Ie65049e12a1b1bbe448baefc38a6657d831e0670 Signed-off-by: Mr. NeilBrown Signed-off-by: Greg Kroah-Hartman Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49737 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Jian Yu Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lustre/ldlm/ldlm_lockd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index a5b20b5..47915b2 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2805,13 +2805,13 @@ static int ldlm_bl_get_work(struct ldlm_bl_pool *blp, /* process a request from the blp_list at least every blp_num_threads */ if (!list_empty(&blp->blp_list) && (list_empty(&blp->blp_prio_list) || num_bl == 0)) - blwi = list_entry(blp->blp_list.next, - struct ldlm_bl_work_item, blwi_entry); + blwi = list_first_entry(&blp->blp_list, + struct ldlm_bl_work_item, blwi_entry); else if (!list_empty(&blp->blp_prio_list)) - blwi = list_entry(blp->blp_prio_list.next, - struct ldlm_bl_work_item, - blwi_entry); + blwi = list_first_entry(&blp->blp_prio_list, + struct ldlm_bl_work_item, + blwi_entry); if (blwi) { if (++num_bl >= num_th) -- 1.8.3.1