Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp767093imm; Thu, 4 Oct 2018 03:03:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV62gcXpYpCaXdie0ssS70zGR+qN8IxrzP+RkqdGK8fIvu9MyUlC+T+bGMNtrthW3gzzJ3dRs X-Received: by 2002:a17:902:3064:: with SMTP id u91-v6mr5754189plb.176.1538647386306; Thu, 04 Oct 2018 03:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538647386; cv=none; d=google.com; s=arc-20160816; b=x7dHaneFdniszbas+YZrKB78205OM2tDVotQ+ccqkuqdYszXgdnBR0I/zi91+LbuLj P2FD91B7rLnSwfO7F4awrRznTX9Ux2h+794l8p7M3fBgGN/6YB94N3VCg7DkdNx8jPQX Z5jfUW6VaD3YvQdWmgCmIi/g/+Ydqma7B9amuvI3H9l7w9XETrJQPyS6PchOtnqCJo4b c9O752XhCbs2ez9kpiHNAap0mZ4rSxSWiXHCK3m28BKmkQJCdLtQ8g9fbi4SbVSqamHx +3RGYvvAFmFsEeHXm5J8cQqY/MqGMhEs/cJqI24Z0TFNR2ny4iisIjpDOHSX/MtB4NEa nLfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=DXcymL9piJKl4fLWZBX7yLNo/NuveJ7QlosPUb5pCPM=; b=n0LRvNTZco6Qo+dHsryJyP6dA/8/mSPjwM7HeOrcJ8bXZznfwdrd53ztTRGIc3+aK2 NWeHDR66krb3p9pxI10l1Yut73/xojdu/FAh3B+DNkCIiylz28V0GYSfgayRsihVkv82 +uwJkU/Ldr3UQQGRB/RLo3Crqcoa5IIXdQyezMRXILrlMVB+TEzVBEvIgAzaYlc/CgN/ xaJ6BC6nr7U1JDLuGsjp3ED5hyCaEIoy3IOUg8x7uYdwb5Hsoo2PjS8ZSt92bv5Jqi3i pRlHZiQrulYbVr9+2spXTIpJ2xzinju+J0y7owe3TE9Y/7oASADyYAmxnn+zB+F6BsHR b39w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6-v6si4448839plr.91.2018.10.04.03.02.49; Thu, 04 Oct 2018 03:03:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727878AbeJDQyx (ORCPT + 99 others); Thu, 4 Oct 2018 12:54:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:60642 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727311AbeJDQyx (ORCPT ); Thu, 4 Oct 2018 12:54:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 857BFAE8B; Thu, 4 Oct 2018 10:02:20 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 35781DA82D; Thu, 4 Oct 2018 12:02:20 +0200 (CEST) Date: Thu, 4 Oct 2018 12:02:20 +0200 From: David Sterba To: zhong jiang Cc: dsterba@suse.cz, osandov@osandov.com, dsterba@suse.com, jbacik@fb.com, clm@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2] btrfs: list usage cleanup Message-ID: <20181004100220.GA29418@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, zhong jiang , osandov@osandov.com, dsterba@suse.com, jbacik@fb.com, clm@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <1538628507-32593-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1538628507-32593-1-git-send-email-zhongjiang@huawei.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 04, 2018 at 12:48:27PM +0800, zhong jiang wrote: > 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); The suggestion was to drop name_cache_used and replace it with list_move_tail(...), the comment as you wrote it does not bring much information as it merely repeats how list_move_tail is implemeted. A useful comment explains something that's not obvious.