Pull btrfs updates from David Sterba: "A number of core changes that make things work better in general, code is simpler and cleaner. Core changes: - per-inode file extent tree, for in memory tracking of contiguous extent ranges to make sure i_size adjustments are accurate - tree root structures are protected by reference counts, replacing SRCU that did not cover some cases - leak detector for tree root structures - per-transaction pinned extent tracking - buffer heads are replaced by bios for super block access - speedup of extent back reference resolution, on an example test scenario the runtime of send went down from a hour to minutes - factor out locking scheme used for subvolume writer and NOCOW exclusion, abstracted as DREW lock, double reader-writer exclusion (allow either readers or writers) - cleanup and abstract extent allocation policies, preparation for zoned device support - make reflink/clone_range work on inline extents - add more cancellation point for relocation, improves long response from 'balance cancel' - add page migration callback for data pages - switch to guid for uuids, with additional cleanups of the interface - make ranged full fsyncs more efficient - removal of obsolete ioctl flag BTRFS_SUBVOL_CREATE_ASYNC - remove b-tree readahead from delayed refs paths, avoiding seek and read unnecessary blocks Features: - v2 of ioctl to delete subvolumes, allowing to delete by id and more future extensions Fixes: - fix qgroup rescan worker that could block umount - fix crash during unmount due to race with delayed inode workers - fix dellaloc flushing logic that could create unnecessary chunks under heavy load - fix missing file extent item for hole after ranged fsync - several fixes in relocation error handling Other: - more documentation of relocation, device replace, space reservations - many random cleanups" * tag 'for-5.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (210 commits) btrfs: fix missing semaphore unlock in btrfs_sync_file btrfs: use nofs allocations for running delayed items btrfs: sysfs: Use scnprintf() instead of snprintf() btrfs: do not resolve backrefs for roots that are being deleted btrfs: track reloc roots based on their commit root bytenr btrfs: restart relocate_tree_blocks properly btrfs: reloc: reorder reservation before root selection btrfs: do not readahead in build_backref_tree btrfs: do not use readahead for running delayed refs btrfs: Remove async_transid from btrfs_mksubvol/create_subvol/create_snapshot btrfs: Remove transid argument from btrfs_ioctl_snap_create_transid btrfs: Remove BTRFS_SUBVOL_CREATE_ASYNC support btrfs: kill the subvol_srcu btrfs: make btrfs_cleanup_fs_roots use the radix tree lock btrfs: don't take an extra root ref at allocation time btrfs: hold a ref on the root on the dead roots list btrfs: make inodes hold a ref on their roots btrfs: move the root freeing stuff into btrfs_put_root btrfs: move ino_cache_inode dropping out of btrfs_free_fs_root btrfs: make the extent buffer leak check per fs info ...
Showing the changes to include/uapi/linux (1 of 65 files). Show all
Unified · Split
| @@ -36,17 +36,24 @@ struct btrfs_ioctl_vol_args { · 35 unmodified lines | |||
| 36 | #define BTRFS_DEVICE_PATH_NAME_MAX 1024 | 36 | #define BTRFS_DEVICE_PATH_NAME_MAX 1024 |
| 37 | #define BTRFS_SUBVOL_NAME_MAX 4039 | 37 | #define BTRFS_SUBVOL_NAME_MAX 4039 |
| 38 | 38 | ||
| 39 | #define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) | 39 | /* |
| 40 | * Deprecated since 5.7: | ||
| 41 | * | ||
| 42 | * BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) | ||
| 43 | */ | ||
| 44 | |||
| 40 | #define BTRFS_SUBVOL_RDONLY (1ULL << 1) | 45 | #define BTRFS_SUBVOL_RDONLY (1ULL << 1) |
| 41 | #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2) | 46 | #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2) |
| 42 | 47 | ||
| 43 | #define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3) | 48 | #define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3) |
| 44 | 49 | ||
| 50 | #define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4) | ||
| 51 | |||
| 45 | #define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \ | 52 | #define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \ |
| 46 | (BTRFS_SUBVOL_CREATE_ASYNC | \ | 53 | (BTRFS_SUBVOL_RDONLY | \ |
| 47 | BTRFS_SUBVOL_RDONLY | \ | ||
| 48 | BTRFS_SUBVOL_QGROUP_INHERIT | \ | 54 | BTRFS_SUBVOL_QGROUP_INHERIT | \ |
| 49 | BTRFS_DEVICE_SPEC_BY_ID) | 55 | BTRFS_DEVICE_SPEC_BY_ID | \ |
| 56 | BTRFS_SUBVOL_SPEC_BY_ID) | ||
| 50 | 57 | ||
| 51 | #define BTRFS_FSID_SIZE 16 | 58 | #define BTRFS_FSID_SIZE 16 |
| 52 | #define BTRFS_UUID_SIZE 16 | 59 | #define BTRFS_UUID_SIZE 16 |
| @@ -97,16 +104,29 @@ struct btrfs_ioctl_qgroup_limit_args { · 44 unmodified lines | |||
| 97 | }; | 104 | }; |
| 98 | 105 | ||
| 99 | /* | 106 | /* |
| 100 | * flags for subvolumes | 107 | * Arguments for specification of subvolumes or devices, supporting by-name or |
| 108 | * by-id and flags | ||
| 101 | * | 109 | * |
| 102 | * Used by: | 110 | * The set of supported flags depends on the ioctl |
| 103 | * struct btrfs_ioctl_vol_args_v2.flags | ||
| 104 | * | 111 | * |
| 105 | * BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls: | 112 | * BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls: |
| 106 | * - BTRFS_IOC_SUBVOL_GETFLAGS | 113 | * - BTRFS_IOC_SUBVOL_GETFLAGS |
| 107 | * - BTRFS_IOC_SUBVOL_SETFLAGS | 114 | * - BTRFS_IOC_SUBVOL_SETFLAGS |
| 108 | */ | 115 | */ |
| 109 | 116 | ||
| 117 | /* Supported flags for BTRFS_IOC_RM_DEV_V2 */ | ||
| 118 | #define BTRFS_DEVICE_REMOVE_ARGS_MASK \ | ||
| 119 | (BTRFS_DEVICE_SPEC_BY_ID) | ||
| 120 | |||
| 121 | /* Supported flags for BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SUBVOL_CREATE_V2 */ | ||
| 122 | #define BTRFS_SUBVOL_CREATE_ARGS_MASK \ | ||
| 123 | (BTRFS_SUBVOL_RDONLY | \ | ||
| 124 | BTRFS_SUBVOL_QGROUP_INHERIT) | ||
| 125 | |||
| 126 | /* Supported flags for BTRFS_IOC_SNAP_DESTROY_V2 */ | ||
| 127 | #define BTRFS_SUBVOL_DELETE_ARGS_MASK \ | ||
| 128 | (BTRFS_SUBVOL_SPEC_BY_ID) | ||
| 129 | |||
| 110 | struct btrfs_ioctl_vol_args_v2 { | 130 | struct btrfs_ioctl_vol_args_v2 { |
| 111 | __s64 fd; | 131 | __s64 fd; |
| 112 | __u64 transid; | 132 | __u64 transid; |
| @@ -121,6 +141,7 @@ struct btrfs_ioctl_vol_args_v2 { · 8 unmodified lines | |||
| 121 | union { | 141 | union { |
| 122 | char name[BTRFS_SUBVOL_NAME_MAX + 1]; | 142 | char name[BTRFS_SUBVOL_NAME_MAX + 1]; |
| 123 | __u64 devid; | 143 | __u64 devid; |
| 144 | __u64 subvolid; | ||
| 124 | }; | 145 | }; |
| 125 | }; | 146 | }; |
| 126 | 147 | ||
| @@ -949,5 +970,7 @@ enum btrfs_err_code { · 822 unmodified lines | |||
| 949 | struct btrfs_ioctl_get_subvol_rootref_args) | 970 | struct btrfs_ioctl_get_subvol_rootref_args) |
| 950 | #define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \ | 971 | #define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \ |
| 951 | struct btrfs_ioctl_ino_lookup_user_args) | 972 | struct btrfs_ioctl_ino_lookup_user_args) |
| 973 | #define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \ | ||
| 974 | struct btrfs_ioctl_vol_args_v2) | ||
| 952 | 975 | ||
| 953 | #endif /* _UAPI_LINUX_BTRFS_H */ | 976 | #endif /* _UAPI_LINUX_BTRFS_H */ |