Skip to content

Commit 1c51ac0

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: move setting bt_logical_sectorsize out of xfs_setsize_buftarg
bt_logical_sectorsize and the associated mask is set based on the constant logical block size in the block_device structure and thus doesn't need to be updated in xfs_setsize_buftarg. Move it into xfs_alloc_buftarg so that it is only done once per buftarg. 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 60335cc commit 1c51ac0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/xfs/xfs_buf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,10 +1994,6 @@ xfs_setsize_buftarg(
19941994
return -EINVAL;
19951995
}
19961996

1997-
/* Set up device logical sector size mask */
1998-
btp->bt_logical_sectorsize = bdev_logical_block_size(btp->bt_bdev);
1999-
btp->bt_logical_sectormask = bdev_logical_block_size(btp->bt_bdev) - 1;
2000-
20011997
return 0;
20021998
}
20031999

@@ -2028,6 +2024,10 @@ xfs_alloc_buftarg(
20282024
if (xfs_setsize_buftarg(btp, bdev_logical_block_size(btp->bt_bdev)))
20292025
goto error_free;
20302026

2027+
/* Set up device logical sector size mask */
2028+
btp->bt_logical_sectorsize = bdev_logical_block_size(btp->bt_bdev);
2029+
btp->bt_logical_sectormask = bdev_logical_block_size(btp->bt_bdev) - 1;
2030+
20312031
/*
20322032
* Buffer IO error rate limiting. Limit it to no more than 10 messages
20332033
* per 30 seconds so as to not spam logs too much on repeated errors.

0 commit comments

Comments
 (0)