From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: [PATCH 7 of 7] Adapt XFS to the new blockdev_direct_IO calls Date: Wed, 01 Nov 2006 11:08:09 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: akpm@osdl.org, zach.brown@oracle.com, Suparna Bhattacharya Return-path: Received: from rgminet01.oracle.com ([148.87.113.118]:2514 "EHLO rgminet01.oracle.com") by vger.kernel.org with ESMTP id S2992629AbWKAQ0f (ORCPT ); Wed, 1 Nov 2006 11:26:35 -0500 In-Reply-To: To: linux-fsdevel@vger.kernel.org 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 b23ba06ac61f -r b23d3ec1929f fs/xfs/linux-2.6/xfs_aops.c --- a/fs/xfs/linux-2.6/xfs_aops.c Wed Nov 01 10:24:08 2006 -0500 +++ b/fs/xfs/linux-2.6/xfs_aops.c Wed Nov 01 10:24:11 2006 -0500 @@ -1389,19 +1389,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 <= 0 && iocb->private)) xfs_destroy_ioend(iocb->private);