diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-01-09 02:38:23 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-01-09 02:38:23 -0500 |
commit | da733563be5a9da26fe81d9f007262d00b846e22 (patch) | |
tree | db28291df94a2043af2123911984c5c173da4e6f /fs/xfs/xfs_inode.c | |
parent | 6ccbcf2cb41131f8d56ef0723bf3f7c1f8486076 (diff) | |
parent | dab78d7924598ea4031663dd10db814e2e324928 (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 0239a7c7c886..c0237c602f11 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -190,12 +190,6 @@ xfs_imap_to_bp( | |||
190 | } | 190 | } |
191 | 191 | ||
192 | xfs_inobp_check(mp, bp); | 192 | xfs_inobp_check(mp, bp); |
193 | |||
194 | /* | ||
195 | * Mark the buffer as an inode buffer now that it looks good | ||
196 | */ | ||
197 | XFS_BUF_SET_VTYPE(bp, B_FS_INO); | ||
198 | |||
199 | *bpp = bp; | 193 | *bpp = bp; |
200 | return 0; | 194 | return 0; |
201 | } | 195 | } |
@@ -1152,7 +1146,7 @@ xfs_ialloc( | |||
1152 | /* | 1146 | /* |
1153 | * Log the new values stuffed into the inode. | 1147 | * Log the new values stuffed into the inode. |
1154 | */ | 1148 | */ |
1155 | xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); | 1149 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); |
1156 | xfs_trans_log_inode(tp, ip, flags); | 1150 | xfs_trans_log_inode(tp, ip, flags); |
1157 | 1151 | ||
1158 | /* now that we have an i_mode we can setup inode ops and unlock */ | 1152 | /* now that we have an i_mode we can setup inode ops and unlock */ |
@@ -1187,6 +1181,7 @@ xfs_isize_check( | |||
1187 | xfs_fileoff_t map_first; | 1181 | xfs_fileoff_t map_first; |
1188 | int nimaps; | 1182 | int nimaps; |
1189 | xfs_bmbt_irec_t imaps[2]; | 1183 | xfs_bmbt_irec_t imaps[2]; |
1184 | int error; | ||
1190 | 1185 | ||
1191 | if (!S_ISREG(ip->i_d.di_mode)) | 1186 | if (!S_ISREG(ip->i_d.di_mode)) |
1192 | return; | 1187 | return; |
@@ -1203,13 +1198,12 @@ xfs_isize_check( | |||
1203 | * The filesystem could be shutting down, so bmapi may return | 1198 | * The filesystem could be shutting down, so bmapi may return |
1204 | * an error. | 1199 | * an error. |
1205 | */ | 1200 | */ |
1206 | if (xfs_bmapi(NULL, ip, map_first, | 1201 | error = xfs_bmapi_read(ip, map_first, |
1207 | (XFS_B_TO_FSB(mp, | 1202 | (XFS_B_TO_FSB(mp, |
1208 | (xfs_ufsize_t)XFS_MAXIOFFSET(mp)) - | 1203 | (xfs_ufsize_t)XFS_MAXIOFFSET(mp)) - map_first), |
1209 | map_first), | 1204 | imaps, &nimaps, XFS_BMAPI_ENTIRE); |
1210 | XFS_BMAPI_ENTIRE, NULL, 0, imaps, &nimaps, | 1205 | if (error) |
1211 | NULL)) | 1206 | return; |
1212 | return; | ||
1213 | ASSERT(nimaps == 1); | 1207 | ASSERT(nimaps == 1); |
1214 | ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK); | 1208 | ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK); |
1215 | } | 1209 | } |
@@ -1297,7 +1291,7 @@ xfs_itruncate_extents( | |||
1297 | */ | 1291 | */ |
1298 | error = xfs_bmap_finish(&tp, &free_list, &committed); | 1292 | error = xfs_bmap_finish(&tp, &free_list, &committed); |
1299 | if (committed) | 1293 | if (committed) |
1300 | xfs_trans_ijoin(tp, ip); | 1294 | xfs_trans_ijoin(tp, ip, 0); |
1301 | if (error) | 1295 | if (error) |
1302 | goto out_bmap_cancel; | 1296 | goto out_bmap_cancel; |
1303 | 1297 | ||
@@ -1313,7 +1307,7 @@ xfs_itruncate_extents( | |||
1313 | error = xfs_trans_commit(tp, 0); | 1307 | error = xfs_trans_commit(tp, 0); |
1314 | tp = ntp; | 1308 | tp = ntp; |
1315 | 1309 | ||
1316 | xfs_trans_ijoin(tp, ip); | 1310 | xfs_trans_ijoin(tp, ip, 0); |
1317 | 1311 | ||
1318 | if (error) | 1312 | if (error) |
1319 | goto out; | 1313 | goto out; |
@@ -1644,7 +1638,7 @@ xfs_iunlink_remove( | |||
1644 | * inodes that are in memory - they all must be marked stale and attached to | 1638 | * inodes that are in memory - they all must be marked stale and attached to |
1645 | * the cluster buffer. | 1639 | * the cluster buffer. |
1646 | */ | 1640 | */ |
1647 | STATIC void | 1641 | STATIC int |
1648 | xfs_ifree_cluster( | 1642 | xfs_ifree_cluster( |
1649 | xfs_inode_t *free_ip, | 1643 | xfs_inode_t *free_ip, |
1650 | xfs_trans_t *tp, | 1644 | xfs_trans_t *tp, |
@@ -1690,6 +1684,8 @@ xfs_ifree_cluster( | |||
1690 | mp->m_bsize * blks_per_cluster, | 1684 | mp->m_bsize * blks_per_cluster, |
1691 | XBF_LOCK); | 1685 | XBF_LOCK); |
1692 | 1686 | ||
1687 | if (!bp) | ||
1688 | return ENOMEM; | ||
1693 | /* | 1689 | /* |
1694 | * Walk the inodes already attached to the buffer and mark them | 1690 | * Walk the inodes already attached to the buffer and mark them |
1695 | * stale. These will all have the flush locks held, so an | 1691 | * stale. These will all have the flush locks held, so an |
@@ -1799,6 +1795,7 @@ retry: | |||
1799 | } | 1795 | } |
1800 | 1796 | ||
1801 | xfs_perag_put(pag); | 1797 | xfs_perag_put(pag); |
1798 | return 0; | ||
1802 | } | 1799 | } |
1803 | 1800 | ||
1804 | /* | 1801 | /* |
@@ -1878,10 +1875,10 @@ xfs_ifree( | |||
1878 | dip->di_mode = 0; | 1875 | dip->di_mode = 0; |
1879 | 1876 | ||
1880 | if (delete) { | 1877 | if (delete) { |
1881 | xfs_ifree_cluster(ip, tp, first_ino); | 1878 | error = xfs_ifree_cluster(ip, tp, first_ino); |
1882 | } | 1879 | } |
1883 | 1880 | ||
1884 | return 0; | 1881 | return error; |
1885 | } | 1882 | } |
1886 | 1883 | ||
1887 | /* | 1884 | /* |
@@ -2472,11 +2469,11 @@ cluster_corrupt_out: | |||
2472 | */ | 2469 | */ |
2473 | if (bp->b_iodone) { | 2470 | if (bp->b_iodone) { |
2474 | XFS_BUF_UNDONE(bp); | 2471 | XFS_BUF_UNDONE(bp); |
2475 | XFS_BUF_STALE(bp); | 2472 | xfs_buf_stale(bp); |
2476 | xfs_buf_ioerror(bp, EIO); | 2473 | xfs_buf_ioerror(bp, EIO); |
2477 | xfs_buf_ioend(bp, 0); | 2474 | xfs_buf_ioend(bp, 0); |
2478 | } else { | 2475 | } else { |
2479 | XFS_BUF_STALE(bp); | 2476 | xfs_buf_stale(bp); |
2480 | xfs_buf_relse(bp); | 2477 | xfs_buf_relse(bp); |
2481 | } | 2478 | } |
2482 | } | 2479 | } |
@@ -2597,9 +2594,11 @@ xfs_iflush( | |||
2597 | goto cluster_corrupt_out; | 2594 | goto cluster_corrupt_out; |
2598 | 2595 | ||
2599 | if (flags & SYNC_WAIT) | 2596 | if (flags & SYNC_WAIT) |
2600 | error = xfs_bwrite(mp, bp); | 2597 | error = xfs_bwrite(bp); |
2601 | else | 2598 | else |
2602 | xfs_bdwrite(mp, bp); | 2599 | xfs_buf_delwri_queue(bp); |
2600 | |||
2601 | xfs_buf_relse(bp); | ||
2603 | return error; | 2602 | return error; |
2604 | 2603 | ||
2605 | corrupt_out: | 2604 | corrupt_out: |