public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: dsterba@suse.cz
Cc: Josef Bacik <josef@toxicpanda.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 04/17] btrfs: move btrfs on disk definitions out of ctree.h
Date: Sat, 8 Oct 2022 07:50:59 +0800	[thread overview]
Message-ID: <e1a2eca9-ea59-0826-6181-c19b446cdf79@suse.com> (raw)
In-Reply-To: <20221007170723.GW13389@twin.jikos.cz>



On 2022/10/8 01:07, David Sterba wrote:
> On Thu, Sep 15, 2022 at 05:07:42PM +0800, Qu Wenruo wrote:
>>
>>
>> On 2022/9/14 23:06, Josef Bacik wrote:
>>> The bulk of our on-disk definitions exist in btrfs_tree.h, which user
>>> space can use.
>>
>> Previously I tried to move some members to btrfs_tree.h, but didn't get
>> approved, mostly due to the fact that, we have those members exposed
>> through uapi is for TREE_SEARCH ioctl.
>>
>> But I'm not buying that reason at all.
>>
>> To me, all on-disk format, no matter if it's exposed through tree-search
>> should be in btrfs_tree.h.
> 
> All the structures are internal and not a guaranteed public API, we may
> want to change them any time. So if we move the definitions to UAPI then
> with a disclaimer that it's not a stable api and any compilation
> failures outside of kernel are up to the users to fix.

The point is, if we're changing the super block format, it's no 
difference than changing a on-disk structure.

It's still the same incompat/compat_ro/compat change depending on the 
member we change.

> 
> Which does not work in practice as easy as said and we have reverted
> some changes. See 34c51814b2b8 ("btrfs: re-instantiate the removed
> BTRFS_SUBVOL_CREATE_ASYNC definition").

That commit indeed teaches us something, even if we deprecated some 
features, it still has to be kept in the UAPI.

But that argument doesn't really affect the super block move AFAIK.

Since it's not even part of an ioctl, thus I don't think user-space tool 
would really both that.

> 
>> Although I'd prefer to rename btrfs_tree.h to btrfs_ondisk_format.h.
>>
>> Thus to David:
>>
>> Can we make it clear that, btrfs_tree.h is not only for tree search
>> ioctl, but also all the on-disk format thing?
> 
> It is for on-disk format defitions, but that's a different problem than
> the internal/external API.

Then, what's the proper way to export btrfs on-disk format?

 From an ioctl point of view, all those on-disk format things don't even 
need to be exported.

TREE_SEARCH ioctl is just returning a certain TLV formatted memory.
Yes, the basic things like btrfs_ioctl_search_header, but the content is 
still internal, not directly user-facing.

All the returned TLV members are really implementation related details, 
and even the TREE_SEARCH ioctl itself is more like a debug tool than 
proper interface.
A lot of things are done using TREE_SEARCH ioctl because we don't have 
better more defined interface.

Thanks,
Qu

> 
>> Reject once that's fine, but reject twice from two different guys, I
>> think it's not correct.
>>
>>>   Keep things consistent and move the rest of the on disk
>>> definitions out of ctree.h into btrfs_tree.h.  Note I did have to update
>>> all u8's to __u8, but otherwise this is a strict copy and paste.
>>>
>>> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
>> Reviewed-by: Qu Wenruo <wqu@suse.com>

  reply	other threads:[~2022-10-07 23:51 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 15:06 [PATCH 00/17] btrfs: initial ctree.h cleanups, simple stuff Josef Bacik
2022-09-14 15:06 ` [PATCH 01/17] btrfs: remove set/clear_pending_info helpers Josef Bacik
2022-09-15  9:03   ` Qu Wenruo
2022-09-15 14:11   ` Johannes Thumshirn
2022-10-07 16:51   ` David Sterba
2022-09-14 15:06 ` [PATCH 02/17] btrfs: remove BTRFS_TOTAL_BYTES_PINNED_BATCH Josef Bacik
2022-09-15  9:03   ` Qu Wenruo
2022-09-15 14:11   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 03/17] btrfs: remove BTRFS_IOPRIO_READA Josef Bacik
2022-09-15  9:03   ` Qu Wenruo
2022-09-15 14:12   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 04/17] btrfs: move btrfs on disk definitions out of ctree.h Josef Bacik
2022-09-15  9:07   ` Qu Wenruo
2022-10-07 17:07     ` David Sterba
2022-10-07 23:50       ` Qu Wenruo [this message]
2022-09-14 15:06 ` [PATCH 05/17] btrfs: move btrfs_get_block_group helper out of disk-io.h Josef Bacik
2022-09-15  9:10   ` Qu Wenruo
2022-09-15 14:14   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 06/17] btrfs: move maximum limits to btrfs_tree.h Josef Bacik
2022-09-15  9:10   ` Qu Wenruo
2022-09-15 14:15   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 07/17] btrfs: move BTRFS_MAX_MIRRORS into scrub.c Josef Bacik
2022-09-15  9:11   ` Qu Wenruo
2022-09-15 14:16   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 08/17] btrfs: move discard stat defs to free-space-cache.h Josef Bacik
2022-09-15  9:13   ` Qu Wenruo
2022-09-15 14:18   ` Johannes Thumshirn
2022-10-07 17:17     ` David Sterba
2022-10-07 17:16   ` David Sterba
2022-09-14 15:06 ` [PATCH 09/17] btrfs: move btrfs_chunk_item_size out of ctree.h Josef Bacik
2022-09-15  9:14   ` Qu Wenruo
2022-10-07 17:23     ` David Sterba
2022-09-15 14:19   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 10/17] btrfs: move btrfs_should_fragment_free_space into block-group.c Josef Bacik
2022-09-15  9:16   ` Qu Wenruo
2022-09-15 14:21   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 11/17] btrfs: move flush related definitions to space-info.h Josef Bacik
2022-09-15  9:21   ` Qu Wenruo
2022-10-07 17:28     ` David Sterba
2022-09-15 14:21   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 12/17] btrfs: move btrfs_print_data_csum_error into inode.c Josef Bacik
2022-09-15  9:22   ` Qu Wenruo
2022-10-07 17:31     ` David Sterba
2022-09-15 14:23   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 13/17] btrfs: move trans_handle_cachep out of ctree.h Josef Bacik
2022-09-15  9:23   ` Qu Wenruo
2022-09-15 14:24   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 14/17] btrfs: move btrfs_path_cachep " Josef Bacik
2022-09-15  9:27   ` Qu Wenruo
2022-09-15 14:27   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 15/17] btrfs: move free space cachep's " Josef Bacik
2022-09-15  9:27   ` Qu Wenruo
2022-09-15 14:27   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 16/17] btrfs: move btrfs_next_old_item into ctree.c Josef Bacik
2022-09-15  9:29   ` Qu Wenruo
2022-09-15 14:29   ` Johannes Thumshirn
2022-09-14 15:06 ` [PATCH 17/17] btrfs: move the btrfs_verity_descriptor_item defs up in ctree.h Josef Bacik
2022-09-15  9:30   ` Qu Wenruo
2022-09-15 14:30   ` Johannes Thumshirn
2022-09-15  9:47 ` [PATCH 00/17] btrfs: initial ctree.h cleanups, simple stuff Qu Wenruo
2022-10-07 17:51   ` 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=e1a2eca9-ea59-0826-6181-c19b446cdf79@suse.com \
    --to=wqu@suse.com \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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