xfs
[Top] [All Lists]

Re: [PATCH 4/5] xfs: push the ilock into xfs_zero_eof

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 4/5] xfs: push the ilock into xfs_zero_eof
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 27 Mar 2012 01:48:27 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20120327011540.GS5091@dastard>
References: <20120326211421.518374058@xxxxxxxxxxxxxxxxxxxxxx> <20120326211603.654869525@xxxxxxxxxxxxxxxxxxxxxx> <20120327011540.GS5091@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
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.

<Prev in Thread] Current Thread [Next in Thread>