xfs: use shared ilock mode for direct IO writes by default
authorDave Chinner <dchinner@redhat.com>
Tue, 27 Mar 2012 14:34:50 +0000 (10:34 -0400)
committerBen Myers <bpm@sgi.com>
Mon, 14 May 2012 21:20:21 +0000 (16:20 -0500)
commit507630b29f13a3d8689895618b12015308402e22
treec090f5d2592d6f453ab7dd0f2f61da2a7482e59a
parent193aec10504e4c24521449c46317282141fb36e8
xfs: use shared ilock mode for direct IO writes by default

For the direct IO write path, we only really need the ilock to be taken in
exclusive mode during IO submission if we need to do extent allocation
instead of all the time.

Change the block mapping code to take the ilock in shared mode for the
initial block mapping, and only retake it exclusively when we actually
have to perform extent allocations.  We were already dropping the ilock
for the transaction allocation, so this doesn't introduce new race windows.

Based on an earlier patch from Dave Chinner.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_aops.c
fs/xfs/xfs_iomap.c