diff mbox

Btrfs: use list_move_tail instead of list_del/list_add_tail

Message ID CAPgLHd_OU1_aJPO-nt6ZtHjCDH77vyvEeeXjQ7AcTypH_3bH1Q@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Sept. 5, 2012, 6:38 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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 <yongjun_wei@trendmicro.com.cn>
---
 fs/btrfs/send.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index fb5ffe9..fbea0de 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -1792,8 +1792,7 @@  static struct name_cache_entry *name_cache_search(struct send_ctx *sctx,
 
 static void name_cache_used(struct send_ctx *sctx, struct name_cache_entry *nce)
 {
-	list_del(&nce->list);
-	list_add_tail(&nce->list, &sctx->name_cache_list);
+	list_move_tail(&nce->list, &sctx->name_cache_list);
 }
 
 static void name_cache_clean_unused(struct send_ctx *sctx)