Re: [PATCHv2] btrfs: Introduce new BTRFS_IOC_SNAP_DESTROY_V2 ioctl

From: David Sterba
Date: Tue Jan 28 2020 - 12:36:14 EST


On Tue, Jan 28, 2020 at 09:31:00AM -0800, Christoph Hellwig wrote:
> On Sun, Jan 26, 2020 at 11:48:17PM -0300, Marcos Paulo de Souza wrote:
> > From: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>
> >
> > This ioctl will be responsible for deleting a subvolume using it's id.
> > This can be used when a system has a file system mounted from a
> > subvolume, rather than the root file system, like below:
>
> Isn't BTRFS_IOC_SNAP_DESTROY_BY_ID a better name?

I'd prefer to keep it V2 as a more flexible ioctl than just to delete
by id. There are other _V2 ioctls that use matching
btrfs_ioctl_vol_args_v2 structure. In case we want to implement
recursive subvolume deletion we'd have to introduce yet another ioctl
number compared to just a new flag and support both by-name and by-id.
Sounds like a lot of duplication.