mbox series

[v2,0/3] btrfs-progs: use libbtrfsutil for subvolume creation

Message ID 20240802112730.3575159-1-maharmstone@fb.com (mailing list archive)
Headers show
Series btrfs-progs: use libbtrfsutil for subvolume creation | expand

Message

Mark Harmstone Aug. 2, 2024, 11:27 a.m. UTC
These patches are a resending of Omar Sandoval's patch from 2018, which
appears to have been overlooked [0], split up and rebased against the
current code.

We change btrfs subvol create and btrfs subvol snapshot so that they use
libbtrfsutil rather than calling the ioctl directly.

[0] https://lore.kernel.org/linux-btrfs/ab09ba595157b7fb6606814730508cae4da48caf.1516991902.git.osandov@fb.com/

Changelog:
* Fixed deprecated function names
* Fixed test failures (now returns correct return value on failure)
* Fixed this breaking fstest btrfs/300 (thanks Boris)

Mark Harmstone (3):
  btrfs-progs: use libbtrfsutil for btrfs subvolume create
  btrfs-progs: use libbtrfsutil for btrfs subvolume snapshot
  btrfs-progs: remove unused qgroup functions

 cmds/qgroup.c    |  64 ----------------
 cmds/qgroup.h    |   2 -
 cmds/subvolume.c | 194 +++++++++++++++++++----------------------------
 3 files changed, 76 insertions(+), 184 deletions(-)

Comments

Neal Gompa Aug. 2, 2024, 1:17 p.m. UTC | #1
On Fri, Aug 2, 2024 at 7:27 AM Mark Harmstone <maharmstone@fb.com> wrote:
>
> These patches are a resending of Omar Sandoval's patch from 2018, which
> appears to have been overlooked [0], split up and rebased against the
> current code.
>
> We change btrfs subvol create and btrfs subvol snapshot so that they use
> libbtrfsutil rather than calling the ioctl directly.
>
> [0] https://lore.kernel.org/linux-btrfs/ab09ba595157b7fb6606814730508cae4da48caf.1516991902.git.osandov@fb.com/
>
> Changelog:
> * Fixed deprecated function names
> * Fixed test failures (now returns correct return value on failure)
> * Fixed this breaking fstest btrfs/300 (thanks Boris)
>
> Mark Harmstone (3):
>   btrfs-progs: use libbtrfsutil for btrfs subvolume create
>   btrfs-progs: use libbtrfsutil for btrfs subvolume snapshot
>   btrfs-progs: remove unused qgroup functions
>
>  cmds/qgroup.c    |  64 ----------------
>  cmds/qgroup.h    |   2 -
>  cmds/subvolume.c | 194 +++++++++++++++++++----------------------------
>  3 files changed, 76 insertions(+), 184 deletions(-)
>
> --
> 2.44.2
>
>

Series looks good to me.

Reviewed-by: Neal Gompa <neal@gompa.dev>
Qu Wenruo Aug. 5, 2024, 12:46 a.m. UTC | #2
在 2024/8/2 20:57, Mark Harmstone 写道:
> These patches are a resending of Omar Sandoval's patch from 2018, which
> appears to have been overlooked [0], split up and rebased against the
> current code.
>
> We change btrfs subvol create and btrfs subvol snapshot so that they use
> libbtrfsutil rather than calling the ioctl directly.
>
> [0] https://lore.kernel.org/linux-btrfs/ab09ba595157b7fb6606814730508cae4da48caf.1516991902.git.osandov@fb.com/

Since you're reviving the cleanups, you may also want to move some
btrfs-progs' ioctl related functions to libbtrfsutils.

One example is btrfs_lookup_uuid_subvol_item() and
btrfs_lookup_uuid_received_subvol_item().

With them moved to libbtrfsutils, we can mark
kernel-shared/uuid-tree.[ch] as fully cross-ported from kernel.

Thanks,
Qu
>
> Changelog:
> * Fixed deprecated function names
> * Fixed test failures (now returns correct return value on failure)
> * Fixed this breaking fstest btrfs/300 (thanks Boris)
>
> Mark Harmstone (3):
>    btrfs-progs: use libbtrfsutil for btrfs subvolume create
>    btrfs-progs: use libbtrfsutil for btrfs subvolume snapshot
>    btrfs-progs: remove unused qgroup functions
>
>   cmds/qgroup.c    |  64 ----------------
>   cmds/qgroup.h    |   2 -
>   cmds/subvolume.c | 194 +++++++++++++++++++----------------------------
>   3 files changed, 76 insertions(+), 184 deletions(-)
>
Mark Harmstone Aug. 6, 2024, 4:41 p.m. UTC | #3
Thanks Qu, I'll have a look at them.

Mark

On 5/8/24 01:46, Qu Wenruo wrote:
> Since you're reviving the cleanups, you may also want to move some
> btrfs-progs' ioctl related functions to libbtrfsutils.
> 
> One example is btrfs_lookup_uuid_subvol_item() and
> btrfs_lookup_uuid_received_subvol_item().
> 
> With them moved to libbtrfsutils, we can mark
> kernel-shared/uuid-tree.[ch] as fully cross-ported from kernel.