From 51136f2dc68f1d0699b11fe482c8ef1a24c3a1fb Mon Sep 17 00:00:00 2001 From: "Mr. NeilBrown" Date: Mon, 23 Jan 2023 16:58:40 -0500 Subject: [PATCH] LU-6142 lov: use list_for_each_entry in lov_obd.c Using the *_entry macro simplifies the code slightly. Change-Id: Ia50cd2cbaf9bac6c9873ef4af7e5cbfa2c8e660e Signed-off-by: Mr. NeilBrown Signed-off-by: Greg Kroah-Hartman Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49740 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/lov/lov_obd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index c566774..04cc3ad 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -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 -- 1.8.3.1