summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-02-22 12:42:45 -0800
committerDarrick J. Wong <djwong@kernel.org>2024-02-22 12:42:45 -0800
commit60335cc0fb5c7a8adfc84ba7dc976a00b6133499 (patch)
treefce02c0c814c7eb9b4a245021611d4786df7173e /fs/xfs
parent21e308e6485542a9795144aa6a39a1edc83a0d31 (diff)
downloadlinux-60335cc0fb5c7a8adfc84ba7dc976a00b6133499.tar.gz
linux-60335cc0fb5c7a8adfc84ba7dc976a00b6133499.tar.bz2
linux-60335cc0fb5c7a8adfc84ba7dc976a00b6133499.zip
xfs: remove xfs_setsize_buftarg_early
Open code the logic in the only caller, and improve the comment explaining what is being done here. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_buf.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 1777d834fd54..e83cadea239f 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -2001,18 +2001,6 @@ xfs_setsize_buftarg(
return 0;
}
-/*
- * When allocating the initial buffer target we have not yet
- * read in the superblock, so don't know what sized sectors
- * are being used at this early stage. Play safe.
- */
-STATIC int
-xfs_setsize_buftarg_early(
- struct xfs_buftarg *btp)
-{
- return xfs_setsize_buftarg(btp, bdev_logical_block_size(btp->bt_bdev));
-}
-
struct xfs_buftarg *
xfs_alloc_buftarg(
struct xfs_mount *mp,
@@ -2034,15 +2022,19 @@ xfs_alloc_buftarg(
mp, ops);
/*
+ * When allocating the buftargs we have not yet read the super block and
+ * thus don't know the file system sector size yet.
+ */
+ if (xfs_setsize_buftarg(btp, bdev_logical_block_size(btp->bt_bdev)))
+ goto error_free;
+
+ /*
* Buffer IO error rate limiting. Limit it to no more than 10 messages
* per 30 seconds so as to not spam logs too much on repeated errors.
*/
ratelimit_state_init(&btp->bt_ioerror_rl, 30 * HZ,
DEFAULT_RATELIMIT_BURST);
- if (xfs_setsize_buftarg_early(btp))
- goto error_free;
-
if (list_lru_init(&btp->bt_lru))
goto error_free;