Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2163391ioo; Mon, 23 May 2022 11:35:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt0HqC4ZB0k5IqyYuY63xf9w2u7YjZ9/Z15P/cC1ceaF5ncA2GhvGOGVIDfeUM/8/r2apU X-Received: by 2002:a63:d10a:0:b0:3c6:c6e0:9b1e with SMTP id k10-20020a63d10a000000b003c6c6e09b1emr21511593pgg.410.1653330937235; Mon, 23 May 2022 11:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330937; cv=none; d=google.com; s=arc-20160816; b=dPjCbekTs0GKuv+5R48OTw2oXmJNeVzgyWK1UNRuE1aNpmBYceHI4MveA8Mnp1hFoV N5u1LKwCEmec6YO84YoRRuqs/pwFS6freSsB9zB/aDt3t4GKS7gAOwaPsv80JyLRKaM5 8unA0OFu5qnTo4+2SpsB4y3mb8qWLGLBrwZmLakOT4gvkv8WEkJwU9uvGBY5KvS2o5Bs ktzhxS+Bg/TJSmpMeXc9vpEZ8MYVHyri7cqGMo1nHVPxaeGtxB8R71zkWPC4KJ5Uxlio ckciBpgm/BTBTVDivCpRXCx796+NsUVlTO7iq071itM9rPtsgjYhTRg9+Xg1W3sm2TwV dMrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=V3nRXbmSawDQi71a3AzBaQee31gBzLTPL4f43alGQ5w=; b=EC3OQxHbtnOXVPVbGn+09lpZnKVwe6pzno/e4l2ACZd7Apo+Xwn+dnGxliEQzfxB6a l3MVsv3frbTxVdJ7g67Z9xmm1Hooq9OSsyvwYiMtZjRrIbCxcug6KEO60ywib5P2eGtu 2L0xC2oiF52xfSKlZH+1MkJRvZBg8vBoM5FY+RBplNiBV/IsfR2S9Wo/FxhsJRj6iAAj l+6chuiiceE/s4ivxQb2jT7/6bS0NmArA8MXTuy/jgyMRH5yZfeNM9a6sBRXkn4AG16R Z+ROSiDD7Il2GQjqJPo3Hz3nkvKynlkR3LN+CSK+FSRC/eGTQWYq540C94sQEN1D/raW sfZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Phwmp1vE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f15-20020a63554f000000b003c1e24ba350si10793033pgm.786.2022.05.23.11.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:35:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Phwmp1vE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D977EAB0F7; Mon, 23 May 2022 11:35:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241424AbiEWSed (ORCPT + 99 others); Mon, 23 May 2022 14:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240753AbiEWSeX (ORCPT ); Mon, 23 May 2022 14:34:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0AF76164; Mon, 23 May 2022 11:11:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 91C44B8121F; Mon, 23 May 2022 18:09:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55D44C385AA; Mon, 23 May 2022 18:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653329369; bh=/MwJ0RsTlhSbXBrwd7tYkz8M733d9H6V2XdJlILNf8Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Phwmp1vEOPEiL7zk1WAEJ3x7VejVumPfRqtUUbrAdO4pELa3BqOFexcE8mqp4qPoC GzjR+mZGTyWfWt1TBJ+WOX3zzFcmpDIHXO3I/t41gRd1f3+7D15wRtXYk7H+FRP7mJ lDy7jKxHEWamaL2PCEvYXvQ4ieijNd0LGqjq8ajeNb+YfMARbqkqh/qk7/QjAexY9h 7onAWBv5igv78yM9WwWR9oywFH5Dkk1N4yqJ/fhdDrsaFKmkzipvz/b5Yb7Wm4mpE8 krRukRocSlP4OVuSHdk1XcMWUBXbqWcVj6owMyz7K2G+RZtdens3Qm3VMpMiBeHSMw 0xfeFNZWHFSxg== Message-ID: Subject: Re: [PATCH v5 1/2] fs/dcache: add d_compare() helper support From: Jeff Layton To: Luis Chamberlain , Xiubo Li Cc: idryomov@gmail.com, viro@zeniv.linux.org.uk, willy@infradead.org, vshankar@redhat.com, ceph-devel@vger.kernel.org, arnd@arndb.de, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 23 May 2022 14:09:26 -0400 In-Reply-To: References: <20220519101847.87907-1-xiubli@redhat.com> <20220519101847.87907-2-xiubli@redhat.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1 (3.44.1-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2022-05-23 at 10:57 -0700, Luis Chamberlain wrote: > On Thu, May 19, 2022 at 06:18:45PM +0800, Xiubo Li wrote: > > Reviewed-by: Jeff Layton > > Signed-off-by: Xiubo Li > > --- > > fs/dcache.c | 15 +++++++++++++++ > > include/linux/dcache.h | 2 ++ > > 2 files changed, 17 insertions(+) > >=20 > > diff --git a/fs/dcache.c b/fs/dcache.c > > index 93f4f5ee07bf..95a72f92a94b 100644 > > --- a/fs/dcache.c > > +++ b/fs/dcache.c > > @@ -2262,6 +2262,21 @@ static inline bool d_same_name(const struct dent= ry *dentry, > > name) =3D=3D 0; > > } > > =20 > > +/** > > + * d_compare - compare dentry name with case-exact name > > + * @parent: parent dentry > > + * @dentry: the negative dentry that was passed to the parent's lookup= func > > + * @name: the case-exact name to be associated with the returned den= try > > + * > > + * Return: 0 if names are same, or 1 > > + */ > > +bool d_compare(const struct dentry *parent, const struct dentry *dentr= y, > > + const struct qstr *name) > > +{ > > + return !d_same_name(dentry, parent, name); >=20 > What's wrong with d_same_name()? Why introduce a whole new operation > and export it when you the same prototype except first and second > argument moved with an even more confusing name? >=20 Agreed. That would be better. > > +} > > +EXPORT_SYMBOL(d_compare); >=20 > New symbols should go with EXPORT_SYMBOL_GPL() instead. >=20 > Luis In the past, Al has pushed back against that since EXPORT_SYMBOL_GPL has no clear legal meaning. He may have changed his opinion since, but I haven't heard that that was the case. --=20 Jeff Layton