From patchwork Thu Oct 4 04:48:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhong jiang X-Patchwork-Id: 10625595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8B3E14BD for ; Thu, 4 Oct 2018 05:01:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8ACE428C46 for ; Thu, 4 Oct 2018 05:01:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D35728C51; Thu, 4 Oct 2018 05:01:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E37628C46 for ; Thu, 4 Oct 2018 05:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbeJDLxB (ORCPT ); Thu, 4 Oct 2018 07:53:01 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13596 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726735AbeJDLxA (ORCPT ); Thu, 4 Oct 2018 07:53:00 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A106D93D90F1B; Thu, 4 Oct 2018 13:00:50 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.399.0; Thu, 4 Oct 2018 13:00:48 +0800 From: zhong jiang To: CC: , , , , , Subject: [PATCHv2] btrfs: list usage cleanup Date: Thu, 4 Oct 2018 12:48:27 +0800 Message-ID: <1538628507-32593-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Trival cleanup, list_move_tail will implement the same function that list_del() + list_add_tail() will do. hence just replace them. Signed-off-by: zhong jiang --- fs/btrfs/send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 094cc144..30e7e12 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -2075,8 +2075,8 @@ 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); + /* delete from sctx->name_cache_list and add as its tail */ + list_move_tail(&nce->list, &sctx->name_cache_list); } /*