Re: [PATCH] btrfs: Turn fs_roots_radix in btrfs_fs_info into an XArray

Nikolay Borisov
2022-04-28T11:37:53Z

On 27.04.22 г. 17:51 ч., Gabriel Niebler wrote:
>
> Naming things is hard. Here are some ideas I've had:
>
> BTRFS_ROOT_IN_XARRAY is obvious, but it also includes kind of a needless
> implementation detail.
>
> BTRFS_ROOT_IN_(FS_)ROOTS would be technically accurate, but might be
> confusing for the reader (e.g. if they don't know about
> btrfs_fs_indo->fs_roots of the top off their head).
>
> BTRFS_ROOT_IN_FS_INFO_ROOTS makes that a bit clearer (someone might
> think it refers to fbtrfs_fs_info->roots, but when they find that
> doesn't exist they'd quickly catch on, I think), but a bit lengthy.
>
> BTRFS_ROOT_IN_FS_INFO_FS_ROOTS is probably the most accurate, but really
> quite long...
>
> Does anyone else have any ideas?

BTRFS_ROOT_ACCESSIBLE/BTRFS_ROOT_REGISTERED/BTRFS_ROOT_PUBLIC/BTRFS_ROOT_INITIALIZED

because when a root goes into the root registry (either xarray or radix)
it's essentially published to this "registry" and can be referenced by
other parts of the filesystem. And this registration is part of the
root's initialization sequence.