mbox series

[v3,0/8] linux-user: Adding support for a group of btrfs ioctls

Message ID 20200823195014.116226-1-Filip.Bozuta@syrmia.com (mailing list archive)
Headers show
Series linux-user: Adding support for a group of btrfs ioctls | expand

Message

Filip Bozuta Aug. 23, 2020, 7:50 p.m. UTC
This series covers support for following btrfs ioctls

    *BTRFS_SUBVOL_CREATE           *BTRFS_IOC_ADD_DEV
    *BTRFS_SUBVOL_SETFLAGS         *BTRFS_IOC_RM_DEV
    *BTRFS_SUBVOL_GETFLAGS         *BTRFS_IOC_DEV_INFO
    *BTRFS_GET_SUBVOL_INFO         *BTRFS_IOC_GET_DEV_STATS
    *BTRFS_IOC_SNAP_CREATE         *BTRFS_IOC_GET_FEATURES
    *BTRFS_IOC_SNAP_DESTROY        *BTRFS_IOC_SET_FEATURES
    *BTRFS_IOC_SCAN_DEV            *BTRFS_IOC_GET_SUPPORTED_FEATURES
    *BTRFS_IOC_DEFAULT_SUBVOL      *BTRFS_IOC_QUOTA_RESCAN
    *BTRFS_IOC_GET_SUBVOL_ROOTREF  *BTRFS_IOC_QUOTA_RESCAN_WAIT
    *BTRFS_IOC_QUOTA_CTL           *BTRFS_IOC_SCRUB
    *BTRFS_IOC_QGROUP_CREATE       *BTRFS_IOC_SCRUB_CANCEL
    *BTRFS_IOC_QGROUP_ASSIGN       *BTRFS_IOC_SCRUB_PROGRESS
    *BTRFS_IOC_INO_PATHS           *BTRFS_IOC_QGROUP_LIMIT
    *BTRFS_IOC_LOGICAL_INO         *BTRFS_IOC_QUOTA_RESCAN_STATUS
    *BTRFS_IOC_LOGICAL_INO_V2
    *BTRFS_IOC_INO_LOOKUP_USER
    *BTRFS_IOC_INO_LOOKUP

The functionalities of individual ioctls were described in this series
patch commit messages. Since all of these ioctls are added in kernel
version 3.9, their definitions in file 'linux-user/ioctls.h' are
enwrapped in an #ifdef directive.

Testing method:

    Mini test programs were written for these ioctls. These test programs
    can be found on a repositort which is located on the link:
    https://github.com/bozutaf/btrfs-tests

    These test programs were compiled (sometimes using cross compilers) for
    following architectures:

         * Intel 64-bit (little endian)
         * Power pc 32-bit (big endian)
         * Power pc 64-bit (big endian)

    The corresponding native programs were executed without using QEMU on
    an intel x86_64 host.

    All applicable compiled programs were in turn executed through QEMU
    and the results obtained were the same ones gotten for native
    execution.

v2:

    * Merged two series in one 8 patch series
    * Changed target ioctl definitions from IOR/IOW/IOWR to IORU/IOWU/IOWRU
    * Fixed some thunk struct definitions

v3:

   * Added some checks in fine 'syscall_types.h' to see whether the ioctls that
     use the defined thunk types are present. This is done to support systems
     that have older versions of 'btrfs.h' file or if the file is not present
     at all. This is neccesary as to not cause build errors as some structures
     depend on values which are defined in 'btrfs.h'.

Filip Bozuta (8):
  linux-user: Add support for a group of btrfs ioctls used for
    subvolumes
  linux-user: Add support for a group of btrfs ioctls used for snapshots
  linux-user: Add support for btrfs ioctls used to manipulate with
    devices
  linux-user: Add support for btrfs ioctls used to get/set features
  linux-user: Add support for a group of btrfs inode ioctls
  linux-user: Add support for two btrfs ioctls used for subvolume
  linux-user: Add support for btrfs ioctls used to manage quota
  linux-user: Add support for btrfs ioctls used to scrub a filesystem

 configure                  |   9 ++
 linux-user/ioctls.h        | 124 ++++++++++++++++++++++++++++
 linux-user/syscall.c       |   3 +
 linux-user/syscall_defs.h  |  37 +++++++++
 linux-user/syscall_types.h | 163 +++++++++++++++++++++++++++++++++++++
 5 files changed, 336 insertions(+)

Comments

Daniel P. Berrangé Aug. 27, 2020, 8:09 a.m. UTC | #1
On Sun, Aug 23, 2020 at 09:50:06PM +0200, Filip Bozuta wrote:
> This series covers support for following btrfs ioctls
> 
>     *BTRFS_SUBVOL_CREATE           *BTRFS_IOC_ADD_DEV
>     *BTRFS_SUBVOL_SETFLAGS         *BTRFS_IOC_RM_DEV
>     *BTRFS_SUBVOL_GETFLAGS         *BTRFS_IOC_DEV_INFO
>     *BTRFS_GET_SUBVOL_INFO         *BTRFS_IOC_GET_DEV_STATS
>     *BTRFS_IOC_SNAP_CREATE         *BTRFS_IOC_GET_FEATURES
>     *BTRFS_IOC_SNAP_DESTROY        *BTRFS_IOC_SET_FEATURES
>     *BTRFS_IOC_SCAN_DEV            *BTRFS_IOC_GET_SUPPORTED_FEATURES
>     *BTRFS_IOC_DEFAULT_SUBVOL      *BTRFS_IOC_QUOTA_RESCAN
>     *BTRFS_IOC_GET_SUBVOL_ROOTREF  *BTRFS_IOC_QUOTA_RESCAN_WAIT
>     *BTRFS_IOC_QUOTA_CTL           *BTRFS_IOC_SCRUB
>     *BTRFS_IOC_QGROUP_CREATE       *BTRFS_IOC_SCRUB_CANCEL
>     *BTRFS_IOC_QGROUP_ASSIGN       *BTRFS_IOC_SCRUB_PROGRESS
>     *BTRFS_IOC_INO_PATHS           *BTRFS_IOC_QGROUP_LIMIT
>     *BTRFS_IOC_LOGICAL_INO         *BTRFS_IOC_QUOTA_RESCAN_STATUS
>     *BTRFS_IOC_LOGICAL_INO_V2
>     *BTRFS_IOC_INO_LOOKUP_USER
>     *BTRFS_IOC_INO_LOOKUP
> 
> The functionalities of individual ioctls were described in this series
> patch commit messages. Since all of these ioctls are added in kernel
> version 3.9, their definitions in file 'linux-user/ioctls.h' are
> enwrapped in an #ifdef directive.
> 
> Testing method:
> 
>     Mini test programs were written for these ioctls. These test programs
>     can be found on a repositort which is located on the link:
>     https://github.com/bozutaf/btrfs-tests
> 
>     These test programs were compiled (sometimes using cross compilers) for
>     following architectures:
> 
>          * Intel 64-bit (little endian)
>          * Power pc 32-bit (big endian)
>          * Power pc 64-bit (big endian)
> 
>     The corresponding native programs were executed without using QEMU on
>     an intel x86_64 host.
> 
>     All applicable compiled programs were in turn executed through QEMU
>     and the results obtained were the same ones gotten for native
>     execution.
> 
> v2:
> 
>     * Merged two series in one 8 patch series
>     * Changed target ioctl definitions from IOR/IOW/IOWR to IORU/IOWU/IOWRU
>     * Fixed some thunk struct definitions
> 
> v3:
> 
>    * Added some checks in fine 'syscall_types.h' to see whether the ioctls that
>      use the defined thunk types are present. This is done to support systems
>      that have older versions of 'btrfs.h' file or if the file is not present
>      at all. This is neccesary as to not cause build errors as some structures
>      depend on values which are defined in 'btrfs.h'.
> 
> Filip Bozuta (8):
>   linux-user: Add support for a group of btrfs ioctls used for
>     subvolumes
>   linux-user: Add support for a group of btrfs ioctls used for snapshots
>   linux-user: Add support for btrfs ioctls used to manipulate with
>     devices
>   linux-user: Add support for btrfs ioctls used to get/set features
>   linux-user: Add support for a group of btrfs inode ioctls
>   linux-user: Add support for two btrfs ioctls used for subvolume
>   linux-user: Add support for btrfs ioctls used to manage quota
>   linux-user: Add support for btrfs ioctls used to scrub a filesystem
> 
>  configure                  |   9 ++
>  linux-user/ioctls.h        | 124 ++++++++++++++++++++++++++++
>  linux-user/syscall.c       |   3 +
>  linux-user/syscall_defs.h  |  37 +++++++++
>  linux-user/syscall_types.h | 163 +++++++++++++++++++++++++++++++++++++
>  5 files changed, 336 insertions(+)

Tested-by: Daniel P. Berrangé <berrange@redhat.com>

This series solves a problem that Fedora has with creating btrfs volumes
inside a mock chroot using qemu-user.

Regards,
Daniel