]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: remove xfs_btree_reada_bufs
authorChristoph Hellwig <hch@lst.de>
Mon, 22 Apr 2024 17:01:09 +0000 (10:01 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:40 +0000 (11:37 -0700)
Source kernel commit: 6324b00c9ecb8d11a157d2a4bc3e5a495534bdf1

xfs_btree_reada_bufl just wraps xfs_btree_readahead and a agblock
to daddr conversion.  Just open code it's three callsites in the
two callers (One of which isn't even btree related).

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>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/xfs_btree.c
libxfs/xfs_btree.h

index 2bef2f3e2bb0885931c46aaf61e2975f7451e9f4..7168a575359aad887894479c653b42ad458e3515 100644 (file)
@@ -886,27 +886,6 @@ xfs_btree_read_bufl(
        return 0;
 }
 
-/*
- * Read-ahead the block, don't wait for it, don't return a buffer.
- * Short-form addressing.
- */
-/* ARGSUSED */
-void
-xfs_btree_reada_bufs(
-       struct xfs_mount        *mp,            /* file system mount point */
-       xfs_agnumber_t          agno,           /* allocation group number */
-       xfs_agblock_t           agbno,          /* allocation group block number */
-       xfs_extlen_t            count,          /* count of filesystem blocks */
-       const struct xfs_buf_ops *ops)
-{
-       xfs_daddr_t             d;
-
-       ASSERT(agno != NULLAGNUMBER);
-       ASSERT(agbno != NULLAGBLOCK);
-       d = XFS_AGB_TO_DADDR(mp, agno, agbno);
-       xfs_buf_readahead(mp->m_ddev_targp, d, mp->m_bsize * count, ops);
-}
-
 STATIC int
 xfs_btree_readahead_fsblock(
        struct xfs_btree_cur    *cur,
@@ -937,22 +916,25 @@ STATIC int
 xfs_btree_readahead_agblock(
        struct xfs_btree_cur    *cur,
        int                     lr,
-       struct xfs_btree_block *block)
+       struct xfs_btree_block  *block)
 {
-       int                     rval = 0;
+       struct xfs_mount        *mp = cur->bc_mp;
+       xfs_agnumber_t          agno = cur->bc_ag.pag->pag_agno;
        xfs_agblock_t           left = be32_to_cpu(block->bb_u.s.bb_leftsib);
        xfs_agblock_t           right = be32_to_cpu(block->bb_u.s.bb_rightsib);
-
+       int                     rval = 0;
 
        if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) {
-               xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.pag->pag_agno,
-                                    left, 1, cur->bc_ops->buf_ops);
+               xfs_buf_readahead(mp->m_ddev_targp,
+                               XFS_AGB_TO_DADDR(mp, agno, left),
+                               mp->m_bsize, cur->bc_ops->buf_ops);
                rval++;
        }
 
        if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) {
-               xfs_btree_reada_bufs(cur->bc_mp, cur->bc_ag.pag->pag_agno,
-                                    right, 1, cur->bc_ops->buf_ops);
+               xfs_buf_readahead(mp->m_ddev_targp,
+                               XFS_AGB_TO_DADDR(mp, agno, right),
+                               mp->m_bsize, cur->bc_ops->buf_ops);
                rval++;
        }
 
index 001ff9392804f564e423b8520c3bc491b61ad22b..c48b4fdebafa67ca911e4b7417d2ca63dfaba576 100644 (file)
@@ -391,18 +391,6 @@ xfs_btree_read_bufl(
        int                     refval, /* ref count value for buffer */
        const struct xfs_buf_ops *ops);
 
-/*
- * Read-ahead the block, don't wait for it, don't return a buffer.
- * Short-form addressing.
- */
-void                                   /* error */
-xfs_btree_reada_bufs(
-       struct xfs_mount        *mp,    /* file system mount point */
-       xfs_agnumber_t          agno,   /* allocation group number */
-       xfs_agblock_t           agbno,  /* allocation group block number */
-       xfs_extlen_t            count,  /* count of filesystem blocks */
-       const struct xfs_buf_ops *ops);
-
 /*
  * Initialise a new btree block header
  */