From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67239C433E1 for ; Wed, 19 Aug 2020 11:40:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 42D36206FA for ; Wed, 19 Aug 2020 11:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597837228; bh=Wo0rqqJfk2zBMXYOEoNqxy1AI9iRGPC/BxwzuJcTpFY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=hvIQpSUCV6298uPSa2/Cz4yiLSDgyU/uLlddeN0YJqVvfINRfAOfXf8d9/2JqBtHd vncdPa6sIw0fmPnW5bFP1wsSmkO4fjml4cyvImq46D6/1oHK2zmCTEvRsEUaO+r6YQ tPQiREixqXvRQB+XR/R/p8H32FuT7uv9JsXq/mv8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbgHSLkV (ORCPT ); Wed, 19 Aug 2020 07:40:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:40212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727856AbgHSLkF (ORCPT ); Wed, 19 Aug 2020 07:40:05 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 919AE206FA; Wed, 19 Aug 2020 11:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597837205; bh=Wo0rqqJfk2zBMXYOEoNqxy1AI9iRGPC/BxwzuJcTpFY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RE6hglFb/fU6P6Cy0VAzZtLIhqXqrAjgYG//DyGXvAi7YRn9Evs+UdI4lcoK0sOwU v5jnzvyheAh0Ag+/6KKdgDm9EHj+c2x3XSNWbIGUCnw3E7YdDdq5PjlNmOQ6LA6BqP MWK8vSg6UuFNPuLvXO5+IBZleXsI5Ldrqcqr4l68= Date: Wed, 19 Aug 2020 14:40:01 +0300 From: Leon Romanovsky To: Matthew Wilcox Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: Add function declaration of simple_dname Message-ID: <20200819114001.GU7555@unreal> References: <20200819083259.919838-1-leon@kernel.org> <20200819113424.GA17456@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200819113424.GA17456@casper.infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Aug 19, 2020 at 12:34:24PM +0100, Matthew Wilcox wrote: > On Wed, Aug 19, 2020 at 11:32:59AM +0300, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > The simple_dname() is declared in internal header file as extern > > and this generates the following GCC warning. > > The fact that it's declared as extern doesn't matter. You don't need > the change to internal.h at all. The use of 'extern' on a function > declaration is purely decorative: > > 5 If the declaration of an identifier for a function has no > storage-class specifier, its linkage is determined exactly as if it > were declared with the storage-class specifier extern. So why do we need to keep extern keyword if we use intenral.h directly? > > I'd drop the change to internal.h and fix the changelog. Thanks > > > fs/d_path.c:311:7: warning: no previous prototype for 'simple_dname' [-Wmissing-prototypes] > > 311 | char *simple_dname(struct dentry *dentry, char *buffer, int buflen) > > | ^~~~~~~~~~~~ > > > > Instead of that extern, reuse the fact that internal.h file is internal to fs/* and > > declare simple_dname() like any other function. > > > > Fixes: 7e5f7bb08b8c ("unexport simple_dname()") > > Signed-off-by: Leon Romanovsky > > --- > > fs/d_path.c | 2 ++ > > fs/internal.h | 2 +- > > 2 files changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/fs/d_path.c b/fs/d_path.c > > index 0f1fc1743302..4b89448cc78e 100644 > > --- a/fs/d_path.c > > +++ b/fs/d_path.c > > @@ -8,6 +8,8 @@ > > #include > > #include "mount.h" > > > > +#include "internal.h" > > + > > static int prepend(char **buffer, int *buflen, const char *str, int namelen) > > { > > *buflen -= namelen; > > diff --git a/fs/internal.h b/fs/internal.h > > index 10517ece4516..2def264272f4 100644 > > --- a/fs/internal.h > > +++ b/fs/internal.h > > @@ -164,7 +164,7 @@ extern int d_set_mounted(struct dentry *dentry); > > extern long prune_dcache_sb(struct super_block *sb, struct shrink_control *sc); > > extern struct dentry *d_alloc_cursor(struct dentry *); > > extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); > > -extern char *simple_dname(struct dentry *, char *, int); > > +char *simple_dname(struct dentry *d, char *buf, int len); > > extern void dput_to_list(struct dentry *, struct list_head *); > > extern void shrink_dentry_list(struct list_head *); > > > > -- > > 2.26.2 > >