From: Christoph Hellwig <hch@infradead.org>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>,
Christoph Hellwig <hch@infradead.org>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v4 1/2] btrfs: Move on-disk structure definition to btrfs_tree.h
Date: Sat, 25 Apr 2020 00:14:16 -0700 [thread overview]
Message-ID: <20200425071416.GA30673@infradead.org> (raw)
In-Reply-To: <20200424202445.GY18421@twin.jikos.cz>
On Fri, Apr 24, 2020 at 10:24:45PM +0200, David Sterba wrote:
> On Tue, Apr 21, 2020 at 07:41:40PM +0800, Qu Wenruo wrote:
> >
> >
> > On 2020/4/21 下午7:31, Christoph Hellwig wrote:
> > > On Wed, Apr 15, 2020 at 04:41:12PM +0800, Qu Wenruo wrote:
> > >> These structures all are on-disk format. Move them to btrfs_tree.h
> > >>
> > >> This allows us to sync the header to different projects, who need to
> > >> read btrfs filesystem, like U-boot, grub.
> > >
> > > Please use a separate header for that. btrfs_tree.h is a UAPI header
> > > with strict ABI guarantees. Just add a fs/btrfs/btrfs_format.h that
> > > can be copied into the projects where is needed.
> > >
> > Doesn't on-disk format itself need strict ABI guarantees?
> >
> > Thus it looks like the perfect location for on-disk format definitions.
>
> Right now I'm not sure if it's a good idea to put the on-disk format to
> the UAPI path or not. The exported code is to support the ioctls,
> there's an overlap with the on-disk format but providing all the on-disk
> structures for general might become an unnecessry burden.
>
> We know that there's a small number of projects that want to sync the
> on-disk format so I don't think it's going to be a problem for them to
> use a private header.
And the usual way is to just ensure the format header is self-contained
and suitably licensed that they can easily copy it and rely on the
version they checked in. That avoids the problems of
a) the tools relying on installed kernel headers new enough for the
feature they want to support
b) ifdef magic for newer features in the tools
c) the need to keep changes to the kernel format header to be backwards
compatible at the compiler level (as there can be disk format
compatible changes that still break users, e.g. introducing a named
union, or splitting / merging struct definitions)
next prev parent reply other threads:[~2020-04-25 7:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 8:41 [PATCH v4 0/2] btrfs: Reformat and make btrfs_tree.h self-contained Qu Wenruo
2020-04-15 8:41 ` [PATCH v4 1/2] btrfs: Move on-disk structure definition to btrfs_tree.h Qu Wenruo
2020-04-21 11:31 ` Christoph Hellwig
2020-04-21 11:41 ` Qu Wenruo
2020-04-24 20:24 ` David Sterba
2020-04-25 7:14 ` Christoph Hellwig [this message]
2020-04-25 7:25 ` Qu Wenruo
2020-04-30 7:29 ` Qu Wenruo
2020-04-23 11:32 ` kbuild test robot
2020-04-15 8:41 ` [PATCH v4 2/2] btrfs: Reformat btrfs_tree.h comments Qu Wenruo
2020-04-16 10:20 ` David Sterba
2020-04-16 12:54 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200425071416.GA30673@infradead.org \
--to=hch@infradead.org \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).