Whamcloud - gitweb
LU-6142 ldlm: use list_first_entry in ldlm_lockd.c 37/49737/2
authorMr. NeilBrown <neilb@suse.de>
Mon, 23 Jan 2023 21:45:05 +0000 (16:45 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 3 Feb 2023 06:49:12 +0000 (06:49 +0000)
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 <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49737
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_lockd.c

index a5b20b5..47915b2 100644 (file)
@@ -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)