From 193aec10504e4c24521449c46317282141fb36e8 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 27 Mar 2012 10:34:49 -0400 Subject: 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 Signed-off-by: Christoph Hellwig Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_iops.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'fs/xfs/xfs_iops.c') diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 0a80543644c..efdc4611445 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -764,9 +764,7 @@ xfs_setattr_size( * before the inode is joined to the transaction to modify * i_size. */ - xfs_ilock(ip, XFS_ILOCK_EXCL); error = xfs_zero_eof(ip, newsize, oldsize); - xfs_iunlock(ip, XFS_ILOCK_EXCL); if (error) goto out_unlock; } -- cgit v1.2.3