diff options
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r-- | fs/xfs/xfs_rtalloc.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index a2d32ce335aa..12a191385310 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
@@ -25,17 +25,10 @@ | |||
25 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
26 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
27 | #include "xfs_dir2.h" | 27 | #include "xfs_dir2.h" |
28 | #include "xfs_dmapi.h" | ||
29 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
30 | #include "xfs_bmap_btree.h" | 29 | #include "xfs_bmap_btree.h" |
31 | #include "xfs_alloc_btree.h" | ||
32 | #include "xfs_ialloc_btree.h" | ||
33 | #include "xfs_dir2_sf.h" | ||
34 | #include "xfs_attr_sf.h" | ||
35 | #include "xfs_dinode.h" | 30 | #include "xfs_dinode.h" |
36 | #include "xfs_inode.h" | 31 | #include "xfs_inode.h" |
37 | #include "xfs_btree.h" | ||
38 | #include "xfs_ialloc.h" | ||
39 | #include "xfs_alloc.h" | 32 | #include "xfs_alloc.h" |
40 | #include "xfs_bmap.h" | 33 | #include "xfs_bmap.h" |
41 | #include "xfs_rtalloc.h" | 34 | #include "xfs_rtalloc.h" |
@@ -46,6 +39,7 @@ | |||
46 | #include "xfs_trans_space.h" | 39 | #include "xfs_trans_space.h" |
47 | #include "xfs_utils.h" | 40 | #include "xfs_utils.h" |
48 | #include "xfs_trace.h" | 41 | #include "xfs_trace.h" |
42 | #include "xfs_buf.h" | ||
49 | 43 | ||
50 | 44 | ||
51 | /* | 45 | /* |
@@ -129,7 +123,7 @@ xfs_growfs_rt_alloc( | |||
129 | cancelflags |= XFS_TRANS_ABORT; | 123 | cancelflags |= XFS_TRANS_ABORT; |
130 | error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks, | 124 | error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks, |
131 | XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock, | 125 | XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock, |
132 | resblks, &map, &nmap, &flist, NULL); | 126 | resblks, &map, &nmap, &flist); |
133 | if (!error && nmap < 1) | 127 | if (!error && nmap < 1) |
134 | error = XFS_ERROR(ENOSPC); | 128 | error = XFS_ERROR(ENOSPC); |
135 | if (error) | 129 | if (error) |
@@ -1890,13 +1884,13 @@ xfs_growfs_rt( | |||
1890 | /* | 1884 | /* |
1891 | * Read in the last block of the device, make sure it exists. | 1885 | * Read in the last block of the device, make sure it exists. |
1892 | */ | 1886 | */ |
1893 | error = xfs_read_buf(mp, mp->m_rtdev_targp, | 1887 | bp = xfs_buf_read_uncached(mp, mp->m_rtdev_targp, |
1894 | XFS_FSB_TO_BB(mp, nrblocks - 1), | 1888 | XFS_FSB_TO_BB(mp, nrblocks - 1), |
1895 | XFS_FSB_TO_BB(mp, 1), 0, &bp); | 1889 | XFS_FSB_TO_B(mp, 1), 0); |
1896 | if (error) | 1890 | if (!bp) |
1897 | return error; | 1891 | return EIO; |
1898 | ASSERT(bp); | ||
1899 | xfs_buf_relse(bp); | 1892 | xfs_buf_relse(bp); |
1893 | |||
1900 | /* | 1894 | /* |
1901 | * Calculate new parameters. These are the final values to be reached. | 1895 | * Calculate new parameters. These are the final values to be reached. |
1902 | */ | 1896 | */ |
@@ -2222,7 +2216,6 @@ xfs_rtmount_init( | |||
2222 | { | 2216 | { |
2223 | xfs_buf_t *bp; /* buffer for last block of subvolume */ | 2217 | xfs_buf_t *bp; /* buffer for last block of subvolume */ |
2224 | xfs_daddr_t d; /* address of last block of subvolume */ | 2218 | xfs_daddr_t d; /* address of last block of subvolume */ |
2225 | int error; /* error return value */ | ||
2226 | xfs_sb_t *sbp; /* filesystem superblock copy in mount */ | 2219 | xfs_sb_t *sbp; /* filesystem superblock copy in mount */ |
2227 | 2220 | ||
2228 | sbp = &mp->m_sb; | 2221 | sbp = &mp->m_sb; |
@@ -2249,15 +2242,12 @@ xfs_rtmount_init( | |||
2249 | (unsigned long long) mp->m_sb.sb_rblocks); | 2242 | (unsigned long long) mp->m_sb.sb_rblocks); |
2250 | return XFS_ERROR(EFBIG); | 2243 | return XFS_ERROR(EFBIG); |
2251 | } | 2244 | } |
2252 | error = xfs_read_buf(mp, mp->m_rtdev_targp, | 2245 | bp = xfs_buf_read_uncached(mp, mp->m_rtdev_targp, |
2253 | d - XFS_FSB_TO_BB(mp, 1), | 2246 | d - XFS_FSB_TO_BB(mp, 1), |
2254 | XFS_FSB_TO_BB(mp, 1), 0, &bp); | 2247 | XFS_FSB_TO_B(mp, 1), 0); |
2255 | if (error) { | 2248 | if (!bp) { |
2256 | cmn_err(CE_WARN, | 2249 | cmn_err(CE_WARN, "XFS: realtime device size check failed"); |
2257 | "XFS: realtime mount -- xfs_read_buf failed, returned %d", error); | 2250 | return EIO; |
2258 | if (error == ENOSPC) | ||
2259 | return XFS_ERROR(EFBIG); | ||
2260 | return error; | ||
2261 | } | 2251 | } |
2262 | xfs_buf_relse(bp); | 2252 | xfs_buf_relse(bp); |
2263 | return 0; | 2253 | return 0; |