Skip to contentSkip to conversation

gfs2: Use list_move_tail instead of list_del/list_add_tail

PATCH Superseded Baokun Li 2 participants 2 messages Jun 8, 2021 – Jun 9, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Baokun Li

author
#0 lore raw

PATCH 1/1 gfs2: Use list_move_tail instead of list_del/list_add_tail

Using list_move_tail() instead of list_del() + list_add_tail().

---
 fs/gfs2/glock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/gfs2/glock.c +1 -2
index f6cae2ee1c83..902dd7385462 100644
@@ -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);
#1 lore raw
Quoted 1 line · Baokun Li

Using list_move_tail() instead of list_del() + list_add_tail().

Thanks, I'll add that to for-next.

Andreas