fs: dlm: plock use list_first_entry
authorAlexander Aring <aahringo@redhat.com>
Wed, 22 Jun 2022 18:45:04 +0000 (14:45 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 23 Jun 2022 19:22:10 +0000 (14:22 -0500)
This patch will use the list helper list_first_entry() instead of using
list_entry() to get the first element of a list.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/plock.c

index 0993eebf206053bd269d1d0d792f023ffa0a1647..7cab5d27132b8704678387597279bfb85262dac0 100644 (file)
@@ -378,7 +378,7 @@ static ssize_t dev_read(struct file *file, char __user *u, size_t count,
 
        spin_lock(&ops_lock);
        if (!list_empty(&send_list)) {
-               op = list_entry(send_list.next, struct plock_op, list);
+               op = list_first_entry(&send_list, struct plock_op, list);
                if (op->info.flags & DLM_PLOCK_FL_CLOSE)
                        list_del(&op->list);
                else