drbd: use list_move_tail instead of list_del/list_add_tail

Author: Lars Ellenberg <lars.ellenberg@linbit.com>

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

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun 
Signed-off-by: Philipp Reisner 
Signed-off-by: Lars Ellenberg 
---
 drivers/block/drbd/drbd_worker.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
 
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index eeda8b8..377f27b 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -134,8 +134,7 @@ static void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req) __rel
 
 	spin_lock_irqsave(&mdev->tconn->req_lock, flags);
 	mdev->writ_cnt += peer_req->i.size >> 9;
-	list_del(&peer_req->w.list); /* has been on active_ee or sync_ee */
-	list_add_tail(&peer_req->w.list, &mdev->done_ee);
+	list_move_tail(&peer_req->w.list, &mdev->done_ee);
 
 	/*
 	 * Do not remove from the write_requests tree here: we did not send the
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.