From patchwork Wed Sep 5 06:38:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1405571 Return-Path: X-Original-To: patchwork-linux-btrfs@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 4E0883FC71 for ; Wed, 5 Sep 2012 06:38:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338Ab2IEGiv (ORCPT ); Wed, 5 Sep 2012 02:38:51 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:39715 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886Ab2IEGiu (ORCPT ); Wed, 5 Sep 2012 02:38:50 -0400 Received: by qaas11 with SMTP id s11so4194167qaa.19 for ; Tue, 04 Sep 2012 23:38:50 -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=Ri3QtOwJ/pXr5O0DFg/sRCn4//suun0rqS7vNCFWAZA=; b=wMyqAiQkNAtXE9XrZdUPDPuoHU/pltA0QNRSWfWm+/w+VvkhBH+ZwopBchViW0auWb 6Ayf6lq461jH6KGtqFNYiL7fvSBrWgGvhqkxLcsJ+zOb3BBWUJyEzaV76FU4L9yUUs9B 1bLOyWTdDjX810tabIijBVpNitx2iJ5i52+gPul68kc5TXL9mw6jom7fdGtvJ2WgjlpX mlrRw+vMN1aRAGQieH36y9HCCNI4ToFsygQMvkdyoKc6JHnIya7aw0buoCTBa+1eKgPD NpKdTEpnZaQSplYNGXq6yFeU+zvTXfBwFID7iNsTAq1SN4sZFVV+whUG9ONGtUD5tCEb sz0w== MIME-Version: 1.0 Received: by 10.229.134.200 with SMTP id k8mr11950141qct.135.1346827129944; Tue, 04 Sep 2012 23:38:49 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Tue, 4 Sep 2012 23:38:49 -0700 (PDT) Date: Wed, 5 Sep 2012 14:38:49 +0800 Message-ID: Subject: [PATCH] Btrfs: use list_move_tail instead of list_del/list_add_tail From: Wei Yongjun To: chris.mason@fusionio.com Cc: yongjun_wei@trendmicro.com.cn, linux-btrfs@vger.kernel.org Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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 --- fs/btrfs/send.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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/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)