Skip to content

Commit f83c7b5

Browse files
josephhztorvalds
authored andcommitted
ocfs2/dlm: use list_for_each_entry instead of list_for_each
Use list_for_each_entry instead of list_for_each to simplify code. Signed-off-by: Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0e3d9ea commit f83c7b5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/ocfs2/dlm/dlmrecovery.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
17761776
struct dlm_migratable_lockres *mres)
17771777
{
17781778
struct dlm_migratable_lock *ml;
1779-
struct list_head *queue, *iter;
1779+
struct list_head *queue;
17801780
struct list_head *tmpq = NULL;
17811781
struct dlm_lock *newlock = NULL;
17821782
struct dlm_lockstatus *lksb = NULL;
@@ -1821,9 +1821,7 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
18211821
spin_lock(&res->spinlock);
18221822
for (j = DLM_GRANTED_LIST; j <= DLM_BLOCKED_LIST; j++) {
18231823
tmpq = dlm_list_idx_to_ptr(res, j);
1824-
list_for_each(iter, tmpq) {
1825-
lock = list_entry(iter,
1826-
struct dlm_lock, list);
1824+
list_for_each_entry(lock, tmpq, list) {
18271825
if (lock->ml.cookie == ml->cookie)
18281826
break;
18291827
lock = NULL;

0 commit comments

Comments
 (0)