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.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 35561a511b57..87323f1ded64 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -112,7 +112,7 @@ xfs_growfs_rt_alloc(
112 * Lock the inode. 112 * Lock the inode.
113 */ 113 */
114 xfs_ilock(ip, XFS_ILOCK_EXCL); 114 xfs_ilock(ip, XFS_ILOCK_EXCL);
115 xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); 115 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
116 116
117 xfs_bmap_init(&flist, &firstblock); 117 xfs_bmap_init(&flist, &firstblock);
118 /* 118 /*
@@ -120,9 +120,9 @@ xfs_growfs_rt_alloc(
120 */ 120 */
121 nmap = 1; 121 nmap = 1;
122 cancelflags |= XFS_TRANS_ABORT; 122 cancelflags |= XFS_TRANS_ABORT;
123 error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks, 123 error = xfs_bmapi_write(tp, ip, oblocks, nblocks - oblocks,
124 XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock, 124 XFS_BMAPI_METADATA, &firstblock,
125 resblks, &map, &nmap, &flist); 125 resblks, &map, &nmap, &flist);
126 if (!error && nmap < 1) 126 if (!error && nmap < 1)
127 error = XFS_ERROR(ENOSPC); 127 error = XFS_ERROR(ENOSPC);
128 if (error) 128 if (error)
@@ -155,7 +155,7 @@ xfs_growfs_rt_alloc(
155 * Lock the bitmap inode. 155 * Lock the bitmap inode.
156 */ 156 */
157 xfs_ilock(ip, XFS_ILOCK_EXCL); 157 xfs_ilock(ip, XFS_ILOCK_EXCL);
158 xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); 158 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
159 /* 159 /*
160 * Get a buffer for the block. 160 * Get a buffer for the block.
161 */ 161 */
@@ -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;
@@ -1970,7 +1960,7 @@ xfs_growfs_rt(
1970 * Lock out other callers by grabbing the bitmap inode lock. 1960 * Lock out other callers by grabbing the bitmap inode lock.
1971 */ 1961 */
1972 xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); 1962 xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL);
1973 xfs_trans_ijoin_ref(tp, mp->m_rbmip, XFS_ILOCK_EXCL); 1963 xfs_trans_ijoin(tp, mp->m_rbmip, XFS_ILOCK_EXCL);
1974 /* 1964 /*
1975 * Update the bitmap inode's size. 1965 * Update the bitmap inode's size.
1976 */ 1966 */
@@ -1982,7 +1972,7 @@ xfs_growfs_rt(
1982 * Get the summary inode into the transaction. 1972 * Get the summary inode into the transaction.
1983 */ 1973 */
1984 xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL); 1974 xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL);
1985 xfs_trans_ijoin_ref(tp, mp->m_rsumip, XFS_ILOCK_EXCL); 1975 xfs_trans_ijoin(tp, mp->m_rsumip, XFS_ILOCK_EXCL);
1986 /* 1976 /*
1987 * Update the summary inode's size. 1977 * Update the summary inode's size.
1988 */ 1978 */
@@ -2153,7 +2143,7 @@ xfs_rtfree_extent(
2153 * Synchronize by locking the bitmap inode. 2143 * Synchronize by locking the bitmap inode.
2154 */ 2144 */
2155 xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); 2145 xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL);
2156 xfs_trans_ijoin_ref(tp, mp->m_rbmip, XFS_ILOCK_EXCL); 2146 xfs_trans_ijoin(tp, mp->m_rbmip, XFS_ILOCK_EXCL);
2157 2147
2158#if defined(__KERNEL__) && defined(DEBUG) 2148#if defined(__KERNEL__) && defined(DEBUG)
2159 /* 2149 /*