[lustre-devel] [PATCH 23/33] lnet: use list_first_entry() where appropriate.
James Simmons
jsimmons at infradead.org
Sun Feb 2 12:46:23 PST 2025
From: Mr NeilBrown <neilb at suse.de>
Lustre already uses list_first_entry() in many places, but
it is not consistent. Let's make it consistent.
The patch was generated with
sed -i 's/list_entry(([^,]*)->next,/list_first_entry(1,/'
`git grep -l 'list_entry(.*->next' lustre/ lnet/ libcfs/ `
followed by some manual cleanup of indents.
WC-bug-id: https://jira.whamcloud.com/browse/LU-6142
Lustre-commit: 01e054b34cb894bd4 ("LU-6142 all: use list_first_entry() where appropriate.")
Signed-off-by: Mr NeilBrown <neilb at suse.de>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50826
Reviewed-by: Arshad Hussain <arshad.hussain at aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
net/lnet/lnet/lib-move.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index 9d50260d917a..d9f5eb94ff6e 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -3162,8 +3162,8 @@ lnet_resend_pending_msgs_locked(struct list_head *resendq, int cpt)
while (!list_empty(resendq)) {
struct lnet_peer_ni *lpni;
- msg = list_entry(resendq->next, struct lnet_msg,
- msg_list);
+ msg = list_first_entry(resendq, struct lnet_msg,
+ msg_list);
list_del_init(&msg->msg_list);
--
2.39.3
More information about the lustre-devel
mailing list