diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 123 |
1 files changed, 59 insertions, 64 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 51fc429527bc..ce9268a2f56b 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -72,8 +72,8 @@ xfs_readlink_bmap( | |||
72 | xfs_buf_t *bp; | 72 | xfs_buf_t *bp; |
73 | int error = 0; | 73 | int error = 0; |
74 | 74 | ||
75 | error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen), 0, NULL, 0, | 75 | error = xfs_bmapi_read(ip, 0, XFS_B_TO_FSB(mp, pathlen), mval, &nmaps, |
76 | mval, &nmaps, NULL); | 76 | 0); |
77 | if (error) | 77 | if (error) |
78 | goto out; | 78 | goto out; |
79 | 79 | ||
@@ -87,8 +87,7 @@ xfs_readlink_bmap( | |||
87 | return XFS_ERROR(ENOMEM); | 87 | return XFS_ERROR(ENOMEM); |
88 | error = bp->b_error; | 88 | error = bp->b_error; |
89 | if (error) { | 89 | if (error) { |
90 | xfs_ioerror_alert("xfs_readlink", | 90 | xfs_buf_ioerror_alert(bp, __func__); |
91 | ip->i_mount, bp, XFS_BUF_ADDR(bp)); | ||
92 | xfs_buf_relse(bp); | 91 | xfs_buf_relse(bp); |
93 | goto out; | 92 | goto out; |
94 | } | 93 | } |
@@ -113,7 +112,7 @@ xfs_readlink( | |||
113 | char *link) | 112 | char *link) |
114 | { | 113 | { |
115 | xfs_mount_t *mp = ip->i_mount; | 114 | xfs_mount_t *mp = ip->i_mount; |
116 | int pathlen; | 115 | xfs_fsize_t pathlen; |
117 | int error = 0; | 116 | int error = 0; |
118 | 117 | ||
119 | trace_xfs_readlink(ip); | 118 | trace_xfs_readlink(ip); |
@@ -123,13 +122,19 @@ xfs_readlink( | |||
123 | 122 | ||
124 | xfs_ilock(ip, XFS_ILOCK_SHARED); | 123 | xfs_ilock(ip, XFS_ILOCK_SHARED); |
125 | 124 | ||
126 | ASSERT(S_ISLNK(ip->i_d.di_mode)); | ||
127 | ASSERT(ip->i_d.di_size <= MAXPATHLEN); | ||
128 | |||
129 | pathlen = ip->i_d.di_size; | 125 | pathlen = ip->i_d.di_size; |
130 | if (!pathlen) | 126 | if (!pathlen) |
131 | goto out; | 127 | goto out; |
132 | 128 | ||
129 | if (pathlen < 0 || pathlen > MAXPATHLEN) { | ||
130 | xfs_alert(mp, "%s: inode (%llu) bad symlink length (%lld)", | ||
131 | __func__, (unsigned long long) ip->i_ino, | ||
132 | (long long) pathlen); | ||
133 | ASSERT(0); | ||
134 | return XFS_ERROR(EFSCORRUPTED); | ||
135 | } | ||
136 | |||
137 | |||
133 | if (ip->i_df.if_flags & XFS_IFINLINE) { | 138 | if (ip->i_df.if_flags & XFS_IFINLINE) { |
134 | memcpy(link, ip->i_df.if_u1.if_data, pathlen); | 139 | memcpy(link, ip->i_df.if_u1.if_data, pathlen); |
135 | link[pathlen] = '\0'; | 140 | link[pathlen] = '\0'; |
@@ -178,8 +183,7 @@ xfs_free_eofblocks( | |||
178 | 183 | ||
179 | nimaps = 1; | 184 | nimaps = 1; |
180 | xfs_ilock(ip, XFS_ILOCK_SHARED); | 185 | xfs_ilock(ip, XFS_ILOCK_SHARED); |
181 | error = xfs_bmapi(NULL, ip, end_fsb, map_len, 0, | 186 | error = xfs_bmapi_read(ip, end_fsb, map_len, &imap, &nimaps, 0); |
182 | NULL, 0, &imap, &nimaps, NULL); | ||
183 | xfs_iunlock(ip, XFS_ILOCK_SHARED); | 187 | xfs_iunlock(ip, XFS_ILOCK_SHARED); |
184 | 188 | ||
185 | if (!error && (nimaps != 0) && | 189 | if (!error && (nimaps != 0) && |
@@ -220,7 +224,7 @@ xfs_free_eofblocks( | |||
220 | } | 224 | } |
221 | 225 | ||
222 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 226 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
223 | xfs_trans_ijoin(tp, ip); | 227 | xfs_trans_ijoin(tp, ip, 0); |
224 | 228 | ||
225 | error = xfs_itruncate_data(&tp, ip, ip->i_size); | 229 | error = xfs_itruncate_data(&tp, ip, ip->i_size); |
226 | if (error) { | 230 | if (error) { |
@@ -289,7 +293,7 @@ xfs_inactive_symlink_rmt( | |||
289 | xfs_ilock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); | 293 | xfs_ilock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); |
290 | size = (int)ip->i_d.di_size; | 294 | size = (int)ip->i_d.di_size; |
291 | ip->i_d.di_size = 0; | 295 | ip->i_d.di_size = 0; |
292 | xfs_trans_ijoin(tp, ip); | 296 | xfs_trans_ijoin(tp, ip, 0); |
293 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 297 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
294 | /* | 298 | /* |
295 | * Find the block(s) so we can inval and unmap them. | 299 | * Find the block(s) so we can inval and unmap them. |
@@ -297,9 +301,9 @@ xfs_inactive_symlink_rmt( | |||
297 | done = 0; | 301 | done = 0; |
298 | xfs_bmap_init(&free_list, &first_block); | 302 | xfs_bmap_init(&free_list, &first_block); |
299 | nmaps = ARRAY_SIZE(mval); | 303 | nmaps = ARRAY_SIZE(mval); |
300 | if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size), | 304 | error = xfs_bmapi_read(ip, 0, XFS_B_TO_FSB(mp, size), |
301 | XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps, | 305 | mval, &nmaps, 0); |
302 | &free_list))) | 306 | if (error) |
303 | goto error0; | 307 | goto error0; |
304 | /* | 308 | /* |
305 | * Invalidate the block(s). | 309 | * Invalidate the block(s). |
@@ -308,6 +312,10 @@ xfs_inactive_symlink_rmt( | |||
308 | bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, | 312 | bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, |
309 | XFS_FSB_TO_DADDR(mp, mval[i].br_startblock), | 313 | XFS_FSB_TO_DADDR(mp, mval[i].br_startblock), |
310 | XFS_FSB_TO_BB(mp, mval[i].br_blockcount), 0); | 314 | XFS_FSB_TO_BB(mp, mval[i].br_blockcount), 0); |
315 | if (!bp) { | ||
316 | error = ENOMEM; | ||
317 | goto error1; | ||
318 | } | ||
311 | xfs_trans_binval(tp, bp); | 319 | xfs_trans_binval(tp, bp); |
312 | } | 320 | } |
313 | /* | 321 | /* |
@@ -333,7 +341,7 @@ xfs_inactive_symlink_rmt( | |||
333 | * Mark it dirty so it will be logged and moved forward in the log as | 341 | * Mark it dirty so it will be logged and moved forward in the log as |
334 | * part of every commit. | 342 | * part of every commit. |
335 | */ | 343 | */ |
336 | xfs_trans_ijoin(tp, ip); | 344 | xfs_trans_ijoin(tp, ip, 0); |
337 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 345 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
338 | /* | 346 | /* |
339 | * Get a new, empty transaction to return to our caller. | 347 | * Get a new, empty transaction to return to our caller. |
@@ -466,7 +474,7 @@ xfs_inactive_attrs( | |||
466 | goto error_cancel; | 474 | goto error_cancel; |
467 | 475 | ||
468 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 476 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
469 | xfs_trans_ijoin(tp, ip); | 477 | xfs_trans_ijoin(tp, ip, 0); |
470 | xfs_idestroy_fork(ip, XFS_ATTR_FORK); | 478 | xfs_idestroy_fork(ip, XFS_ATTR_FORK); |
471 | 479 | ||
472 | ASSERT(ip->i_d.di_anextents == 0); | 480 | ASSERT(ip->i_d.di_anextents == 0); |
@@ -647,8 +655,6 @@ xfs_inactive( | |||
647 | if (truncate) { | 655 | if (truncate) { |
648 | xfs_ilock(ip, XFS_IOLOCK_EXCL); | 656 | xfs_ilock(ip, XFS_IOLOCK_EXCL); |
649 | 657 | ||
650 | xfs_ioend_wait(ip); | ||
651 | |||
652 | error = xfs_trans_reserve(tp, 0, | 658 | error = xfs_trans_reserve(tp, 0, |
653 | XFS_ITRUNCATE_LOG_RES(mp), | 659 | XFS_ITRUNCATE_LOG_RES(mp), |
654 | 0, XFS_TRANS_PERM_LOG_RES, | 660 | 0, XFS_TRANS_PERM_LOG_RES, |
@@ -662,7 +668,7 @@ xfs_inactive( | |||
662 | } | 668 | } |
663 | 669 | ||
664 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 670 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
665 | xfs_trans_ijoin(tp, ip); | 671 | xfs_trans_ijoin(tp, ip, 0); |
666 | 672 | ||
667 | error = xfs_itruncate_data(&tp, ip, 0); | 673 | error = xfs_itruncate_data(&tp, ip, 0); |
668 | if (error) { | 674 | if (error) { |
@@ -686,7 +692,7 @@ xfs_inactive( | |||
686 | return VN_INACTIVE_CACHE; | 692 | return VN_INACTIVE_CACHE; |
687 | } | 693 | } |
688 | 694 | ||
689 | xfs_trans_ijoin(tp, ip); | 695 | xfs_trans_ijoin(tp, ip, 0); |
690 | } else { | 696 | } else { |
691 | error = xfs_trans_reserve(tp, 0, | 697 | error = xfs_trans_reserve(tp, 0, |
692 | XFS_IFREE_LOG_RES(mp), | 698 | XFS_IFREE_LOG_RES(mp), |
@@ -699,7 +705,7 @@ xfs_inactive( | |||
699 | } | 705 | } |
700 | 706 | ||
701 | xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); | 707 | xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); |
702 | xfs_trans_ijoin(tp, ip); | 708 | xfs_trans_ijoin(tp, ip, 0); |
703 | } | 709 | } |
704 | 710 | ||
705 | /* | 711 | /* |
@@ -939,7 +945,7 @@ xfs_create( | |||
939 | * the transaction cancel unlocking dp so don't do it explicitly in the | 945 | * the transaction cancel unlocking dp so don't do it explicitly in the |
940 | * error path. | 946 | * error path. |
941 | */ | 947 | */ |
942 | xfs_trans_ijoin_ref(tp, dp, XFS_ILOCK_EXCL); | 948 | xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); |
943 | unlock_dp_on_error = B_FALSE; | 949 | unlock_dp_on_error = B_FALSE; |
944 | 950 | ||
945 | error = xfs_dir_createname(tp, dp, name, ip->i_ino, | 951 | error = xfs_dir_createname(tp, dp, name, ip->i_ino, |
@@ -1260,8 +1266,8 @@ xfs_remove( | |||
1260 | 1266 | ||
1261 | xfs_lock_two_inodes(dp, ip, XFS_ILOCK_EXCL); | 1267 | xfs_lock_two_inodes(dp, ip, XFS_ILOCK_EXCL); |
1262 | 1268 | ||
1263 | xfs_trans_ijoin_ref(tp, dp, XFS_ILOCK_EXCL); | 1269 | xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); |
1264 | xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); | 1270 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); |
1265 | 1271 | ||
1266 | /* | 1272 | /* |
1267 | * If we're removing a directory perform some additional validation. | 1273 | * If we're removing a directory perform some additional validation. |
@@ -1406,8 +1412,8 @@ xfs_link( | |||
1406 | 1412 | ||
1407 | xfs_lock_two_inodes(sip, tdp, XFS_ILOCK_EXCL); | 1413 | xfs_lock_two_inodes(sip, tdp, XFS_ILOCK_EXCL); |
1408 | 1414 | ||
1409 | xfs_trans_ijoin_ref(tp, sip, XFS_ILOCK_EXCL); | 1415 | xfs_trans_ijoin(tp, sip, XFS_ILOCK_EXCL); |
1410 | xfs_trans_ijoin_ref(tp, tdp, XFS_ILOCK_EXCL); | 1416 | xfs_trans_ijoin(tp, tdp, XFS_ILOCK_EXCL); |
1411 | 1417 | ||
1412 | /* | 1418 | /* |
1413 | * If the source has too many links, we can't make any more to it. | 1419 | * If the source has too many links, we can't make any more to it. |
@@ -1601,7 +1607,7 @@ xfs_symlink( | |||
1601 | * transaction cancel unlocking dp so don't do it explicitly in the | 1607 | * transaction cancel unlocking dp so don't do it explicitly in the |
1602 | * error path. | 1608 | * error path. |
1603 | */ | 1609 | */ |
1604 | xfs_trans_ijoin_ref(tp, dp, XFS_ILOCK_EXCL); | 1610 | xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); |
1605 | unlock_dp_on_error = B_FALSE; | 1611 | unlock_dp_on_error = B_FALSE; |
1606 | 1612 | ||
1607 | /* | 1613 | /* |
@@ -1632,10 +1638,9 @@ xfs_symlink( | |||
1632 | first_fsb = 0; | 1638 | first_fsb = 0; |
1633 | nmaps = SYMLINK_MAPS; | 1639 | nmaps = SYMLINK_MAPS; |
1634 | 1640 | ||
1635 | error = xfs_bmapi(tp, ip, first_fsb, fs_blocks, | 1641 | error = xfs_bmapi_write(tp, ip, first_fsb, fs_blocks, |
1636 | XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, | 1642 | XFS_BMAPI_METADATA, &first_block, resblks, |
1637 | &first_block, resblks, mval, &nmaps, | 1643 | mval, &nmaps, &free_list); |
1638 | &free_list); | ||
1639 | if (error) | 1644 | if (error) |
1640 | goto error2; | 1645 | goto error2; |
1641 | 1646 | ||
@@ -1650,7 +1655,10 @@ xfs_symlink( | |||
1650 | byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount); | 1655 | byte_cnt = XFS_FSB_TO_B(mp, mval[n].br_blockcount); |
1651 | bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, | 1656 | bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, |
1652 | BTOBB(byte_cnt), 0); | 1657 | BTOBB(byte_cnt), 0); |
1653 | ASSERT(!xfs_buf_geterror(bp)); | 1658 | if (!bp) { |
1659 | error = ENOMEM; | ||
1660 | goto error2; | ||
1661 | } | ||
1654 | if (pathlen < byte_cnt) { | 1662 | if (pathlen < byte_cnt) { |
1655 | byte_cnt = pathlen; | 1663 | byte_cnt = pathlen; |
1656 | } | 1664 | } |
@@ -1732,7 +1740,7 @@ xfs_set_dmattrs( | |||
1732 | return error; | 1740 | return error; |
1733 | } | 1741 | } |
1734 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 1742 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
1735 | xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); | 1743 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); |
1736 | 1744 | ||
1737 | ip->i_d.di_dmevmask = evmask; | 1745 | ip->i_d.di_dmevmask = evmask; |
1738 | ip->i_d.di_dmstate = state; | 1746 | ip->i_d.di_dmstate = state; |
@@ -1778,7 +1786,6 @@ xfs_alloc_file_space( | |||
1778 | xfs_fileoff_t startoffset_fsb; | 1786 | xfs_fileoff_t startoffset_fsb; |
1779 | xfs_fsblock_t firstfsb; | 1787 | xfs_fsblock_t firstfsb; |
1780 | int nimaps; | 1788 | int nimaps; |
1781 | int bmapi_flag; | ||
1782 | int quota_flag; | 1789 | int quota_flag; |
1783 | int rt; | 1790 | int rt; |
1784 | xfs_trans_t *tp; | 1791 | xfs_trans_t *tp; |
@@ -1806,7 +1813,6 @@ xfs_alloc_file_space( | |||
1806 | count = len; | 1813 | count = len; |
1807 | imapp = &imaps[0]; | 1814 | imapp = &imaps[0]; |
1808 | nimaps = 1; | 1815 | nimaps = 1; |
1809 | bmapi_flag = XFS_BMAPI_WRITE | alloc_type; | ||
1810 | startoffset_fsb = XFS_B_TO_FSBT(mp, offset); | 1816 | startoffset_fsb = XFS_B_TO_FSBT(mp, offset); |
1811 | allocatesize_fsb = XFS_B_TO_FSB(mp, count); | 1817 | allocatesize_fsb = XFS_B_TO_FSB(mp, count); |
1812 | 1818 | ||
@@ -1877,16 +1883,12 @@ xfs_alloc_file_space( | |||
1877 | if (error) | 1883 | if (error) |
1878 | goto error1; | 1884 | goto error1; |
1879 | 1885 | ||
1880 | xfs_trans_ijoin(tp, ip); | 1886 | xfs_trans_ijoin(tp, ip, 0); |
1881 | 1887 | ||
1882 | /* | ||
1883 | * Issue the xfs_bmapi() call to allocate the blocks | ||
1884 | */ | ||
1885 | xfs_bmap_init(&free_list, &firstfsb); | 1888 | xfs_bmap_init(&free_list, &firstfsb); |
1886 | error = xfs_bmapi(tp, ip, startoffset_fsb, | 1889 | error = xfs_bmapi_write(tp, ip, startoffset_fsb, |
1887 | allocatesize_fsb, bmapi_flag, | 1890 | allocatesize_fsb, alloc_type, &firstfsb, |
1888 | &firstfsb, 0, imapp, &nimaps, | 1891 | 0, imapp, &nimaps, &free_list); |
1889 | &free_list); | ||
1890 | if (error) { | 1892 | if (error) { |
1891 | goto error0; | 1893 | goto error0; |
1892 | } | 1894 | } |
@@ -1976,8 +1978,7 @@ xfs_zero_remaining_bytes( | |||
1976 | for (offset = startoff; offset <= endoff; offset = lastoffset + 1) { | 1978 | for (offset = startoff; offset <= endoff; offset = lastoffset + 1) { |
1977 | offset_fsb = XFS_B_TO_FSBT(mp, offset); | 1979 | offset_fsb = XFS_B_TO_FSBT(mp, offset); |
1978 | nimap = 1; | 1980 | nimap = 1; |
1979 | error = xfs_bmapi(NULL, ip, offset_fsb, 1, 0, | 1981 | error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0); |
1980 | NULL, 0, &imap, &nimap, NULL); | ||
1981 | if (error || nimap < 1) | 1982 | if (error || nimap < 1) |
1982 | break; | 1983 | break; |
1983 | ASSERT(imap.br_blockcount >= 1); | 1984 | ASSERT(imap.br_blockcount >= 1); |
@@ -1997,8 +1998,8 @@ xfs_zero_remaining_bytes( | |||
1997 | xfsbdstrat(mp, bp); | 1998 | xfsbdstrat(mp, bp); |
1998 | error = xfs_buf_iowait(bp); | 1999 | error = xfs_buf_iowait(bp); |
1999 | if (error) { | 2000 | if (error) { |
2000 | xfs_ioerror_alert("xfs_zero_remaining_bytes(read)", | 2001 | xfs_buf_ioerror_alert(bp, |
2001 | mp, bp, XFS_BUF_ADDR(bp)); | 2002 | "xfs_zero_remaining_bytes(read)"); |
2002 | break; | 2003 | break; |
2003 | } | 2004 | } |
2004 | memset(bp->b_addr + | 2005 | memset(bp->b_addr + |
@@ -2010,8 +2011,8 @@ xfs_zero_remaining_bytes( | |||
2010 | xfsbdstrat(mp, bp); | 2011 | xfsbdstrat(mp, bp); |
2011 | error = xfs_buf_iowait(bp); | 2012 | error = xfs_buf_iowait(bp); |
2012 | if (error) { | 2013 | if (error) { |
2013 | xfs_ioerror_alert("xfs_zero_remaining_bytes(write)", | 2014 | xfs_buf_ioerror_alert(bp, |
2014 | mp, bp, XFS_BUF_ADDR(bp)); | 2015 | "xfs_zero_remaining_bytes(write)"); |
2015 | break; | 2016 | break; |
2016 | } | 2017 | } |
2017 | } | 2018 | } |
@@ -2076,7 +2077,7 @@ xfs_free_file_space( | |||
2076 | if (need_iolock) { | 2077 | if (need_iolock) { |
2077 | xfs_ilock(ip, XFS_IOLOCK_EXCL); | 2078 | xfs_ilock(ip, XFS_IOLOCK_EXCL); |
2078 | /* wait for the completion of any pending DIOs */ | 2079 | /* wait for the completion of any pending DIOs */ |
2079 | xfs_ioend_wait(ip); | 2080 | inode_dio_wait(VFS_I(ip)); |
2080 | } | 2081 | } |
2081 | 2082 | ||
2082 | rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); | 2083 | rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); |
@@ -2096,8 +2097,8 @@ xfs_free_file_space( | |||
2096 | */ | 2097 | */ |
2097 | if (rt && !xfs_sb_version_hasextflgbit(&mp->m_sb)) { | 2098 | if (rt && !xfs_sb_version_hasextflgbit(&mp->m_sb)) { |
2098 | nimap = 1; | 2099 | nimap = 1; |
2099 | error = xfs_bmapi(NULL, ip, startoffset_fsb, | 2100 | error = xfs_bmapi_read(ip, startoffset_fsb, 1, |
2100 | 1, 0, NULL, 0, &imap, &nimap, NULL); | 2101 | &imap, &nimap, 0); |
2101 | if (error) | 2102 | if (error) |
2102 | goto out_unlock_iolock; | 2103 | goto out_unlock_iolock; |
2103 | ASSERT(nimap == 0 || nimap == 1); | 2104 | ASSERT(nimap == 0 || nimap == 1); |
@@ -2111,8 +2112,8 @@ xfs_free_file_space( | |||
2111 | startoffset_fsb += mp->m_sb.sb_rextsize - mod; | 2112 | startoffset_fsb += mp->m_sb.sb_rextsize - mod; |
2112 | } | 2113 | } |
2113 | nimap = 1; | 2114 | nimap = 1; |
2114 | error = xfs_bmapi(NULL, ip, endoffset_fsb - 1, | 2115 | error = xfs_bmapi_read(ip, endoffset_fsb - 1, 1, |
2115 | 1, 0, NULL, 0, &imap, &nimap, NULL); | 2116 | &imap, &nimap, 0); |
2116 | if (error) | 2117 | if (error) |
2117 | goto out_unlock_iolock; | 2118 | goto out_unlock_iolock; |
2118 | ASSERT(nimap == 0 || nimap == 1); | 2119 | ASSERT(nimap == 0 || nimap == 1); |
@@ -2180,7 +2181,7 @@ xfs_free_file_space( | |||
2180 | if (error) | 2181 | if (error) |
2181 | goto error1; | 2182 | goto error1; |
2182 | 2183 | ||
2183 | xfs_trans_ijoin(tp, ip); | 2184 | xfs_trans_ijoin(tp, ip, 0); |
2184 | 2185 | ||
2185 | /* | 2186 | /* |
2186 | * issue the bunmapi() call to free the blocks | 2187 | * issue the bunmapi() call to free the blocks |
@@ -2353,8 +2354,7 @@ xfs_change_file_space( | |||
2353 | } | 2354 | } |
2354 | 2355 | ||
2355 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 2356 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
2356 | 2357 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); | |
2357 | xfs_trans_ijoin(tp, ip); | ||
2358 | 2358 | ||
2359 | if ((attr_flags & XFS_ATTR_DMI) == 0) { | 2359 | if ((attr_flags & XFS_ATTR_DMI) == 0) { |
2360 | ip->i_d.di_mode &= ~S_ISUID; | 2360 | ip->i_d.di_mode &= ~S_ISUID; |
@@ -2379,10 +2379,5 @@ xfs_change_file_space( | |||
2379 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 2379 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
2380 | if (attr_flags & XFS_ATTR_SYNC) | 2380 | if (attr_flags & XFS_ATTR_SYNC) |
2381 | xfs_trans_set_sync(tp); | 2381 | xfs_trans_set_sync(tp); |
2382 | 2382 | return xfs_trans_commit(tp, 0); | |
2383 | error = xfs_trans_commit(tp, 0); | ||
2384 | |||
2385 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | ||
2386 | |||
2387 | return error; | ||
2388 | } | 2383 | } |