Re: [PATCH 2/2] btrfs: move btrfs_super_block to uapi/linux/btrfs_tree.h
From: Qu Wenruo <hidden>
Date: 2021-10-20 23:18:42
On 2021/10/21 01:13, David Sterba wrote:
On Wed, Oct 20, 2021 at 08:19:30AM +0800, Qu Wenruo wrote:quoted
On 2021/10/20 00:10, David Sterba wrote:quoted
On Tue, Oct 19, 2021 at 07:29:25PM +0800, Qu Wenruo wrote:quoted
Due to the fact that btrfs_tree.h contains all the info for BTRFS_IOC_TREE_SEARCH, it's almost the perfect location of btrfs on-disk schema. So let's move struct btrfs_super_block to uapi/linux/btrfs_tree.h, further reducing the size of ctree.h.The definitions of tree items are in the public header due to the search tree ioctl, but why do you want to make superblock public? Ie. what user space tool is going to use it?Well, for super block I'd say any user space tool can directly see it. My main objective here is to move all on-disk format to uapi.Why? You sent such patches in the past, I need to read again what we discussed but I don't think we should put everything to the UAPI headers.
Then we need a new header for on-disk format that is not exposed through tree search API. It's definitely not ideal to put everything into ctree.h. This is especially useful when someone is crafting a new btrfs implementation, no matter if it's something like winBtrfs or BSD (if they really want) or something else. In fact when I am trying to create the btrfs-fuse, one of the things I'm doing is separating things from ctree.h. Thanks, Qu