Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>

+18 -79
+9 -7
fs/xfs/libxfs/xfs_alloc.c
··· 1070 1070 if (args->datatype & XFS_ALLOC_USERDATA) { 1071 1071 struct xfs_buf *bp; 1072 1072 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) 1076 1077 goto error; 1077 - } 1078 1078 xfs_trans_binval(args->tp, bp); 1079 1079 } 1080 1080 *fbnop = args->agbno = fbno; ··· 2347 2347 if (error) 2348 2348 return error; 2349 2349 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; 2353 2355 xfs_trans_binval(tp, bp); 2354 2356 2355 2357 return 0;
+9 -5
fs/xfs/libxfs/xfs_bmap.c
··· 730 730 cur->bc_private.b.allocated++; 731 731 ip->i_d.di_nblocks++; 732 732 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) 736 737 goto out_unreserve_dquot; 737 - } 738 738 739 739 /* 740 740 * Fill in the child block. ··· 878 878 ASSERT(args.fsbno != NULLFSBLOCK); 879 879 ASSERT(args.len == 1); 880 880 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; 882 886 883 887 /* 884 888 * Initialize the block, copy the data and log the remote buffer.
-46
fs/xfs/libxfs/xfs_btree.c
··· 679 679 } 680 680 681 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 - 727 - /* 728 682 * Change the cursor to point to the first record at the given level. 729 683 * Other levels are unaffected. 730 684 */
-21
fs/xfs/libxfs/xfs_btree.h
··· 297 297 xfs_btree_cur_t **ncur);/* output cursor */ 298 298 299 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 - 320 - /* 321 300 * Compute first and last byte offsets for the fields given. 322 301 * Interprets the offsets table, which contains struct field offsets. 323 302 */