Skip to content

Commit 60335cc

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
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>
1 parent 21e308e commit 60335cc

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

fs/xfs/xfs_buf.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,18 +2001,6 @@ xfs_setsize_buftarg(
20012001
return 0;
20022002
}
20032003

2004-
/*
2005-
* When allocating the initial buffer target we have not yet
2006-
* read in the superblock, so don't know what sized sectors
2007-
* are being used at this early stage. Play safe.
2008-
*/
2009-
STATIC int
2010-
xfs_setsize_buftarg_early(
2011-
struct xfs_buftarg *btp)
2012-
{
2013-
return xfs_setsize_buftarg(btp, bdev_logical_block_size(btp->bt_bdev));
2014-
}
2015-
20162004
struct xfs_buftarg *
20172005
xfs_alloc_buftarg(
20182006
struct xfs_mount *mp,
@@ -2033,16 +2021,20 @@ xfs_alloc_buftarg(
20332021
btp->bt_daxdev = fs_dax_get_by_bdev(btp->bt_bdev, &btp->bt_dax_part_off,
20342022
mp, ops);
20352023

2024+
/*
2025+
* When allocating the buftargs we have not yet read the super block and
2026+
* thus don't know the file system sector size yet.
2027+
*/
2028+
if (xfs_setsize_buftarg(btp, bdev_logical_block_size(btp->bt_bdev)))
2029+
goto error_free;
2030+
20362031
/*
20372032
* Buffer IO error rate limiting. Limit it to no more than 10 messages
20382033
* per 30 seconds so as to not spam logs too much on repeated errors.
20392034
*/
20402035
ratelimit_state_init(&btp->bt_ioerror_rl, 30 * HZ,
20412036
DEFAULT_RATELIMIT_BURST);
20422037

2043-
if (xfs_setsize_buftarg_early(btp))
2044-
goto error_free;
2045-
20462038
if (list_lru_init(&btp->bt_lru))
20472039
goto error_free;
20482040

0 commit comments

Comments
 (0)