]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: store an agbno in struct xfs_imap
authorChristoph Hellwig <hch@lst.de>
Mon, 1 Jun 2026 12:43:50 +0000 (14:43 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 9 Jun 2026 07:14:42 +0000 (09:14 +0200)
commit9b64ca202f364a6bf8e19bdd20953bc2d776c67f
tree56c4643286203681d4dd1120d5dd4a918f9621b9
parentcaffb4252cf15c5c3bbe7ff1f48f24f4015edb9c
xfs: store an agbno in struct xfs_imap

The xfs_imap structure is embedded into the xfs_inode, which means the
size of it directly affects the inode size.  Replacing the xfs_daddr_t
with an xfs_agbno_t and taking the AG information from other easily
available sources allows us to shrink the structure including the
typical padding from 16 bytes to 8 bytes.

As a side-effect the debugging check in xfs_imap() naturally now
converges to a stricter variant that checks that the cluster is located
inside a single AG, and not just inside the entire device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_ialloc.c
fs/xfs/libxfs/xfs_inode_buf.c
fs/xfs/libxfs/xfs_inode_buf.h
fs/xfs/scrub/ialloc.c
fs/xfs/scrub/ialloc_repair.c
fs/xfs/scrub/inode_repair.c
fs/xfs/scrub/trace.h
fs/xfs/xfs_icache.c
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_itable.c
fs/xfs/xfs_iunlink_item.c