]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: remove the xfs_btree_get_buf[ls] functions
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 14 Mar 2020 03:01:00 +0000 (23:01 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Sat, 14 Mar 2020 03:01:00 +0000 (23:01 -0400)
Source kernel commit: ee647f85cb81b09bbfa2886954828ed03fa3ec38

Remove the xfs_btree_get_bufs and xfs_btree_get_bufl functions, since
they're pretty trivial oneliners.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_alloc.c
libxfs/xfs_bmap.c
libxfs/xfs_btree.c
libxfs/xfs_btree.h

index 1bf813e36dd17f656f4fdb21e543c3720bbb2a48..be1bf736150b281fa23b1dae89417b5ac28cbd1e 100644 (file)
@@ -1066,11 +1066,11 @@ xfs_alloc_ag_vextent_small(
        if (args->datatype & XFS_ALLOC_USERDATA) {
                struct xfs_buf  *bp;
 
-               bp = xfs_btree_get_bufs(args->mp, args->tp, args->agno, fbno);
-               if (XFS_IS_CORRUPT(args->mp, !bp)) {
-                       error = -EFSCORRUPTED;
+               error = xfs_trans_get_buf(args->tp, args->mp->m_ddev_targp,
+                               XFS_AGB_TO_DADDR(args->mp, args->agno, fbno),
+                               args->mp->m_bsize, 0, &bp);
+               if (error)
                        goto error;
-               }
                xfs_trans_binval(args->tp, bp);
        }
        *fbnop = args->agbno = fbno;
@@ -2343,9 +2343,11 @@ xfs_free_agfl_block(
        if (error)
                return error;
 
-       bp = xfs_btree_get_bufs(tp->t_mountp, tp, agno, agbno);
-       if (XFS_IS_CORRUPT(tp->t_mountp, !bp))
-               return -EFSCORRUPTED;
+       error = xfs_trans_get_buf(tp, tp->t_mountp->m_ddev_targp,
+                       XFS_AGB_TO_DADDR(tp->t_mountp, agno, agbno),
+                       tp->t_mountp->m_bsize, 0, &bp);
+       if (error)
+               return error;
        xfs_trans_binval(tp, bp);
 
        return 0;
index 5efa2f0cfff1b69168f94f139e85ebca666b9648..f917a6ebf17923b7008376cf891bad98a3947777 100644 (file)
@@ -723,11 +723,11 @@ xfs_bmap_extents_to_btree(
        cur->bc_private.b.allocated++;
        ip->i_d.di_nblocks++;
        xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, 1L);
-       abp = xfs_btree_get_bufl(mp, tp, args.fsbno);
-       if (XFS_IS_CORRUPT(mp, !abp)) {
-               error = -EFSCORRUPTED;
+       error = xfs_trans_get_buf(tp, mp->m_ddev_targp,
+                       XFS_FSB_TO_DADDR(mp, args.fsbno),
+                       mp->m_bsize, 0, &abp);
+       if (error)
                goto out_unreserve_dquot;
-       }
 
        /*
         * Fill in the child block.
@@ -871,7 +871,11 @@ xfs_bmap_local_to_extents(
        ASSERT(args.fsbno != NULLFSBLOCK);
        ASSERT(args.len == 1);
        tp->t_firstblock = args.fsbno;
-       bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno);
+       error = xfs_trans_get_buf(tp, args.mp->m_ddev_targp,
+                       XFS_FSB_TO_DADDR(args.mp, args.fsbno),
+                       args.mp->m_bsize, 0, &bp);
+       if (error)
+               goto done;
 
        /*
         * Initialize the block, copy the data and log the remote buffer.
index aeaa9623500d481cbdd4014e0ea2e60b80d917d3..57862dfad8ab1eec3587485308d9c8e17908058c 100644 (file)
@@ -675,52 +675,6 @@ xfs_btree_get_block(
        return XFS_BUF_TO_BLOCK(*bpp);
 }
 
-/*
- * Get a buffer for the block, return it with no data read.
- * Long-form addressing.
- */
-xfs_buf_t *                            /* buffer for fsbno */
-xfs_btree_get_bufl(
-       xfs_mount_t     *mp,            /* file system mount point */
-       xfs_trans_t     *tp,            /* transaction pointer */
-       xfs_fsblock_t   fsbno)          /* file system block number */
-{
-       struct xfs_buf          *bp;
-       xfs_daddr_t             d;              /* real disk block address */
-       int                     error;
-
-       ASSERT(fsbno != NULLFSBLOCK);
-       d = XFS_FSB_TO_DADDR(mp, fsbno);
-       error = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, mp->m_bsize, 0, &bp);
-       if (error)
-               return NULL;
-       return bp;
-}
-
-/*
- * Get a buffer for the block, return it with no data read.
- * Short-form addressing.
- */
-xfs_buf_t *                            /* buffer for agno/agbno */
-xfs_btree_get_bufs(
-       xfs_mount_t     *mp,            /* file system mount point */
-       xfs_trans_t     *tp,            /* transaction pointer */
-       xfs_agnumber_t  agno,           /* allocation group number */
-       xfs_agblock_t   agbno)          /* allocation group block number */
-{
-       struct xfs_buf          *bp;
-       xfs_daddr_t             d;              /* real disk block address */
-       int                     error;
-
-       ASSERT(agno != NULLAGNUMBER);
-       ASSERT(agbno != NULLAGBLOCK);
-       d = XFS_AGB_TO_DADDR(mp, agno, agbno);
-       error = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, mp->m_bsize, 0, &bp);
-       if (error)
-               return NULL;
-       return bp;
-}
-
 /*
  * Change the cursor to point to the first record at the given level.
  * Other levels are unaffected.
index 2e727f23cdc475f6404124c593ee75d8c5caa445..8bead7476237f6f7032f657103089cac28eb993c 100644 (file)
@@ -296,27 +296,6 @@ xfs_btree_dup_cursor(
        xfs_btree_cur_t         *cur,   /* input cursor */
        xfs_btree_cur_t         **ncur);/* output cursor */
 
-/*
- * Get a buffer for the block, return it with no data read.
- * Long-form addressing.
- */
-struct xfs_buf *                               /* buffer for fsbno */
-xfs_btree_get_bufl(
-       struct xfs_mount        *mp,    /* file system mount point */
-       struct xfs_trans        *tp,    /* transaction pointer */
-       xfs_fsblock_t           fsbno); /* file system block number */
-
-/*
- * Get a buffer for the block, return it with no data read.
- * Short-form addressing.
- */
-struct xfs_buf *                               /* buffer for agno/agbno */
-xfs_btree_get_bufs(
-       struct xfs_mount        *mp,    /* file system mount point */
-       struct xfs_trans        *tp,    /* transaction pointer */
-       xfs_agnumber_t          agno,   /* allocation group number */
-       xfs_agblock_t           agbno); /* allocation group block number */
-
 /*
  * Compute first and last byte offsets for the fields given.
  * Interprets the offsets table, which contains struct field offsets.