btrfs-progs: docs: document label ioctls

[ci skip]

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-12-06 15:00:49 +01:00
parent f9ebee6838
commit 478a295b00
1 changed files with 51 additions and 6 deletions

View File

@ -177,6 +177,8 @@ DATA STRUCTURES AND DEFINITIONS
__u8 reserved[944]; /* pad to 1k */ __u8 reserved[944]; /* pad to 1k */
}; };
.. _constants-table:
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
@ -192,6 +194,8 @@ DATA STRUCTURES AND DEFINITIONS
- 4087 - 4087
* - BTRFS_VOL_NAME_MAX * - BTRFS_VOL_NAME_MAX
- 255 - 255
* - BTRFS_LABEL_SIZE
- 256
OVERVIEW OVERVIEW
-------- --------
@ -372,12 +376,12 @@ LIST OF IOCTLS
* - BTRFS_IOC_QUOTA_RESCAN_WAIT * - BTRFS_IOC_QUOTA_RESCAN_WAIT
- -
- -
* - BTRFS_IOC_GET_FSLABEL * - :ref:`BTRFS_IOC_GET_FSLABEL<BTRFS_IOC_GET_FSLABEL>`
- - read filesystem label
- - char buffer[BTRFS_LABEL_SIZE]
* - BTRFS_IOC_SET_FSLABEL * - :ref:`BTRFS_IOC_SET_FSLABEL<BTRFS_IOC_SET_FSLABEL>`
- - set the filesystem label
- - char buffer[BTRFS_LABEL_SIZE]
* - BTRFS_IOC_GET_DEV_STATS * - BTRFS_IOC_GET_DEV_STATS
- -
- -
@ -710,6 +714,47 @@ Change the flags of a subvolume.
* - ioctl args * - ioctl args
- uint64_t, either 0 or `BTRFS_SUBVOL_RDONLY` - uint64_t, either 0 or `BTRFS_SUBVOL_RDONLY`
.. _BTRFS_IOC_GET_FSLABEL:
BTRFS_IOC_GET_FSLABEL
~~~~~~~~~~~~~~~~~~~~~
Read the label of the filesystem into a given buffer. Alternatively it
can be read from :file:`/sys/fs/btrfs/FSID/label` though it requires to
know the FSID of the filesystem.
.. list-table::
:header-rows: 1
* - Field
- Description
* - ioctl fd
- file descriptor of any file/directory in the filesystem
* - ioctl args
- char buffer[:ref:`BTRFS_LABEL_SIZE<constants-table>`]
.. _BTRFS_IOC_SET_FSLABEL:
BTRFS_IOC_SET_FSLABEL
~~~~~~~~~~~~~~~~~~~~~
Set the label of filesystem from given buffer. The maximum length also accounts
for terminating NUL character. Alternatively it can be also set by writing to
:file:`/sys/fs/btrfs/FSID/label` though it requires to know the FSID of the
filesystem (and an explicit commit before the change is permanent).
Required permissions: CAP_SYS_ADMIN
.. list-table::
:header-rows: 1
* - Field
- Description
* - ioctl fd
- file descriptor of any file/directory in the filesystem
* - ioctl args
- char buffer[:ref:`BTRFS_LABEL_SIZE<constants-table>`]
.. _BTRFS_IOC_FS_INFO: .. _BTRFS_IOC_FS_INFO:
BTRFS_IOC_FS_INFO BTRFS_IOC_FS_INFO