From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: [PATCH 7 of 8] Adapt XFS to the new blockdev_direct_IO calls Date: Thu, 21 Dec 2006 21:03:29 -0500 Message-ID: <20061222020329.GS11354@think.oraclecorp.com> References: <20061222014552.GA26388@think.oraclecorp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from rgminet01.oracle.com ([148.87.113.118]:45478 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1945905AbWLVCCO (ORCPT ); Thu, 21 Dec 2006 21:02:14 -0500 To: linux-fsdevel@vger.kernel.org, akpm@osdl.org, zach.brown@oracle.com Content-Disposition: inline In-Reply-To: <20061222014552.GA26388@think.oraclecorp.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org XFS is changed to use blockdev_direct_IO flags instead of DIO_OWN_LOCKING. Signed-off-by: Chris Mason diff -r 5a06df98f46d -r 3bd838f3dc06 fs/xfs/linux-2.6/xfs_aops.c --- a/fs/xfs/linux-2.6/xfs_aops.c Thu Dec 21 15:31:31 2006 -0500 +++ b/fs/xfs/linux-2.6/xfs_aops.c Thu Dec 21 15:31:31 2006 -0500 @@ -1392,19 +1392,16 @@ xfs_vm_direct_IO( iocb->private = xfs_alloc_ioend(inode, IOMAP_UNWRITTEN); - if (rw == WRITE) { - ret = blockdev_direct_IO_own_locking(rw, iocb, inode, - iomap.iomap_target->bt_bdev, - iov, offset, nr_segs, - xfs_get_blocks_direct, - xfs_end_io_direct); - } else { - ret = blockdev_direct_IO_no_locking(rw, iocb, inode, - iomap.iomap_target->bt_bdev, - iov, offset, nr_segs, - xfs_get_blocks_direct, - xfs_end_io_direct); - } + /* + * ask DIO not to do any special locking for us, and to always + * pass create=1 to get_block on writes + */ + ret = blockdev_direct_IO_flags(rw, iocb, inode, + iomap.iomap_target->bt_bdev, + iov, offset, nr_segs, + xfs_get_blocks_direct, + xfs_end_io_direct, + DIO_CREATE); if (unlikely(ret != -EIOCBQUEUED && iocb->private)) xfs_destroy_ioend(iocb->private);