Skip to content

Commit ee647f8

Browse files
committed
xfs: remove the xfs_btree_get_buf[ls] functions
Remove the xfs_btree_get_bufs and xfs_btree_get_bufl functions, since they're pretty trivial oneliners. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
1 parent ce92464 commit ee647f8

File tree

4 files changed

+18
-79
lines changed

4 files changed

+18
-79
lines changed

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,11 +1070,11 @@ xfs_alloc_ag_vextent_small(
10701070
if (args->datatype & XFS_ALLOC_USERDATA) {
10711071
struct xfs_buf *bp;
10721072

1073-
bp = xfs_btree_get_bufs(args->mp, args->tp, args->agno, fbno);
1074-
if (XFS_IS_CORRUPT(args->mp, !bp)) {
1075-
error = -EFSCORRUPTED;
1073+
error = xfs_trans_get_buf(args->tp, args->mp->m_ddev_targp,
1074+
XFS_AGB_TO_DADDR(args->mp, args->agno, fbno),
1075+
args->mp->m_bsize, 0, &bp);
1076+
if (error)
10761077
goto error;
1077-
}
10781078
xfs_trans_binval(args->tp, bp);
10791079
}
10801080
*fbnop = args->agbno = fbno;
@@ -2347,9 +2347,11 @@ xfs_free_agfl_block(
23472347
if (error)
23482348
return error;
23492349

2350-
bp = xfs_btree_get_bufs(tp->t_mountp, tp, agno, agbno);
2351-
if (XFS_IS_CORRUPT(tp->t_mountp, !bp))
2352-
return -EFSCORRUPTED;
2350+
error = xfs_trans_get_buf(tp, tp->t_mountp->m_ddev_targp,
2351+
XFS_AGB_TO_DADDR(tp->t_mountp, agno, agbno),
2352+
tp->t_mountp->m_bsize, 0, &bp);
2353+
if (error)
2354+
return error;
23532355
xfs_trans_binval(tp, bp);
23542356

23552357
return 0;

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,11 @@ xfs_bmap_extents_to_btree(
730730
cur->bc_private.b.allocated++;
731731
ip->i_d.di_nblocks++;
732732
xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, 1L);
733-
abp = xfs_btree_get_bufl(mp, tp, args.fsbno);
734-
if (XFS_IS_CORRUPT(mp, !abp)) {
735-
error = -EFSCORRUPTED;
733+
error = xfs_trans_get_buf(tp, mp->m_ddev_targp,
734+
XFS_FSB_TO_DADDR(mp, args.fsbno),
735+
mp->m_bsize, 0, &abp);
736+
if (error)
736737
goto out_unreserve_dquot;
737-
}
738738

739739
/*
740740
* Fill in the child block.
@@ -878,7 +878,11 @@ xfs_bmap_local_to_extents(
878878
ASSERT(args.fsbno != NULLFSBLOCK);
879879
ASSERT(args.len == 1);
880880
tp->t_firstblock = args.fsbno;
881-
bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno);
881+
error = xfs_trans_get_buf(tp, args.mp->m_ddev_targp,
882+
XFS_FSB_TO_DADDR(args.mp, args.fsbno),
883+
args.mp->m_bsize, 0, &bp);
884+
if (error)
885+
goto done;
882886

883887
/*
884888
* Initialize the block, copy the data and log the remote buffer.

fs/xfs/libxfs/xfs_btree.c

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -678,52 +678,6 @@ xfs_btree_get_block(
678678
return XFS_BUF_TO_BLOCK(*bpp);
679679
}
680680

681-
/*
682-
* Get a buffer for the block, return it with no data read.
683-
* Long-form addressing.
684-
*/
685-
xfs_buf_t * /* buffer for fsbno */
686-
xfs_btree_get_bufl(
687-
xfs_mount_t *mp, /* file system mount point */
688-
xfs_trans_t *tp, /* transaction pointer */
689-
xfs_fsblock_t fsbno) /* file system block number */
690-
{
691-
struct xfs_buf *bp;
692-
xfs_daddr_t d; /* real disk block address */
693-
int error;
694-
695-
ASSERT(fsbno != NULLFSBLOCK);
696-
d = XFS_FSB_TO_DADDR(mp, fsbno);
697-
error = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, mp->m_bsize, 0, &bp);
698-
if (error)
699-
return NULL;
700-
return bp;
701-
}
702-
703-
/*
704-
* Get a buffer for the block, return it with no data read.
705-
* Short-form addressing.
706-
*/
707-
xfs_buf_t * /* buffer for agno/agbno */
708-
xfs_btree_get_bufs(
709-
xfs_mount_t *mp, /* file system mount point */
710-
xfs_trans_t *tp, /* transaction pointer */
711-
xfs_agnumber_t agno, /* allocation group number */
712-
xfs_agblock_t agbno) /* allocation group block number */
713-
{
714-
struct xfs_buf *bp;
715-
xfs_daddr_t d; /* real disk block address */
716-
int error;
717-
718-
ASSERT(agno != NULLAGNUMBER);
719-
ASSERT(agbno != NULLAGBLOCK);
720-
d = XFS_AGB_TO_DADDR(mp, agno, agbno);
721-
error = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, mp->m_bsize, 0, &bp);
722-
if (error)
723-
return NULL;
724-
return bp;
725-
}
726-
727681
/*
728682
* Change the cursor to point to the first record at the given level.
729683
* Other levels are unaffected.

fs/xfs/libxfs/xfs_btree.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -296,27 +296,6 @@ xfs_btree_dup_cursor(
296296
xfs_btree_cur_t *cur, /* input cursor */
297297
xfs_btree_cur_t **ncur);/* output cursor */
298298

299-
/*
300-
* Get a buffer for the block, return it with no data read.
301-
* Long-form addressing.
302-
*/
303-
struct xfs_buf * /* buffer for fsbno */
304-
xfs_btree_get_bufl(
305-
struct xfs_mount *mp, /* file system mount point */
306-
struct xfs_trans *tp, /* transaction pointer */
307-
xfs_fsblock_t fsbno); /* file system block number */
308-
309-
/*
310-
* Get a buffer for the block, return it with no data read.
311-
* Short-form addressing.
312-
*/
313-
struct xfs_buf * /* buffer for agno/agbno */
314-
xfs_btree_get_bufs(
315-
struct xfs_mount *mp, /* file system mount point */
316-
struct xfs_trans *tp, /* transaction pointer */
317-
xfs_agnumber_t agno, /* allocation group number */
318-
xfs_agblock_t agbno); /* allocation group block number */
319-
320299
/*
321300
* Compute first and last byte offsets for the fields given.
322301
* Interprets the offsets table, which contains struct field offsets.

0 commit comments

Comments
 (0)