History

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

Pull btrfs updates from David Sterba: "New features: - raid-stripe-tree New tree for logical file extent mapping where the physical mapping may not match on multiple devices. This is now used in zoned mode to implement RAID0/RAID1* profiles, but can be used in non-zoned mode as well. The support for RAID56 is in development and will eventually fix the problems with the current implementation. This is a backward incompatible feature and has to be enabled at mkfs time. - simple quota accounting (squota) A simplified mode of qgroup that accounts all space on the initial extent owners (a subvolume), the snapshots are then cheap to create and delete. The deletion of snapshots in fully accounting qgroups is a known CPU/IO performance bottleneck. The squota is not suitable for the general use case but works well for containers where the original subvolume exists for the whole time. This is a backward incompatible feature as it needs extending some structures, but can be enabled on an existing filesystem. - temporary filesystem fsid (temp_fsid) The fsid identifies a filesystem and is hard coded in the structures, which disallows mounting the same fsid found on different devices. For a single device filesystem this is not strictly necessary, a new temporary fsid can be generated on mount e.g. after a device is cloned. This will be used by Steam Deck for root partition A/B testing, or can be used for VM root images. Other user visible changes: - filesystems with partially finished metadata_uuid conversion cannot be mounted anymore and the uuid fixup has to be done by btrfs-progs (btrfstune). Performance improvements: - reduce reservations for checksum deletions (with enabled free space tree by factor of 4), on a sample workload on file with many extents the deletion time decreased by 12% - make extent state merges more efficient during insertions, reduce rb-tree iterations (run time of critical functions reduced by 5%) Core changes: - the integrity check functionality has been removed, this was a debugging feature and removal does not affect other integrity checks like checksums or tree-checker - space reservation changes: - more efficient delayed ref reservations, this avoids building up too much work or overusing or exhausting the global block reserve in some situations - move delayed refs reservation to the transaction start time, this prevents some ENOSPC corner cases related to exhaustion of global reserve - improvements in reducing excessive reservations for block group items - adjust overcommit logic in near full situations, account for one more chunk to eventually allocate metadata chunk, this is mostly relevant for small filesystems (<10GiB) - single device filesystems are scanned but not registered (except seed devices), this allows temp_fsid to work - qgroup iterations do not need GFP_ATOMIC allocations anymore - cleanups, refactoring, reduced data structure size, function parameter simplifications, error handling fixes" * tag 'for-6.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (156 commits) btrfs: open code timespec64 in struct btrfs_inode btrfs: remove redundant log root tree index assignment during log sync btrfs: remove redundant initialization of variable dirty in btrfs_update_time() btrfs: sysfs: show temp_fsid feature btrfs: disable the device add feature for temp-fsid btrfs: disable the seed feature for temp-fsid btrfs: update comment for temp-fsid, fsid, and metadata_uuid btrfs: remove pointless empty log context list check when syncing log btrfs: update comment for struct btrfs_inode::lock btrfs: remove pointless barrier from btrfs_sync_file() btrfs: add and use helpers for reading and writing last_trans_committed btrfs: add and use helpers for reading and writing fs_info->generation btrfs: add and use helpers for reading and writing log_transid btrfs: add and use helpers for reading and writing last_log_commit btrfs: support cloned-device mount capability btrfs: add helper function find_fsid_by_disk btrfs: stop reserving excessive space for block group item insertions btrfs: stop reserving excessive space for block group item updates btrfs: reorder btrfs_inode to fill gaps btrfs: open code btrfs_ordered_inode_tree in btrfs_inode ...

Linus Torvalds committed 3 years ago

Commit d5acbc62 parents 8829687 c6e8f8983 files · +4033 −5291Browse files

Showing the changes to include/uapi (2 of 83 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/btrfs.h +3 −0
  2. include/uapi/linux/btrfs_tree.h +59 −1
include/uapi/linux/btrfs.h+3−0
@@ -333,6 +333,8 @@ struct btrfs_ioctl_fs_info_args { · 332 unmodified lines
333#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)333#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
334#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)334#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
335#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)335#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
336#define BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE (1ULL << 14)
337#define BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA (1ULL << 16)
336 338
337struct btrfs_ioctl_feature_flags {339struct btrfs_ioctl_feature_flags {
338 __u64 compat_flags;340 __u64 compat_flags;
@@ -753,6 +755,7 @@ struct btrfs_ioctl_get_dev_stats { · 414 unmodified lines
753#define BTRFS_QUOTA_CTL_ENABLE 1755#define BTRFS_QUOTA_CTL_ENABLE 1
754#define BTRFS_QUOTA_CTL_DISABLE 2756#define BTRFS_QUOTA_CTL_DISABLE 2
755#define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3757#define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3
758#define BTRFS_QUOTA_CTL_ENABLE_SIMPLE_QUOTA 4
756struct btrfs_ioctl_quota_ctl_args {759struct btrfs_ioctl_quota_ctl_args {
757 __u64 cmd;760 __u64 cmd;
758 __u64 status;761 __u64 status;
include/uapi/linux/btrfs_tree.h+59−1
@@ -73,6 +73,9 @@ · 72 unmodified lines
73/* Holds the block group items for extent tree v2. */73/* Holds the block group items for extent tree v2. */
74#define BTRFS_BLOCK_GROUP_TREE_OBJECTID 11ULL74#define BTRFS_BLOCK_GROUP_TREE_OBJECTID 11ULL
75 75
76/* Tracks RAID stripes in block groups. */
77#define BTRFS_RAID_STRIPE_TREE_OBJECTID 12ULL
78
76/* device stats in the device tree */79/* device stats in the device tree */
77#define BTRFS_DEV_STATS_OBJECTID 0ULL80#define BTRFS_DEV_STATS_OBJECTID 0ULL
78 81
@@ -230,6 +233,14 @@ · 151 unmodified lines
230 233
231#define BTRFS_SHARED_DATA_REF_KEY 184234#define BTRFS_SHARED_DATA_REF_KEY 184
232 235
236/*
237 * Special inline ref key which stores the id of the subvolume which originally
238 * created the extent. This subvolume owns the extent permanently from the
239 * perspective of simple quotas. Needed to know which subvolume to free quota
240 * usage from when the extent is deleted.
241 */
242#define BTRFS_EXTENT_OWNER_REF_KEY 188
243
233/*244/*
234 * block groups give us hints into the extent allocation trees. Which245 * block groups give us hints into the extent allocation trees. Which
235 * blocks are free etc etc246 * blocks are free etc etc
@@ -261,6 +272,8 @@ · 25 unmodified lines
261#define BTRFS_DEV_ITEM_KEY 216272#define BTRFS_DEV_ITEM_KEY 216
262#define BTRFS_CHUNK_ITEM_KEY 228273#define BTRFS_CHUNK_ITEM_KEY 228
263 274
275#define BTRFS_RAID_STRIPE_KEY 230
276
264/*277/*
265 * Records the overall state of the qgroups.278 * Records the overall state of the qgroups.
266 * There's only one instance of this key present,279 * There's only one instance of this key present,
@@ -719,6 +732,30 @@ struct btrfs_free_space_header { · 452 unmodified lines
719 __le64 num_bitmaps;732 __le64 num_bitmaps;
720} __attribute__ ((__packed__));733} __attribute__ ((__packed__));
721 734
735struct btrfs_raid_stride {
736 /* The id of device this raid extent lives on. */
737 __le64 devid;
738 /* The physical location on disk. */
739 __le64 physical;
740} __attribute__ ((__packed__));
741
742/* The stripe_extent::encoding, 1:1 mapping of enum btrfs_raid_types. */
743#define BTRFS_STRIPE_RAID0 1
744#define BTRFS_STRIPE_RAID1 2
745#define BTRFS_STRIPE_DUP 3
746#define BTRFS_STRIPE_RAID10 4
747#define BTRFS_STRIPE_RAID5 5
748#define BTRFS_STRIPE_RAID6 6
749#define BTRFS_STRIPE_RAID1C3 7
750#define BTRFS_STRIPE_RAID1C4 8
751
752struct btrfs_stripe_extent {
753 __u8 encoding;
754 __u8 reserved[7];
755 /* An array of raid strides this stripe is composed of. */
756 struct btrfs_raid_stride strides[];
757} __attribute__ ((__packed__));
758
722#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0)759#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0)
723#define BTRFS_HEADER_FLAG_RELOC (1ULL << 1)760#define BTRFS_HEADER_FLAG_RELOC (1ULL << 1)
724 761
@@ -787,6 +824,10 @@ struct btrfs_shared_data_ref { · 62 unmodified lines
787 __le32 count;824 __le32 count;
788} __attribute__ ((__packed__));825} __attribute__ ((__packed__));
789 826
827struct btrfs_extent_owner_ref {
828 __le64 root_id;
829} __attribute__ ((__packed__));
830
790struct btrfs_extent_inline_ref {831struct btrfs_extent_inline_ref {
791 __u8 type;832 __u8 type;
792 __le64 offset;833 __le64 offset;
@@ -1204,9 +1245,17 @@ static inline __u16 btrfs_qgroup_level(__u64 qgroupid) · 411 unmodified lines
1204 */1245 */
1205#define BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT (1ULL << 2)1246#define BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT (1ULL << 2)
1206 1247
1248/*
1249 * Whether or not this filesystem is using simple quotas. Not exactly the
1250 * incompat bit, because we support using simple quotas, disabling it, then
1251 * going back to full qgroup quotas.
1252 */
1253#define BTRFS_QGROUP_STATUS_FLAG_SIMPLE_MODE (1ULL << 3)
1254
1207#define BTRFS_QGROUP_STATUS_FLAGS_MASK (BTRFS_QGROUP_STATUS_FLAG_ON | \1255#define BTRFS_QGROUP_STATUS_FLAGS_MASK (BTRFS_QGROUP_STATUS_FLAG_ON | \
1208 BTRFS_QGROUP_STATUS_FLAG_RESCAN | \1256 BTRFS_QGROUP_STATUS_FLAG_RESCAN | \
1209 BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT)1257 BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT | \
1258 BTRFS_QGROUP_STATUS_FLAG_SIMPLE_MODE)
1210 1259
1211#define BTRFS_QGROUP_STATUS_VERSION 11260#define BTRFS_QGROUP_STATUS_VERSION 1
1212 1261
@@ -1228,6 +1277,15 @@ struct btrfs_qgroup_status_item { · 15 unmodified lines
1228 * of the scan. It contains a logical address1277 * of the scan. It contains a logical address
1229 */1278 */
1230 __le64 rescan;1279 __le64 rescan;
1280
1281 /*
1282 * The generation when quotas were last enabled. Used by simple quotas to
1283 * avoid decrementing when freeing an extent that was written before
1284 * enable.
1285 *
1286 * Set only if flags contain BTRFS_QGROUP_STATUS_FLAG_SIMPLE_MODE.
1287 */
1288 __le64 enable_gen;
1231} __attribute__ ((__packed__));1289} __attribute__ ((__packed__));
1232 1290
1233struct btrfs_qgroup_info_item {1291struct btrfs_qgroup_info_item {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t