aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 35561a511b57..e5f40c6460b2 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -856,33 +856,23 @@ xfs_rtbuf_get(
856 xfs_buf_t **bpp) /* output: buffer for the block */ 856 xfs_buf_t **bpp) /* output: buffer for the block */
857{ 857{
858 xfs_buf_t *bp; /* block buffer, result */ 858 xfs_buf_t *bp; /* block buffer, result */
859 xfs_daddr_t d; /* disk addr of block */
860 int error; /* error value */
861 xfs_fsblock_t fsb; /* fs block number for block */
862 xfs_inode_t *ip; /* bitmap or summary inode */ 859 xfs_inode_t *ip; /* bitmap or summary inode */
860 xfs_bmbt_irec_t map;
861 int nmap;
862 int error; /* error value */
863 863
864 ip = issum ? mp->m_rsumip : mp->m_rbmip; 864 ip = issum ? mp->m_rsumip : mp->m_rbmip;
865 /* 865
866 * Map from the file offset (block) and inode number to the 866 error = xfs_bmapi_read(ip, block, 1, &map, &nmap, XFS_DATA_FORK);
867 * file system block. 867 if (error)
868 */
869 error = xfs_bmapi_single(tp, ip, XFS_DATA_FORK, &fsb, block);
870 if (error) {
871 return error; 868 return error;
872 } 869
873 ASSERT(fsb != NULLFSBLOCK); 870 ASSERT(map.br_startblock != NULLFSBLOCK);
874 /* 871 error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
875 * Convert to disk address for buffer cache. 872 XFS_FSB_TO_DADDR(mp, map.br_startblock),
876 */
877 d = XFS_FSB_TO_DADDR(mp, fsb);
878 /*
879 * Read the buffer.
880 */
881 error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
882 mp->m_bsize, 0, &bp); 873 mp->m_bsize, 0, &bp);
883 if (error) { 874 if (error)
884 return error; 875 return error;
885 }
886 ASSERT(!xfs_buf_geterror(bp)); 876 ASSERT(!xfs_buf_geterror(bp));
887 *bpp = bp; 877 *bpp = bp;
888 return 0; 878 return 0;