[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOQ4uxichLUsPyg5Fqg-pSL85oqoDFcQHZbzdrkXX_-kK=CjDQ@mail.gmail.com>
Date: Sat, 31 Aug 2019 09:34:44 +0300
From: Amir Goldstein <amir73il@...il.com>
To: Gao Xiang <gaoxiang25@...wei.com>
Cc: Christoph Hellwig <hch@...radead.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
"Theodore Ts'o" <tytso@....edu>, Pavel Machek <pavel@...x.de>,
David Sterba <dsterba@...e.cz>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
Dave Chinner <david@...morbit.com>,
Jaegeuk Kim <jaegeuk@...nel.org>, Jan Kara <jack@...e.cz>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
devel@...verdev.osuosl.org, LKML <linux-kernel@...r.kernel.org>,
linux-erofs@...ts.ozlabs.org, Chao Yu <yuchao0@...wei.com>,
Miao Xie <miaoxie@...wei.com>,
Li Guifu <bluce.liguifu@...wei.com>,
Fang Wei <fangwei1@...wei.com>
Subject: Re: [PATCH v6 03/24] erofs: add super block operations
On Fri, Aug 30, 2019 at 8:16 PM Gao Xiang <gaoxiang25@...wei.com> wrote:
>
> Hi Christoph,
>
> On Fri, Aug 30, 2019 at 09:39:10AM -0700, Christoph Hellwig wrote:
> > On Thu, Aug 29, 2019 at 06:50:48PM +0800, Gao Xiang wrote:
> > > > Please use an erofs_ prefix for all your functions.
> > >
> > > It is already a static function, I have no idea what is wrong here.
> >
> > Which part of all wasn't clear? Have you looked at the prefixes for
> > most functions in the various other big filesystems?
>
> I will add erofs prefix to free_inode as you said.
>
> At least, all non-prefix functions in erofs are all static functions,
> it won't pollute namespace... I will add "erofs_" to other meaningful
> callbacks...And as you can see...
>
> cifs/cifsfs.c
> 1303:cifs_init_inodecache(void)
> 1509: rc = cifs_init_inodecache();
>
> hpfs/super.c
> 254:static int init_inodecache(void)
> 771: int err = init_inodecache();
>
> minix/inode.c
> 84:static int __init init_inodecache(void)
> 665: int err = init_inodecache();
>
Hi Gao,
"They did it first" is never a good reply for code review comments.
Nobody cares if you copy&paste code with init_inodecache().
I understand why you thought static function names do not pollute
the (linker) namespace, but they do pollute the global namespace.
free_inode() as a local function name is one of the worst examples
for VFS namespace pollution.
VFS code uses function names like those a lot in the global namespace, e.g.:
clear_inode(),new_inode().
For example from recent history of namespace collision caused by your line
of thinking, see:
e6fd2093a85d md: namespace private helper names
Besides, you really have nothing to loose from prefixing everything
with erofs_, do you? It's better for review, for debugging...
Thanks,
Amir.
Powered by blists - more mailing lists