mbox series

[RFC,0/8] btrfs: convert to fscontext

Message ID 20200812163654.17080-1-marcos@mpdesouza.com (mailing list archive)
Headers show
Series btrfs: convert to fscontext | expand

Message

Marcos Paulo de Souza Aug. 12, 2020, 4:36 p.m. UTC
From: Marcos Paulo de Souza <mpdesouza@suse.com>

These patches aim to convert btrfs to new fscontext API. I used the approach of
creating a new parsing function and then switching to this new function, instead
of creating a huge change patch. Please let me know if you think this is a
better approach.

The most notable changes come form the fact that now we parse the mount options
before having a fs_info, in the same way that David Howells did in his POC[1]
some time ago.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=Q46&id=554cb2019cda83e1aba10bd9eea485afd2ddb983

Marcos Paulo de Souza (8):
  btrfs: fs_context: Add initial fscontext parameters
  btrfs: super: Introduce fs_context ops, init and free functions
  btrfs: super: Introduce btrfs_fc_parse_param and
    btrfs_apply_configuration
  btrfs: super: Introduce btrfs_fc_validate
  btrfs: super: Introduce btrfs_dup_fc
  btrfs: super: Introduce btrfs_mount_root_fc
  btrfs: Convert to fs_context
  btrfs: Remove leftover code from fscontext conversion

 fs/btrfs/ctree.h       |   29 +
 fs/btrfs/dev-replace.c |    2 +-
 fs/btrfs/disk-io.c     |   10 +-
 fs/btrfs/disk-io.h     |    4 +-
 fs/btrfs/super.c       | 1819 +++++++++++++++++++++-------------------
 fs/btrfs/volumes.c     |    6 +-
 6 files changed, 974 insertions(+), 896 deletions(-)

Comments

David Sterba Aug. 17, 2020, 12:44 p.m. UTC | #1
On Wed, Aug 12, 2020 at 01:36:46PM -0300, Marcos Paulo de Souza wrote:
> From: Marcos Paulo de Souza <mpdesouza@suse.com>
> 
> These patches aim to convert btrfs to new fscontext API. I used the approach of
> creating a new parsing function and then switching to this new function, instead
> of creating a huge change patch. Please let me know if you think this is a
> better approach.

A huge patch would be unreviewable, incremental addition of the
callbacks and then 1 patch switch is what we want. Also we want the
whole series to be bisectable, I'm not sure if adding the callbacks like
.parameters will not take some path in the fs context and mixing it
together with the previous mount way.

This could be avoided by adding all the callbacks first and then
switching just the callbacks, without any other changes. The way you do
it in patch "btrfs: Convert to fs_context" feels too much. Temporary
code duplication is ok, removing unused functions as post-cleanups is
preferred.

> The most notable changes come form the fact that now we parse the mount options
> before having a fs_info, in the same way that David Howells did in his POC[1]
> some time ago.

> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=Q46&id=554cb2019cda83e1aba10bd9eea485afd2ddb983

Adding David H. to CC.

> Marcos Paulo de Souza (8):
>   btrfs: fs_context: Add initial fscontext parameters
>   btrfs: super: Introduce fs_context ops, init and free functions
>   btrfs: super: Introduce btrfs_fc_parse_param and
>     btrfs_apply_configuration
>   btrfs: super: Introduce btrfs_fc_validate
>   btrfs: super: Introduce btrfs_dup_fc
>   btrfs: super: Introduce btrfs_mount_root_fc
>   btrfs: Convert to fs_context
>   btrfs: Remove leftover code from fscontext conversion

Please change the subjects to "btrfs: fs_context: ...", this is not
about super block.

I'll reply with more specific comments under the patches.