aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-06-23 21:36:58 -0400
committerAlex Elder <aelder@sgi.com>2010-07-26 14:16:36 -0400
commit898621d5a72c6799a9a13fce20443b4b6699899c (patch)
tree6cd994bd8d24f4f4f6ac5b5b57e0b99ee02d4ba6 /fs/xfs/xfs_iomap.c
parent4d16e9246fc3b3cf7bc95609eff66929a39daa06 (diff)
xfs: simplify inode to transaction joining
Currently we need to either call IHOLD or xfs_trans_ihold on an inode when joining it to a transaction via xfs_trans_ijoin. This patches instead makes xfs_trans_ijoin usable on it's own by doing an implicity xfs_trans_ihold, which also allows us to drop the third argument. For the case where we want to hold a reference on the inode a xfs_trans_ijoin_ref wrapper is added which does the IHOLD and marks the inode for needing an xfs_iput. In addition to the cleaner interface to the caller this also simplifies the implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 772f3e791ebe..aeac00294a18 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -329,8 +329,7 @@ xfs_iomap_write_direct(
329 if (error) 329 if (error)
330 goto error1; 330 goto error1;
331 331
332 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); 332 xfs_trans_ijoin(tp, ip);
333 xfs_trans_ihold(tp, ip);
334 333
335 bmapi_flag = XFS_BMAPI_WRITE; 334 bmapi_flag = XFS_BMAPI_WRITE;
336 if ((flags & BMAPI_DIRECT) && (offset < ip->i_size || extsz)) 335 if ((flags & BMAPI_DIRECT) && (offset < ip->i_size || extsz))
@@ -597,8 +596,7 @@ xfs_iomap_write_allocate(
597 return XFS_ERROR(error); 596 return XFS_ERROR(error);
598 } 597 }
599 xfs_ilock(ip, XFS_ILOCK_EXCL); 598 xfs_ilock(ip, XFS_ILOCK_EXCL);
600 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); 599 xfs_trans_ijoin(tp, ip);
601 xfs_trans_ihold(tp, ip);
602 600
603 xfs_bmap_init(&free_list, &first_block); 601 xfs_bmap_init(&free_list, &first_block);
604 602
@@ -761,8 +759,7 @@ xfs_iomap_write_unwritten(
761 } 759 }
762 760
763 xfs_ilock(ip, XFS_ILOCK_EXCL); 761 xfs_ilock(ip, XFS_ILOCK_EXCL);
764 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); 762 xfs_trans_ijoin(tp, ip);
765 xfs_trans_ihold(tp, ip);
766 763
767 /* 764 /*
768 * Modify the unwritten extent state of the buffer. 765 * Modify the unwritten extent state of the buffer.