Whamcloud - gitweb
LU-6142 lov: use list_for_each_entry in lov_obd.c 40/49740/3
authorMr. NeilBrown <neilb@suse.de>
Mon, 23 Jan 2023 21:58:40 +0000 (16:58 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 14 Feb 2023 06:03:07 +0000 (06:03 +0000)
Using the *_entry macro simplifies the code slightly.

Change-Id: Ia50cd2cbaf9bac6c9873ef4af7e5cbfa2c8e660e
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/+/49740
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_obd.c

index c566774..04cc3ad 100644 (file)
@@ -779,8 +779,7 @@ out:
 static int lov_cleanup(struct obd_device *obd)
 {
         struct lov_obd *lov = &obd->u.lov;
-       struct list_head *pos, *tmp;
-        struct pool_desc *pool;
+       struct pool_desc *pool, *tmp;
         ENTRY;
 
        if (lov->lov_tgts_kobj) {
@@ -788,8 +787,7 @@ static int lov_cleanup(struct obd_device *obd)
                lov->lov_tgts_kobj = NULL;
        }
 
-       list_for_each_safe(pos, tmp, &lov->lov_pool_list) {
-               pool = list_entry(pos, struct pool_desc, pool_list);
+       list_for_each_entry_safe(pool, tmp, &lov->lov_pool_list, pool_list) {
                 /* free pool structs */
                 CDEBUG(D_INFO, "delete pool %p\n", pool);
                /* In the function below, .hs_keycmp resolves to