]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fs/dlm: use list_add_tail() instead of open-coding list insertion
authorShaurya Rane <ssrane_b23@ee.vjti.ac.in>
Tue, 20 Jan 2026 15:35:07 +0000 (10:35 -0500)
committerDavid Teigland <teigland@redhat.com>
Tue, 20 Jan 2026 18:07:31 +0000 (12:07 -0600)
Replace the manual list pointer manipulation in add_ordered_member()
with the standard list_add_tail() helper. The original code explicitly
updated ->prev and ->next pointers to insert @newlist before @tmp,
which is exactly what list_add_tail(newlist, tmp) provides.

Using the list macro improves readability, removes a source of
potential pointer bugs, and satisfies the existing FIXME requesting
conversion to the list helpers. No functional change in the ordering
logic for DLM members.

Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/member.c

index c0f557a80a7542a4cdcca9d78af18b23a0df237c..c1b5598997b7f7289684bf265e1923ae6f5dece0 100644 (file)
@@ -299,11 +299,7 @@ static void add_ordered_member(struct dlm_ls *ls, struct dlm_member *new)
        if (!memb)
                list_add_tail(newlist, head);
        else {
-               /* FIXME: can use list macro here */
-               newlist->prev = tmp->prev;
-               newlist->next = tmp;
-               tmp->prev->next = newlist;
-               tmp->prev = newlist;
+               list_add_tail(newlist, tmp);
        }
 }