From patchwork Wed Sep 5 06:38:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1405561 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 639FF3FC71 for ; Wed, 5 Sep 2012 06:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751219Ab2IEGiE (ORCPT ); Wed, 5 Sep 2012 02:38:04 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:59678 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238Ab2IEGiE (ORCPT ); Wed, 5 Sep 2012 02:38:04 -0400 Received: by qaas11 with SMTP id s11so318081qaa.19 for ; Tue, 04 Sep 2012 23:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=PifSt5We0j4NeGXuKngRDdNlMjC9Qe9rtpAdio8DpSw=; b=iEu/IyR/Mex7+xY0pdwUpB09TBagpfIepl8/ubMjqbvUmjIlhlJOHnbfmyAtb0dq7N wE3DDQ5ajq37jqmYe62SaRioETimOBtIWU9UmauUuVsI4pF9sSkVaCVC929TW7Cj5pxB +x+NdkO9wD9gmyEBcNeIbTjGKQz8f5ouHTuZwVcnMWuFJWnbsoizH0wkeWjtMn4pAe1I FbeAc6/izwWyJBvv6lxxZESlt6uOatmifEXDfECUq5SaSxgRq8/pUg0SyEq6rdeW5Fnl T0+6MHqlMy5piGFRq3lnpiTS/wVZppvDTSw8Bc8UuuB8h/fvUTxq3APdnUux9YmsvSfA rYjA== MIME-Version: 1.0 Received: by 10.224.173.82 with SMTP id o18mr43328462qaz.96.1346827083212; Tue, 04 Sep 2012 23:38:03 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Tue, 4 Sep 2012 23:38:03 -0700 (PDT) Date: Wed, 5 Sep 2012 14:38:03 +0800 Message-ID: Subject: [PATCH] pnfsblock: use list_move_tail instead of list_del/list_add_tail From: Wei Yongjun To: Trond.Myklebust@netapp.com Cc: yongjun_wei@trendmicro.com.cn, linux-nfs@vger.kernel.org Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Wei Yongjun 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 Reviewed-by: Peng Tao --- fs/nfs/blocklayout/extents.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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++; }