gfs2: Use list_move_tail instead of list_del/list_add_tail
authorBaokun Li <libaokun1@huawei.com>
Tue, 8 Jun 2021 03:12:44 +0000 (11:12 +0800)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 28 Jun 2021 12:13:38 +0000 (14:13 +0200)
Using list_move_tail() instead of list_del() + list_add_tail().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c

index d9cb261..1f3902e 100644 (file)
@@ -212,8 +212,7 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl)
 
        spin_lock(&lru_lock);
 
-       list_del(&gl->gl_lru);
-       list_add_tail(&gl->gl_lru, &lru_list);
+       list_move_tail(&gl->gl_lru, &lru_list);
 
        if (!test_bit(GLF_LRU, &gl->gl_flags)) {
                set_bit(GLF_LRU, &gl->gl_flags);