aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-03-27 10:34:49 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:20 -0400
commit193aec10504e4c24521449c46317282141fb36e8 (patch)
treeab68802be2bc151911732a78c3acd84604164b20 /fs/xfs/xfs_iops.c
parentf38996f5768713fb60e1d2de66c097367d54bb6a (diff)
xfs: push the ilock into xfs_zero_eof
Instead of calling xfs_zero_eof with the ilock held only take it internally for the minimall required critical section around xfs_bmapi_read. This also requires changing the calling convention for xfs_zero_last_block slightly. The actual zeroing operation is still serialized by the iolock, which must be taken exclusively over the call to xfs_zero_eof. We could in fact use a shared lock for the xfs_bmapi_read calls as long as the extent list has been read in, but given that we already hold the iolock exclusively there is little reason to micro optimize this further. Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_iops.c')
-rw-r--r--fs/xfs/xfs_iops.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 0a80543644c8..efdc46114450 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -764,9 +764,7 @@ xfs_setattr_size(
764 * before the inode is joined to the transaction to modify 764 * before the inode is joined to the transaction to modify
765 * i_size. 765 * i_size.
766 */ 766 */
767 xfs_ilock(ip, XFS_ILOCK_EXCL);
768 error = xfs_zero_eof(ip, newsize, oldsize); 767 error = xfs_zero_eof(ip, newsize, oldsize);
769 xfs_iunlock(ip, XFS_ILOCK_EXCL);
770 if (error) 768 if (error)
771 goto out_unlock; 769 goto out_unlock;
772 } 770 }