Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2289100ioo; Mon, 23 May 2022 15:01:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhr6xylBb2QbIHC7LsKiWe4lhpwYLqrt0IBLY/yqt3d3K5cnfhq53lqYEUtMAXeWFzRoZW X-Received: by 2002:a05:6a00:996:b0:50b:76b8:3bb1 with SMTP id u22-20020a056a00099600b0050b76b83bb1mr25579651pfg.9.1653343290506; Mon, 23 May 2022 15:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653343290; cv=none; d=google.com; s=arc-20160816; b=Fhpqlz6i8913ziTZCXGX1xripAFiP1XyYu5YZxJOuxfT8Dua/sbbaeIWqMlVvTvxly /V/Jjz7hGg6c3Ha3kYcp34HgbJzBMgGikzsby27oDp5N3F58iE9lyye4EJrIEWag04T5 zCY2O8Hu4dBMeDim+QnEf9A1bnVrwm0rrfQyFRWdzS2S7SVKZlJgIjwfSg0CKTGH9Ew/ 69+9qnthZgRXP4V9HA6/v/viLOlhs9FHt2ba3wTCotj7/v40bOl37lb7lHuiJZWCbBW9 aQPvNDRPx2PY/6y+2BP6K9nYRINJy+BVHJqYL4NsQKUmt72v0iR/9O9pkIwNjrIARRrD Bb6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LbEcr7zqhWPFnXoF/KuL5Wkx22JBJ3c2clwbQUl5zn8=; b=P2czckgi8zUkNQGw6gqwLOEglh/kb1anbhY4cjUHPUlGLM+2g09ciBPI2uhkHgJ5Jn sYHA0LcWTNI9S3lpj3/q4su1sFoo94LNfsF9KYFpHZ91kiwuKLJwOEKVpu0MkahX+FUg YrDHalS2jukle3wZfnxOI6sC+C/T8esjI0GHXUBjRTca80uJ6SZYYlTnDbvUHqiA9f4m M503D4qVqvyq0MrCgEKs82pdz9wCwaLmX5y5gXNbafRTHMt5+8HiGKs8xurveDqb53LD DfbPAdoT6fi86Xkdh/tAplv4sy+0yn6jm2M1UhoxnZvhdZ6Ae1XY2aHVLYb3E9oCY0QV Opvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YcCYg3bA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a17090332cf00b00161ab578554si13184974plr.297.2022.05.23.15.01.16; Mon, 23 May 2022 15:01:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YcCYg3bA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbiEWUMC (ORCPT + 99 others); Mon, 23 May 2022 16:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232932AbiEWULt (ORCPT ); Mon, 23 May 2022 16:11:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08C72FE75; Mon, 23 May 2022 13:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LbEcr7zqhWPFnXoF/KuL5Wkx22JBJ3c2clwbQUl5zn8=; b=YcCYg3bARqXOKkr9KCnYiIVA/O 4kCGq1j7NQnK1rCwBYjYcBp79yCaa+veSl2Dx1quLuGeDujO4BSEVcsIJGp+a5QSK2RSosFhG3hjW xMKesUVI3DHJzHAD6RzkDdbXBW7hElXVml8xn3gObBiogi3m/SAMCruazsCZFCQi0CtlYy+m25fRB GdrhCmxTa54gy4NdhbEa5uiYAFKqPXLSZDUoPwg3i3ujBkmThEqmmRcFfV5FH8FYiLnW1rC06isEs gxhmy88B4LOk1iYVg8NmSU4PzSUEtrzQx8JtrCSV1UcEQ9kp/mviuzgA9wrsqNlGmevPCjJQzStwY X8M8EN4Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntEOy-00GVbU-0B; Mon, 23 May 2022 20:11:40 +0000 Date: Mon, 23 May 2022 21:11:39 +0100 From: Matthew Wilcox To: Xiubo Li Cc: jlayton@kernel.org, idryomov@gmail.com, viro@zeniv.linux.org.uk, vshankar@redhat.com, ceph-devel@vger.kernel.org, arnd@arndb.de, mcgrof@kernel.org, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/2] fs/dcache: add d_compare() helper support Message-ID: References: <20220519101847.87907-1-xiubli@redhat.com> <20220519101847.87907-2-xiubli@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220519101847.87907-2-xiubli@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, May 19, 2022 at 06:18:45PM +0800, Xiubo Li wrote: > Reviewed-by: Jeff Layton > Signed-off-by: Xiubo Li ... empty commit message? > --- > fs/dcache.c | 15 +++++++++++++++ > include/linux/dcache.h | 2 ++ > 2 files changed, 17 insertions(+) > > 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 dentry *dentry, > name) == 0; > } > > +/** > + * 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 dentry > + * > + * Return: 0 if names are same, or 1 > + */ > +bool d_compare(const struct dentry *parent, const struct dentry *dentry, > + const struct qstr *name) > +{ > + return !d_same_name(dentry, parent, name); > +} > +EXPORT_SYMBOL(d_compare); > + > /** > * __d_lookup_rcu - search for a dentry (racy, store-free) > * @parent: parent dentry > diff --git a/include/linux/dcache.h b/include/linux/dcache.h > index f5bba51480b2..444b2230e5c3 100644 > --- a/include/linux/dcache.h > +++ b/include/linux/dcache.h > @@ -233,6 +233,8 @@ extern struct dentry * d_alloc_parallel(struct dentry *, const struct qstr *, > wait_queue_head_t *); > extern struct dentry * d_splice_alias(struct inode *, struct dentry *); > extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); > +extern bool d_compare(const struct dentry *parent, const struct dentry *dentry, > + const struct qstr *name); > extern struct dentry * d_exact_alias(struct dentry *, struct inode *); > extern struct dentry *d_find_any_alias(struct inode *inode); > extern struct dentry * d_obtain_alias(struct inode *); > -- > 2.36.0.rc1 >