DORMANTno replies

[PATCH] Btrfs: use list_move_tail instead of list_del/list_add_tail

From: Wei Yongjun <hidden>
Date: 2012-09-05 06:38:50
Subsystem: btrfs file system, filesystems (vfs and infrastructure), the rest · Maintainers: Chris Mason, David Sterba, Alexander Viro, Christian Brauner, Linus Torvalds

From: Wei Yongjun <redacted>

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help