]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: only call xfs_setsize_buftarg once per buffer target
authorDarrick J. Wong <djwong@kernel.org>
Wed, 7 May 2025 21:18:22 +0000 (14:18 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 7 May 2025 21:25:30 +0000 (14:25 -0700)
commit84270a1a30c964e51af3e489411b4e178c4f153e
tree89f8df790e4306463b394b958eff7cae38546ee1
parent5d894321c49e61379189b0ff605f316e39cbd1e9
xfs: only call xfs_setsize_buftarg once per buffer target

It's silly to call xfs_setsize_buftarg from xfs_alloc_buftarg with the
block device LBA size because we don't need to ask the block layer to
validate a geometry number that it provided us.  Instead, set the
preliminary bt_meta_sector* fields to the LBA size in preparation for
reading the primary super.

However, we still want to flush and invalidate the pagecache for all
three block devices before we start reading metadata from those devices,
so call sync_blockdev() per bdev in xfs_alloc_buftarg().

This will enable a subsequent patch to validate hw atomic write geometry
against the filesystem geometry.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
[jpg: call sync_blockdev() from xfs_alloc_buftarg()]
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_buf.c
fs/xfs/xfs_super.c