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.
