aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-07-08 08:34:47 -0400
committerChristoph Hellwig <hch@lst.de>2011-07-08 08:34:47 -0400
commitf3ca87389dbff0a3dc1a7cb2fa7c62e25421c66c (patch)
tree39a6aa16be0bbab79e65525d57404b23eaff0205 /fs/xfs/xfs_bmap.c
parent7a249cf83da1813cfa71cfe1e265b40045eceb47 (diff)
xfs: remove i_transp
Remove the transaction pointer in the inode. It's only used to avoid passing down an argument in the bmap code, and for a few asserts in the transaction code right now. Also use the local variable ip in a few more places in xfs_inode_item_unlock, so that it isn't only used for debug builds after the above change. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index e546a33214c9..7b46b78ba3f0 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -94,6 +94,7 @@ xfs_bmap_add_attrfork_local(
94 */ 94 */
95STATIC int /* error */ 95STATIC int /* error */
96xfs_bmap_add_extent_delay_real( 96xfs_bmap_add_extent_delay_real(
97 struct xfs_trans *tp, /* transaction pointer */
97 xfs_inode_t *ip, /* incore inode pointer */ 98 xfs_inode_t *ip, /* incore inode pointer */
98 xfs_extnum_t *idx, /* extent number to update/insert */ 99 xfs_extnum_t *idx, /* extent number to update/insert */
99 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */ 100 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */
@@ -439,6 +440,7 @@ xfs_bmap_add_attrfork_local(
439 */ 440 */
440STATIC int /* error */ 441STATIC int /* error */
441xfs_bmap_add_extent( 442xfs_bmap_add_extent(
443 struct xfs_trans *tp, /* transaction pointer */
442 xfs_inode_t *ip, /* incore inode pointer */ 444 xfs_inode_t *ip, /* incore inode pointer */
443 xfs_extnum_t *idx, /* extent number to update/insert */ 445 xfs_extnum_t *idx, /* extent number to update/insert */
444 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */ 446 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */
@@ -524,7 +526,7 @@ xfs_bmap_add_extent(
524 if (cur) 526 if (cur)
525 ASSERT(cur->bc_private.b.flags & 527 ASSERT(cur->bc_private.b.flags &
526 XFS_BTCUR_BPRV_WASDEL); 528 XFS_BTCUR_BPRV_WASDEL);
527 error = xfs_bmap_add_extent_delay_real(ip, 529 error = xfs_bmap_add_extent_delay_real(tp, ip,
528 idx, &cur, new, &da_new, 530 idx, &cur, new, &da_new,
529 first, flist, &logflags); 531 first, flist, &logflags);
530 } else { 532 } else {
@@ -561,7 +563,7 @@ xfs_bmap_add_extent(
561 int tmp_logflags; /* partial log flag return val */ 563 int tmp_logflags; /* partial log flag return val */
562 564
563 ASSERT(cur == NULL); 565 ASSERT(cur == NULL);
564 error = xfs_bmap_extents_to_btree(ip->i_transp, ip, first, 566 error = xfs_bmap_extents_to_btree(tp, ip, first,
565 flist, &cur, da_old > 0, &tmp_logflags, whichfork); 567 flist, &cur, da_old > 0, &tmp_logflags, whichfork);
566 logflags |= tmp_logflags; 568 logflags |= tmp_logflags;
567 if (error) 569 if (error)
@@ -604,6 +606,7 @@ done:
604 */ 606 */
605STATIC int /* error */ 607STATIC int /* error */
606xfs_bmap_add_extent_delay_real( 608xfs_bmap_add_extent_delay_real(
609 struct xfs_trans *tp, /* transaction pointer */
607 xfs_inode_t *ip, /* incore inode pointer */ 610 xfs_inode_t *ip, /* incore inode pointer */
608 xfs_extnum_t *idx, /* extent number to update/insert */ 611 xfs_extnum_t *idx, /* extent number to update/insert */
609 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */ 612 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */
@@ -901,7 +904,7 @@ xfs_bmap_add_extent_delay_real(
901 } 904 }
902 if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS && 905 if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS &&
903 ip->i_d.di_nextents > ip->i_df.if_ext_max) { 906 ip->i_d.di_nextents > ip->i_df.if_ext_max) {
904 error = xfs_bmap_extents_to_btree(ip->i_transp, ip, 907 error = xfs_bmap_extents_to_btree(tp, ip,
905 first, flist, &cur, 1, &tmp_rval, 908 first, flist, &cur, 1, &tmp_rval,
906 XFS_DATA_FORK); 909 XFS_DATA_FORK);
907 rval |= tmp_rval; 910 rval |= tmp_rval;
@@ -984,7 +987,7 @@ xfs_bmap_add_extent_delay_real(
984 } 987 }
985 if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS && 988 if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS &&
986 ip->i_d.di_nextents > ip->i_df.if_ext_max) { 989 ip->i_d.di_nextents > ip->i_df.if_ext_max) {
987 error = xfs_bmap_extents_to_btree(ip->i_transp, ip, 990 error = xfs_bmap_extents_to_btree(tp, ip,
988 first, flist, &cur, 1, &tmp_rval, 991 first, flist, &cur, 1, &tmp_rval,
989 XFS_DATA_FORK); 992 XFS_DATA_FORK);
990 rval |= tmp_rval; 993 rval |= tmp_rval;
@@ -1052,7 +1055,7 @@ xfs_bmap_add_extent_delay_real(
1052 } 1055 }
1053 if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS && 1056 if (ip->i_d.di_format == XFS_DINODE_FMT_EXTENTS &&
1054 ip->i_d.di_nextents > ip->i_df.if_ext_max) { 1057 ip->i_d.di_nextents > ip->i_df.if_ext_max) {
1055 error = xfs_bmap_extents_to_btree(ip->i_transp, ip, 1058 error = xfs_bmap_extents_to_btree(tp, ip,
1056 first, flist, &cur, 1, &tmp_rval, 1059 first, flist, &cur, 1, &tmp_rval,
1057 XFS_DATA_FORK); 1060 XFS_DATA_FORK);
1058 rval |= tmp_rval; 1061 rval |= tmp_rval;
@@ -2871,8 +2874,8 @@ xfs_bmap_del_extent(
2871 len = del->br_blockcount; 2874 len = del->br_blockcount;
2872 do_div(bno, mp->m_sb.sb_rextsize); 2875 do_div(bno, mp->m_sb.sb_rextsize);
2873 do_div(len, mp->m_sb.sb_rextsize); 2876 do_div(len, mp->m_sb.sb_rextsize);
2874 if ((error = xfs_rtfree_extent(ip->i_transp, bno, 2877 error = xfs_rtfree_extent(tp, bno, (xfs_extlen_t)len);
2875 (xfs_extlen_t)len))) 2878 if (error)
2876 goto done; 2879 goto done;
2877 do_fx = 0; 2880 do_fx = 0;
2878 nblks = len * mp->m_sb.sb_rextsize; 2881 nblks = len * mp->m_sb.sb_rextsize;
@@ -4662,7 +4665,7 @@ xfs_bmapi(
4662 if (!wasdelay && (flags & XFS_BMAPI_PREALLOC)) 4665 if (!wasdelay && (flags & XFS_BMAPI_PREALLOC))
4663 got.br_state = XFS_EXT_UNWRITTEN; 4666 got.br_state = XFS_EXT_UNWRITTEN;
4664 } 4667 }
4665 error = xfs_bmap_add_extent(ip, &lastx, &cur, &got, 4668 error = xfs_bmap_add_extent(tp, ip, &lastx, &cur, &got,
4666 firstblock, flist, &tmp_logflags, 4669 firstblock, flist, &tmp_logflags,
4667 whichfork); 4670 whichfork);
4668 logflags |= tmp_logflags; 4671 logflags |= tmp_logflags;
@@ -4763,7 +4766,7 @@ xfs_bmapi(
4763 mval->br_state = (mval->br_state == XFS_EXT_UNWRITTEN) 4766 mval->br_state = (mval->br_state == XFS_EXT_UNWRITTEN)
4764 ? XFS_EXT_NORM 4767 ? XFS_EXT_NORM
4765 : XFS_EXT_UNWRITTEN; 4768 : XFS_EXT_UNWRITTEN;
4766 error = xfs_bmap_add_extent(ip, &lastx, &cur, mval, 4769 error = xfs_bmap_add_extent(tp, ip, &lastx, &cur, mval,
4767 firstblock, flist, &tmp_logflags, 4770 firstblock, flist, &tmp_logflags,
4768 whichfork); 4771 whichfork);
4769 logflags |= tmp_logflags; 4772 logflags |= tmp_logflags;
@@ -5117,7 +5120,7 @@ xfs_bunmapi(
5117 del.br_blockcount = mod; 5120 del.br_blockcount = mod;
5118 } 5121 }
5119 del.br_state = XFS_EXT_UNWRITTEN; 5122 del.br_state = XFS_EXT_UNWRITTEN;
5120 error = xfs_bmap_add_extent(ip, &lastx, &cur, &del, 5123 error = xfs_bmap_add_extent(tp, ip, &lastx, &cur, &del,
5121 firstblock, flist, &logflags, 5124 firstblock, flist, &logflags,
5122 XFS_DATA_FORK); 5125 XFS_DATA_FORK);
5123 if (error) 5126 if (error)
@@ -5175,18 +5178,18 @@ xfs_bunmapi(
5175 } 5178 }
5176 prev.br_state = XFS_EXT_UNWRITTEN; 5179 prev.br_state = XFS_EXT_UNWRITTEN;
5177 lastx--; 5180 lastx--;
5178 error = xfs_bmap_add_extent(ip, &lastx, &cur, 5181 error = xfs_bmap_add_extent(tp, ip, &lastx,
5179 &prev, firstblock, flist, &logflags, 5182 &cur, &prev, firstblock, flist,
5180 XFS_DATA_FORK); 5183 &logflags, XFS_DATA_FORK);
5181 if (error) 5184 if (error)
5182 goto error0; 5185 goto error0;
5183 goto nodelete; 5186 goto nodelete;
5184 } else { 5187 } else {
5185 ASSERT(del.br_state == XFS_EXT_NORM); 5188 ASSERT(del.br_state == XFS_EXT_NORM);
5186 del.br_state = XFS_EXT_UNWRITTEN; 5189 del.br_state = XFS_EXT_UNWRITTEN;
5187 error = xfs_bmap_add_extent(ip, &lastx, &cur, 5190 error = xfs_bmap_add_extent(tp, ip, &lastx,
5188 &del, firstblock, flist, &logflags, 5191 &cur, &del, firstblock, flist,
5189 XFS_DATA_FORK); 5192 &logflags, XFS_DATA_FORK);
5190 if (error) 5193 if (error)
5191 goto error0; 5194 goto error0;
5192 goto nodelete; 5195 goto nodelete;