From 1eb7b11303d44866f960a689c19b7b08b6df158f Mon Sep 17 00:00:00 2001 From: David Sterba Date: Sat, 12 Jun 2021 22:39:14 +0200 Subject: [PATCH] btrfs-progs: remove stale user transaction ioctl definitions The user transaction ioctls have been removed in kernel 4.17 by commit 7a5a07a81062 ("btrfs: Remove userspace transaction ioctls"), the definitions are not relevant and can be removed. The numbers could be reused in the future, eg. when there are no maintained LTS kernels older than 4.19. Signed-off-by: David Sterba --- Documentation/btrfs-ioctl.asciidoc | 2 -- ioctl.h | 10 +++++----- libbtrfsutil/btrfs.h | 10 +++++----- tests/ioctl-test.c | 4 ---- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Documentation/btrfs-ioctl.asciidoc b/Documentation/btrfs-ioctl.asciidoc index cdf8bd4a..b7082f8a 100644 --- a/Documentation/btrfs-ioctl.asciidoc +++ b/Documentation/btrfs-ioctl.asciidoc @@ -92,8 +92,6 @@ LIST OF IOCTLS BTRFS_IOC_DEFRAG BTRFS_IOC_RESIZE BTRFS_IOC_SCAN_DEV - BTRFS_IOC_TRANS_START - BTRFS_IOC_TRANS_END BTRFS_IOC_SYNC BTRFS_IOC_CLONE BTRFS_IOC_ADD_DEV diff --git a/ioctl.h b/ioctl.h index ade6dcb9..9e1e3403 100644 --- a/ioctl.h +++ b/ioctl.h @@ -832,12 +832,12 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code) struct btrfs_ioctl_vol_args) #define BTRFS_IOC_FORGET_DEV _IOW(BTRFS_IOCTL_MAGIC, 5, \ struct btrfs_ioctl_vol_args) -/* trans start and trans end are dangerous, and only for - * use by applications that know how to avoid the - * resulting deadlocks +/* + * Removed in kernel since 4.17: + * BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6) + * BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7) */ -#define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6) -#define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7) + #define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8) #define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int) diff --git a/libbtrfsutil/btrfs.h b/libbtrfsutil/btrfs.h index 60d51ff6..a3117362 100644 --- a/libbtrfsutil/btrfs.h +++ b/libbtrfsutil/btrfs.h @@ -843,12 +843,12 @@ enum btrfs_err_code { struct btrfs_ioctl_vol_args) #define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, \ struct btrfs_ioctl_vol_args) -/* trans start and trans end are dangerous, and only for - * use by applications that know how to avoid the - * resulting deadlocks +/* + * Removed in kernel since 4.17: + * BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6) + * BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7) */ -#define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6) -#define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7) + #define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8) #define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int) diff --git a/tests/ioctl-test.c b/tests/ioctl-test.c index 60ce6d5b..a8a120ac 100644 --- a/tests/ioctl-test.c +++ b/tests/ioctl-test.c @@ -32,8 +32,6 @@ ONE(BTRFS_IOC_DEFRAG) \ ONE(BTRFS_IOC_RESIZE) \ ONE(BTRFS_IOC_SCAN_DEV) \ - ONE(BTRFS_IOC_TRANS_START) \ - ONE(BTRFS_IOC_TRANS_END) \ ONE(BTRFS_IOC_SYNC) \ ONE(BTRFS_IOC_CLONE) \ ONE(BTRFS_IOC_ADD_DEV) \ @@ -100,8 +98,6 @@ static struct ioctl_number expected_list[] = { { BTRFS_IOC_DEFRAG, 0x0050009402 }, { BTRFS_IOC_RESIZE, 0x0050009403 }, { BTRFS_IOC_SCAN_DEV, 0x0050009404 }, - { BTRFS_IOC_TRANS_START, 0x0000009406 }, - { BTRFS_IOC_TRANS_END, 0x0000009407 }, { BTRFS_IOC_SYNC, 0x0000009408 }, { BTRFS_IOC_CLONE, 0x0040049409 }, { BTRFS_IOC_ADD_DEV, 0x005000940a },