ceph: use list_move instead of list_del/list_add
authorWei Yongjun <weiyj.lk@gmail.com>
Sat, 13 Aug 2016 09:10:28 +0000 (09:10 +0000)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 3 Oct 2016 14:13:50 +0000 (16:13 +0200)
Using list_move() instead of list_del() + list_add().

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c

index 277ac9c..815acd1 100644 (file)
@@ -1151,8 +1151,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
                while (!list_empty(&ci->i_cap_flush_list)) {
                        cf = list_first_entry(&ci->i_cap_flush_list,
                                              struct ceph_cap_flush, i_list);
-                       list_del(&cf->i_list);
-                       list_add(&cf->i_list, &to_remove);
+                       list_move(&cf->i_list, &to_remove);
                }
 
                spin_lock(&mdsc->cap_dirty_lock);