Skip to content

Commit 5eec8fa

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: remove xfs_btree_reada_bufl
xfs_btree_reada_bufl just wraps xfs_btree_readahead and a fsblock to daddr conversion. Just open code it's two callsites in the only caller. 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 79e7230 commit 5eec8fa

2 files changed

Lines changed: 6 additions & 35 deletions

File tree

fs/xfs/libxfs/xfs_btree.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -889,25 +889,6 @@ xfs_btree_read_bufl(
889889
return 0;
890890
}
891891

892-
/*
893-
* Read-ahead the block, don't wait for it, don't return a buffer.
894-
* Long-form addressing.
895-
*/
896-
/* ARGSUSED */
897-
void
898-
xfs_btree_reada_bufl(
899-
struct xfs_mount *mp, /* file system mount point */
900-
xfs_fsblock_t fsbno, /* file system block number */
901-
xfs_extlen_t count, /* count of filesystem blocks */
902-
const struct xfs_buf_ops *ops)
903-
{
904-
xfs_daddr_t d;
905-
906-
ASSERT(fsbno != NULLFSBLOCK);
907-
d = XFS_FSB_TO_DADDR(mp, fsbno);
908-
xfs_buf_readahead(mp->m_ddev_targp, d, mp->m_bsize * count, ops);
909-
}
910-
911892
/*
912893
* Read-ahead the block, don't wait for it, don't return a buffer.
913894
* Short-form addressing.
@@ -935,19 +916,20 @@ xfs_btree_readahead_fsblock(
935916
int lr,
936917
struct xfs_btree_block *block)
937918
{
938-
int rval = 0;
919+
struct xfs_mount *mp = cur->bc_mp;
939920
xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib);
940921
xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib);
922+
int rval = 0;
941923

942924
if ((lr & XFS_BTCUR_LEFTRA) && left != NULLFSBLOCK) {
943-
xfs_btree_reada_bufl(cur->bc_mp, left, 1,
944-
cur->bc_ops->buf_ops);
925+
xfs_buf_readahead(mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, left),
926+
mp->m_bsize, cur->bc_ops->buf_ops);
945927
rval++;
946928
}
947929

948930
if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLFSBLOCK) {
949-
xfs_btree_reada_bufl(cur->bc_mp, right, 1,
950-
cur->bc_ops->buf_ops);
931+
xfs_buf_readahead(mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, right),
932+
mp->m_bsize, cur->bc_ops->buf_ops);
951933
rval++;
952934
}
953935

fs/xfs/libxfs/xfs_btree.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -391,17 +391,6 @@ xfs_btree_read_bufl(
391391
int refval, /* ref count value for buffer */
392392
const struct xfs_buf_ops *ops);
393393

394-
/*
395-
* Read-ahead the block, don't wait for it, don't return a buffer.
396-
* Long-form addressing.
397-
*/
398-
void /* error */
399-
xfs_btree_reada_bufl(
400-
struct xfs_mount *mp, /* file system mount point */
401-
xfs_fsblock_t fsbno, /* file system block number */
402-
xfs_extlen_t count, /* count of filesystem blocks */
403-
const struct xfs_buf_ops *ops);
404-
405394
/*
406395
* Read-ahead the block, don't wait for it, don't return a buffer.
407396
* Short-form addressing.

0 commit comments

Comments
 (0)