]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs: define the zoned on-disk format
authorChristoph Hellwig <hch@lst.de>
Tue, 8 Apr 2025 07:09:00 +0000 (09:09 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 8 Apr 2025 07:09:00 +0000 (09:09 +0200)
commitd7c0281fadd9e7ccbdd13a5e1bb62c04d5e9cb7d
treeeca20f6b6da6b66f6a3371932e4bb79e790b3282
parent5c477ab4b9abdf0eaa183c8870989ee65cfe0194
xfs: define the zoned on-disk format

Source kernel commit: 2167eaabe2fadde24cb8f1dafbec64da1d2ed2f5

Zone file systems reuse the basic RT group enabled XFS file system
structure to support a mode where each RT group is always written from
start to end and then reset for reuse (after moving out any remaining
data).  There are few minor but important changes, which are indicated
by a new incompat flag:

1) there are no bitmap and summary inodes, thus the
/rtgroups/{rgno}.{bitmap,summary} metadir files do not exist and the
sb_rbmblocks superblock field must be cleared to zero.

2) there is a new superblock field that specifies the start of an
internal RT section.  This allows supporting SMR HDDs that have random
writable space at the beginning which is used for the XFS data device
(which really is the metadata device for this configuration), directly
followed by a RT device on the same block device.  While something
similar could be achieved using dm-linear just having a single device
directly consumed by XFS makes handling the file systems a lot easier.

3) Another superblock field that tracks the amount of reserved space (or
overprovisioning) that is never used for user capacity, but allows GC
to run more smoothly.

4) an overlay of the cowextsize field for the rtrmap inode so that we
can persistently track the total amount of rtblocks currently used in
a RT group.  There is no data structure other than the rmap that
tracks used space in an RT group, and this counter is used to decide
when a RT group has been entirely emptied, and to select one that
is relatively empty if garbage collection needs to be performed.
While this counter could be tracked entirely in memory and rebuilt
from the rmap at mount time, that would lead to very long mount times
with the large number of RT groups implied by the number of hardware
zones especially on SMR hard drives with 256MB zone sizes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_format.h
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_util.c
libxfs/xfs_log_format.h
libxfs/xfs_ondisk.h
libxfs/xfs_rtbitmap.c
libxfs/xfs_rtgroup.c
libxfs/xfs_sb.c