[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190902125109.GA9826@infradead.org>
Date: Mon, 2 Sep 2019 05:51:09 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Gao Xiang <hsiangkao@....com>
Cc: Christoph Hellwig <hch@...radead.org>,
Gao Xiang <gaoxiang25@...wei.com>, Jan Kara <jack@...e.cz>,
Chao Yu <yuchao0@...wei.com>,
Dave Chinner <david@...morbit.com>,
LKML <linux-kernel@...r.kernel.org>,
Miao Xie <miaoxie@...wei.com>, devel@...verdev.osuosl.org,
Stephen Rothwell <sfr@...b.auug.org.au>,
"Darrick J . Wong" <darrick.wong@...cle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Amir Goldstein <amir73il@...il.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Theodore Ts'o <tytso@....edu>, Pavel Machek <pavel@...x.de>,
David Sterba <dsterba@...e.cz>,
Li Guifu <bluce.liguifu@...wei.com>,
Fang Wei <fangwei1@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-fsdevel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linux-erofs@...ts.ozlabs.org
Subject: Re: [PATCH v6 03/24] erofs: add super block operations
On Sun, Sep 01, 2019 at 04:54:55PM +0800, Gao Xiang wrote:
> No modification at this... (some comments already right here...)
> 20 /* 128-byte erofs on-disk super block */
> 21 struct erofs_super_block {
> ...
> 24 __le32 features; /* (aka. feature_compat) */
> ...
> 38 __le32 requirements; /* (aka. feature_incompat) */
> ...
> 41 };
This is only cosmetic, why not stick to feature_compat and
feature_incompat?
> > > + bh = sb_bread(sb, 0);
> >
> > Is there any good reasons to use buffer heads like this in new code
> > vs directly using bios?
>
> As you said, I want it in the page cache.
>
> The reason "why not use read_mapping_page or similar?" is simply
> read_mapping_page -> .readpage -> (for bdev inode) block_read_full_page
> -> create_page_buffers anyway...
>
> sb_bread haven't obsoleted... It has similar function though...
With the different that it keeps you isolated from the buffer_head
internals. This seems to be your only direct use of buffer heads,
which while not deprecated are a bit of an ugly step child. So if
you can easily avoid creating a buffer_head dependency in a new
filesystem I think you should avoid it.
> > > + sbi->build_time = le64_to_cpu(layout->build_time);
> > > + sbi->build_time_nsec = le32_to_cpu(layout->build_time_nsec);
> > > +
> > > + memcpy(&sb->s_uuid, layout->uuid, sizeof(layout->uuid));
> > > + memcpy(sbi->volume_name, layout->volume_name,
> > > + sizeof(layout->volume_name));
> >
> > s_uuid should preferably be a uuid_t (assuming it is a real BE uuid,
> > if it is le it should be a guid_t).
>
> For this case, I have no idea how to deal with...
> I have little knowledge about this uuid stuff, so I just copied
> from f2fs... (Could be no urgent of this field...)
Who fills out this field in the on-disk format and how?
> The background is Al's comments in erofs v2....
> (which simplify erofs_fill_super logic)
> https://lore.kernel.org/r/20190720224955.GD17978@ZenIV.linux.org.uk/
>
> with a specific notation...
> https://lore.kernel.org/r/20190721040547.GF17978@ZenIV.linux.org.uk/
>
> "
> > OTOH, for the case of NULL ->s_root ->put_super() won't be called
> > at all, so in that case you need it directly in ->kill_sb().
> "
Yes. Although none of that is relevant for this initial version,
just after more features are added.
Powered by blists - more mailing lists