[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190829115922.GG64893@architecture4>
Date: Thu, 29 Aug 2019 19:59:22 +0800
From: Gao Xiang <gaoxiang25@...wei.com>
To: Christoph Hellwig <hch@...radead.org>
CC: 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 05/24] erofs: add inode operations
On Thu, Aug 29, 2019 at 03:24:26AM -0700, Christoph Hellwig wrote:
[]
>
> > +
> > + /* fill last page if inline data is available */
> > + err = fill_inline_data(inode, data, ofs);
>
> Well, I think you should move the is_inode_flat_inline and
> (S_ISLNK(inode->i_mode) && inode->i_size < PAGE_SIZE) checks from that
> helper here, as otherwise you make everyone wonder why you'd always
> fill out the inline data.
Currently, fill_inline_data() only fills for fast symlink,
later we can fill any tail-end block (such as dir block)
for our requirements.
And I think that is minor.
>
> > +static inline struct inode *erofs_iget_locked(struct super_block *sb,
> > + erofs_nid_t nid)
> > +{
> > + const unsigned long hashval = erofs_inode_hash(nid);
> > +
> > +#if BITS_PER_LONG >= 64
> > + /* it is safe to use iget_locked for >= 64-bit platform */
> > + return iget_locked(sb, hashval);
> > +#else
> > + return iget5_locked(sb, hashval, erofs_ilookup_test_actor,
> > + erofs_iget_set_actor, &nid);
> > +#endif
>
> Just use the slightly more complicated 32-bit version everywhere so that
> you have a single actually tested code path. And then remove this
> helper.
The consideration is simply because iget_locked performs better
than iget5_locked.
Thanks,
Gao Xiang
Powered by blists - more mailing lists