btrfs-progs: docs: document device add and remove ioctls

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-12-05 20:17:02 +01:00
parent 216c9f0ffb
commit c1ce48ed3f
1 changed files with 61 additions and 6 deletions

View File

@ -258,12 +258,12 @@ LIST OF IOCTLS
* - BTRFS_IOC_CLONE
-
-
* - BTRFS_IOC_ADD_DEV
-
-
* - BTRFS_IOC_RM_DEV
-
-
* - :ref:`BTRFS_IOC_ADD_DEV<BTRFS_IOC_ADD_DEV>`
- add a device to the filesystem by path
- :ref:`struct btrfs_ioctl_vol_args<struct_btrfs_ioctl_vol_args>`
* - :ref:`BTRFS_IOC_RM_DEV<BTRFS_IOC_RM_DEV>`
- delete a device from the filesystem by path
- :ref:`struct btrfs_ioctl_vol_args<struct_btrfs_ioctl_vol_args>`
* - BTRFS_IOC_BALANCE
-
-
@ -488,6 +488,61 @@ subvolume cleaning or queued defragmentation.
* - ioctl args
- NULL
.. _BTRFS_IOC_ADD_DEV:
BTRFS_IOC_ADD_DEV
~~~~~~~~~~~~~~~~~
Add a given block device to the filesystem. Unlike the command :command:`btrfs device add`
there's are no safety checks (like existence of another filesystem on the
device), device preparataion (like TRIM or zone reset), so use it with care.
This is a filesystem-exclusive operation and it will fail if there's another
one already running, with one exception, when there's a paused balance.
Required permissions: CAP_SYS_ADMIN
.. list-table::
:header-rows: 1
* - Field
- Description
* - ioctl fd
- file descriptor of any file or directory in the filesystem
* - ioctl args
- :ref:`struct btrfs_ioctl_vol_args<struct_btrfs_ioctl_vol_args>`
* - args.fd
- ignored
* - args.name
- full path of the block device to be added
.. _BTRFS_IOC_RM_DEV:
BTRFS_IOC_RM_DEV
~~~~~~~~~~~~~~~~
Remove a device from the filesystem specified by it's path, or cancel
a running device deletion by special path ``cancel``.
This is a filesystem-exclusive operation and it will fail if there's another
one already running.
Required permissions: CAP_SYS_ADMIN
.. list-table::
:header-rows: 1
* - Field
- Description
* - ioctl fd
- file descriptor of any file or directory in the filesystem
* - ioctl args
- :ref:`struct btrfs_ioctl_vol_args<struct_btrfs_ioctl_vol_args>`
* - args.fd
- ignored
* - args.name
- full path of the block device to be deleted or string *"cancel"*
.. _BTRFS_IOC_SUBVOL_CREATE:
BTRFS_IOC_SUBVOL_CREATE