Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4136644pxj; Tue, 8 Jun 2021 07:18:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN/YR3GqjJ8NY261XhpIEj0UpBen1mLPJhpz31goRtZFCVXvOJ5ahFfCoVAH9gmAUgg8Ap X-Received: by 2002:a17:907:990f:: with SMTP id ka15mr23587389ejc.132.1623161930020; Tue, 08 Jun 2021 07:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623161930; cv=none; d=google.com; s=arc-20160816; b=v/8/in0Bzg0Ajuhmq2+Dri3cB/lpfK9VaxtxRxukjG/GVh5KS4a/8adkmDOxTQ4s27 BgBRD/Q9mflL6lVSUoEfYNz9EffQuvLTpFp6sXJs3myoKqhb97x5wEFx4rTnJ/nNAsMm fnvM/ZX9xit+cd+u+Skis+AjdCuLHCQnDGHBfQgWNsRjVAEcPpasSNfZULf4eMkHT6UB GMGvhNeSjzA4Kk3+FJIiJ5QB2u9F2A/BnSp0GK2/xFDAUmYlii3ZcivhCdBhZ5D7HDFG uJcCLMlGZzcLK7HUzz5l76ViL2HLOvglxScTRedyZmGIfH/SoTQtBDcVuva6c2V1bBNq /UUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=fNneOMji3fVSsopTxsNXHqXefzeyBsUEJ1N5GuoNAqM=; b=fjDiIFHvyjCssVaj1FuNkO0IBdqk/RetodaA6FZpZ67eGKeeB91TJeDgtE2zzfQGan M05tfnHTmbmRDcl7sp1ioP5o9VBtY4K5m0HBFArxwRVMuQAO+iedupngdj8/LjsdNKUX CqiZgO8/C5lyPwswwx8t31H/+xWy8XSUhXWetqTyian6q6UzHAG+BuIAGjFnlvBz9J5+ aP8eO6Hg2/q5XxCuTfzPrEzxoQvSwwdpTET8FS0sJUyF1kNHjlo0sl+wuwmB3NX450B8 6kO84EGqwT5VQ4bN3f0u2mRbk1d8BmGShga7llD4+qunfIG2Tbde5DRgBdDF70Q9gfkD NLrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=auC3N3Cz; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb8si3699957edb.249.2021.06.08.07.18.25; Tue, 08 Jun 2021 07:18:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=auC3N3Cz; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233277AbhFHORL (ORCPT + 99 others); Tue, 8 Jun 2021 10:17:11 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:42012 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233158AbhFHORL (ORCPT ); Tue, 8 Jun 2021 10:17:11 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 44F64219C2; Tue, 8 Jun 2021 14:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623161717; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fNneOMji3fVSsopTxsNXHqXefzeyBsUEJ1N5GuoNAqM=; b=auC3N3CzUBQFpkVRU9Z6XAzFVcDscsX+w6TsY1udv1azVotpS2P0tZOTYTrDBnzrT6SU3g VehIk/xzN0R1PiiTsKJ0rwxKD8gct627vtkYX103ilW6Y3+B56+tHiF1umHvZybeIwtWb+ cPDbNWaAbk3FlYqFZ9AT5q61uAzwrNU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623161717; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fNneOMji3fVSsopTxsNXHqXefzeyBsUEJ1N5GuoNAqM=; b=mQqphZRbFphCbunAXvv4OgfmeTzjBk866aBGpJvufqLFVuJhNvM+PTTWV1sN1xCI0ztHtd JcynkMQUzO+LihDQ== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 2082CA3B84; Tue, 8 Jun 2021 14:15:17 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 9744FDAF61; Tue, 8 Jun 2021 16:12:33 +0200 (CEST) Date: Tue, 8 Jun 2021 16:12:33 +0200 From: David Sterba To: Anand Jain Cc: Baokun Li , linux-kernel@vger.kernel.org, Chris Mason , Josef Bacik , David Sterba , weiyongjun1@huawei.com, yuehaibing@huawei.com, yangjihong1@huawei.com, yukuai3@huawei.com, linux-btrfs@vger.kernel.org, kernel-janitors@vger.kernel.org, Hulk Robot Subject: Re: [PATCH -next] btrfs: send: use list_move_tail instead of list_del/list_add_tail Message-ID: <20210608141233.GQ31483@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Anand Jain , Baokun Li , linux-kernel@vger.kernel.org, Chris Mason , Josef Bacik , David Sterba , weiyongjun1@huawei.com, yuehaibing@huawei.com, yangjihong1@huawei.com, yukuai3@huawei.com, linux-btrfs@vger.kernel.org, kernel-janitors@vger.kernel.org, Hulk Robot References: <20210608031220.2822257-1-libaokun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021 at 01:16:21PM +0800, Anand Jain wrote: > On 8/6/21 11:12 am, Baokun Li wrote: > > Using list_move_tail() instead of list_del() + list_add_tail(). > > > > Reported-by: Hulk Robot > > Signed-off-by: Baokun Li > > --- > > fs/btrfs/send.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c > > index bd69db72acc5..a0e51b2416a1 100644 > > --- a/fs/btrfs/send.c > > +++ b/fs/btrfs/send.c > > @@ -2083,8 +2083,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); > > } > > > Looks good. > You can consider open-code name_cache_used() as there is only one user. Yeah sounds like a good idea, with part of the function comment next to the list_move_tail.