RE: [PATCH] pnfsblock: use list_move_tail instead of list_del/list_add_tail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: linux-nfs-owner@xxxxxxxxxxxxxxx [mailto:linux-nfs-owner@xxxxxxxxxxxxxxx] On Behalf Of Wei
> Yongjun
> Sent: Wednesday, September 05, 2012 2:38 PM
> To: Trond.Myklebust@xxxxxxxxxx
> Cc: yongjun_wei@xxxxxxxxxxxxxxxxx; linux-nfs@xxxxxxxxxxxxxxx
> Subject: [PATCH] pnfsblock: use list_move_tail instead of list_del/list_add_tail
> 
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxxxxx>
This looks good. Thanks!

Reviewed-by: Peng Tao <tao.peng@xxxxxxx>
> ---
>  fs/nfs/blocklayout/extents.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/nfs/blocklayout/extents.c b/fs/nfs/blocklayout/extents.c
> index 1f9a603..9c3e117 100644
> --- a/fs/nfs/blocklayout/extents.c
> +++ b/fs/nfs/blocklayout/extents.c
> @@ -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++;
>  	}
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux