linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: use list_move_tail instead of list_del/list_add_tail
@ 2012-09-05  6:38 Wei Yongjun
  0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2012-09-05  6:38 UTC (permalink / raw)
  To: chris.mason; +Cc: yongjun_wei, linux-btrfs

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(-)

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)



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-05  6:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05  6:38 [PATCH] Btrfs: use list_move_tail instead of list_del/list_add_tail Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).