pnfsblock: use list_move_tail instead of list_del/list_add_tail
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 5 Sep 2012 06:38:03 +0000 (14:38 +0800)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 1 Oct 2012 22:39:05 +0000 (15:39 -0700)
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>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/blocklayout/extents.c

index 1f9a603..9c3e117 100644 (file)
@@ -683,8 +683,7 @@ encode_pnfs_block_layoutupdate(struct pnfs_block_layout *bl,
                p = xdr_encode_hyper(p, lce->bse_length << SECTOR_SHIFT);
                p = xdr_encode_hyper(p, 0LL);
                *p++ = cpu_to_be32(PNFS_BLOCK_READWRITE_DATA);
-               list_del(&lce->bse_node);
-               list_add_tail(&lce->bse_node, &bl->bl_committing);
+               list_move_tail(&lce->bse_node, &bl->bl_committing);
                bl->bl_count--;
                count++;
        }