[PATCH 4/5] xfs: push the ilock into xfs_zero_eof
Christoph Hellwig
hch at infradead.org
Tue Mar 27 00:48:27 CDT 2012
On Tue, Mar 27, 2012 at 12:15:40PM +1100, Dave Chinner wrote:
> > + xfs_ilock(ip, XFS_ILOCK_EXCL);
> > error = xfs_bmapi_read(ip, last_fsb, 1, &imap, &nimaps, 0);
> > + xfs_iunlock(ip, XFS_ILOCK_EXCL);
>
> Does that even need to be an exclusive lock? a shared lock is all
> that is needed to do a lookup, and this is just a lookup...
It has to be a xfs_ilock_map_shared - but given that we hold the iolock
exclusive anyway I didn't bother to optimize this further.
Same for the second xfs_bmapi_read call.
More information about the xfs
mailing list