[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190830163910.GB29603@infradead.org>
Date: Fri, 30 Aug 2019 09:39:10 -0700
From: Christoph Hellwig <hch@...radead.org>
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>,
Amir Goldstein <amir73il@...il.com>,
"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@...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 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?
> > > + /* be careful RCU symlink path (see ext4_inode_info->i_data)! */
> > > + if (is_inode_fast_symlink(inode))
> > > + kfree(inode->i_link);
> >
> > is_inode_fast_symlink only shows up in a later patch. And really
> > obsfucates the check here in the only caller as you can just do an
> > unconditional kfree here - i_link will be NULL except for the case
> > where you explicitly set it.
>
> I cannot fully understand your point (sorry about my English),
> I will reply you about this later.
With that I mean that you should:
1) remove is_inode_fast_symlink and just opencode it in the few places
using it
2) remove the check in this place entirely as it is not needed
3) remove the comment quoted above as it is more confusing than not
having the comment
> > Is there any good reasons to use buffer heads like this in new code
> > vs directly using bios?
>
> This page can save in bdev page cache, it contains not only the erofs
> superblock so it can be fetched in page cache later.
If you want it in the page cache why not use read_mapping_page or similar?
> > > +/* set up default EROFS parameters */
> > > +static void default_options(struct erofs_sb_info *sbi)
> > > +{
> > > +}
> >
> > No need to add an empty function.
>
> Later patch will fill this function.
Please only add the function in the patch actually adding the
functionality.
> > > +}
> >
> > Why is this needed? You can just free your sb privatte information in
> > ->put_super and wire up kill_block_super as the ->kill_sb method
> > directly.
>
> See Al's comments,
> https://lore.kernel.org/r/20190720224955.GD17978@ZenIV.linux.org.uk/
With that code it makes sense. In this paticular patch it does not.
So please add it only when actually needed.
Powered by blists - more mailing lists