Pull btrfs updates from David Sterba: "The most noticeable change is to enable large folios by default, it's been in testing for a few releases. Related to that is huge folio support (still under experimental config). Otherwise a few ioctl updates, performance improvements and usual fixes and core changes. User visible changes: - enable large folios by default, added in 6.17 (under experimental build), no feature limitations, a big change internally - new ioctl to return raw checksums to userspace (a bit tricky given compression and tail extents), can be used for mkfs and deduplication optimizations - provide stable UUID for e.g. overlayfs and temp_fsid, also reflected in statvfs() field f_fsid, internal dev_t is hashed in to allow cloning - add 32bit compat version of GET_SUBVOL_INFO ioctl - in experimental build, support huge folios (up to 2M) Performance related improvements/changes: - limit bio size to the estimated optimum derived from the queue, this prevents build up of too much data for writeback, which could cause latency spikes (reported improvement 15% on sequential writes) - don't force direct IO to be serialized, forgotten change during mount API port, brings back +60% of throughput - lockless calculation of number of shrinkable extent maps, improve performance with many memcg allocated objects Notable fixes: - in zoned mode, fix a deadlock due to zone reclaim and relocation when space needs to be flushed - don't trim device which is internally not tracked as writeable (e.g. when missing device is being rescanned) - fix deadlock when cloning inline extent and mounted with flushoncommit - fix false IO failures after direct IO falls back to buffered write in some cases Core: - remove COW fixup mechanism completely; detect and fix changes to pages outside of filesystem tracking, guaranteed since 5.8, grace period is over - remove 2K block size support, experimental to test subpage code on x86_64 but now it would block folio changes - tree-checker improvements of: - free-space cache and tree items - root reference and backref items - extent state exceptions in reloc tree - subpage mode updates: - code optimizations, simplify tracking bitmaps - re-enable readahead of compressed extent - extend bitmap size to cover huge folios - add tracepoints related to sync, tree-log and transactions - device stats item tracking unification, remove item if there are no stats recorded, also don't leave stale stats on replaced device - allow extent buffer pages to be allocated as movable, to help page migration - added checks for proper extent buffer release - btrfs.ko code size reduction due to transaction abort call simplifications - several struct size reductions - more auto free conversions - more verbose assertions" * tag 'for-7.2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (130 commits) btrfs: fix use-after-free after relocation failure with concurrent COW btrfs: move WARN_ON on unexpected error in __add_tree_block() btrfs: move locking into btrfs_get_reloc_bg_bytenr() btrfs: lzo: reject compressed segment that overflows the compressed input btrfs: retry faulting in the pages after a zero sized short direct write btrfs: fix incorrect buffered IO fallback for append direct writes btrfs: fix false IO failure after falling back to buffered write btrfs: use verbose assertions in backref.c btrfs: print a message when a missing device re-appears btrfs: do not trim a device which is not writeable btrfs: return real error after lookup failure in btrfs_ioctl_default_subvol() btrfs: use mapping shared locking for reading super block btrfs: use lockless read in nr_cached_objects shrinker callback btrfs: switch local indicator variables to bools btrfs: send: pass bool for pending_move and refs_processed parameters btrfs: use shifts for sectorsize and nodesize btrfs: fix deadlock cloning inline extent when using flushoncommit btrfs: allocate eb-attached btree pages as movable btrfs: add 32-bit compat ioctl for BTRFS_IOC_GET_SUBVOL_INFO btrfs: derive f_fsid from on-disk fsid and dev_t ...
Showing the changes to include/uapi/linux (1 of 58 files). Show all
Unified · Split
| @@ -1100,6 +1100,38 @@ enum btrfs_err_code { · 1099 unmodified lines | ||
| 1100 | 1100 | BTRFS_ERROR_DEV_RAID1C4_MIN_NOT_MET, |
| 1101 | 1101 | }; |
| 1102 | 1102 | |
| 1103 | +/* Flags for struct btrfs_ioctl_get_csums_entry::type. */ | |
| 1104 | +#define BTRFS_GET_CSUMS_HAS_CSUMS (1U << 0) | |
| 1105 | +#define BTRFS_GET_CSUMS_ZEROED (1U << 1) | |
| 1106 | +#define BTRFS_GET_CSUMS_NODATASUM (1U << 2) | |
| 1107 | +#define BTRFS_GET_CSUMS_COMPRESSED (1U << 3) | |
| 1108 | +#define BTRFS_GET_CSUMS_ENCRYPTED (1U << 4) | |
| 1109 | +#define BTRFS_GET_CSUMS_INLINE (1U << 5) | |
| 1110 | + | |
| 1111 | +struct btrfs_ioctl_get_csums_entry { | |
| 1112 | + /* File offset of this range. */ | |
| 1113 | + __u64 offset; | |
| 1114 | + /* Length in bytes. */ | |
| 1115 | + __u64 length; | |
| 1116 | + /* One of BTRFS_GET_CSUMS_* types. */ | |
| 1117 | + __u32 type; | |
| 1118 | + /* Padding, must be 0. */ | |
| 1119 | + __u32 reserved; | |
| 1120 | +}; | |
| 1121 | + | |
| 1122 | +struct btrfs_ioctl_get_csums_args { | |
| 1123 | + /* In/out: file offset in bytes. */ | |
| 1124 | + __u64 offset; | |
| 1125 | + /* In/out: range length in bytes. */ | |
| 1126 | + __u64 length; | |
| 1127 | + /* In/out: buffer capacity / bytes written. */ | |
| 1128 | + __u64 buf_size; | |
| 1129 | + /* In: flags, must be 0 for now. */ | |
| 1130 | + __u64 flags; | |
| 1131 | + /* Out: entries of type btrfs_ioctl_get_csums_entry + csum data */ | |
| 1132 | + __u8 buf[]; | |
| 1133 | +}; | |
| 1134 | + | |
| 1103 | 1135 | /* Flags for IOC_SHUTDOWN, must match XFS_FSOP_GOING_FLAGS_* flags. */ |
| 1104 | 1136 | #define BTRFS_SHUTDOWN_FLAGS_DEFAULT 0x0 |
| 1105 | 1137 | #define BTRFS_SHUTDOWN_FLAGS_LOGFLUSH 0x1 |
| @@ -1226,6 +1258,8 @@ enum btrfs_err_code { · 120 unmodified lines | ||
| 1226 | 1258 | struct btrfs_ioctl_encoded_io_args) |
| 1227 | 1259 | #define BTRFS_IOC_SUBVOL_SYNC_WAIT _IOW(BTRFS_IOCTL_MAGIC, 65, \ |
| 1228 | 1260 | struct btrfs_ioctl_subvol_wait) |
| 1261 | +#define BTRFS_IOC_GET_CSUMS _IOWR(BTRFS_IOCTL_MAGIC, 66, \ | |
| 1262 | + struct btrfs_ioctl_get_csums_args) | |
| 1229 | 1263 | |
| 1230 | 1264 | /* Shutdown ioctl should follow XFS's interfaces, thus not using btrfs magic. */ |
| 1231 | 1265 | #define BTRFS_IOC_SHUTDOWN _IOR('X', 125, __u32) |