History

Merge tag 'for-5.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

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 ...

Linus Torvalds committed 6 years ago

Commit 15c981d2 parents 1455c69 6ff067265 files · +4462 −3536Browse files

Showing the changes to include/uapi/linux (1 of 65 files). Show all

Unified · Split

include/uapi/linux/btrfs.h+30−7
@@ -36,17 +36,24 @@ struct btrfs_ioctl_vol_args { · 35 unmodified lines
3636 #define BTRFS_DEVICE_PATH_NAME_MAX 1024
3737 #define BTRFS_SUBVOL_NAME_MAX 4039
3838
39−#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
39+/*
40+ * Deprecated since 5.7:
41+ *
42+ * BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
43+ */
44+
4045 #define BTRFS_SUBVOL_RDONLY (1ULL << 1)
4146 #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
4247
4348 #define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
4449
50+#define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4)
51+
4552 #define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
46− (BTRFS_SUBVOL_CREATE_ASYNC | \
47− BTRFS_SUBVOL_RDONLY | \
53+ (BTRFS_SUBVOL_RDONLY | \
4854 BTRFS_SUBVOL_QGROUP_INHERIT | \
49− BTRFS_DEVICE_SPEC_BY_ID)
55+ BTRFS_DEVICE_SPEC_BY_ID | \
56+ BTRFS_SUBVOL_SPEC_BY_ID)
5057
5158 #define BTRFS_FSID_SIZE 16
5259 #define BTRFS_UUID_SIZE 16
@@ -97,16 +104,29 @@ struct btrfs_ioctl_qgroup_limit_args { · 44 unmodified lines
97104 };
98105
99106 /*
100− * flags for subvolumes
107+ * Arguments for specification of subvolumes or devices, supporting by-name or
108+ * by-id and flags
101109 *
102− * Used by:
103− * struct btrfs_ioctl_vol_args_v2.flags
110+ * The set of supported flags depends on the ioctl
104111 *
105112 * BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls:
106113 * - BTRFS_IOC_SUBVOL_GETFLAGS
107114 * - BTRFS_IOC_SUBVOL_SETFLAGS
108115 */
109116
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+
110130 struct btrfs_ioctl_vol_args_v2 {
111131 __s64 fd;
112132 __u64 transid;
@@ -121,6 +141,7 @@ struct btrfs_ioctl_vol_args_v2 { · 8 unmodified lines
121141 union {
122142 char name[BTRFS_SUBVOL_NAME_MAX + 1];
123143 __u64 devid;
144+ __u64 subvolid;
124145 };
125146 };
126147
@@ -949,5 +970,7 @@ enum btrfs_err_code { · 822 unmodified lines
949970 struct btrfs_ioctl_get_subvol_rootref_args)
950971 #define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \
951972 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)
952975
953976 #endif /* _UAPI_LINUX_BTRFS_H */