From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH] pass iocb to dio_iodone_t Date: Fri, 10 Jun 2005 17:00:52 +0200 Message-ID: <20050610150052.GA1632@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from verein.lst.de ([213.95.11.210]:939 "EHLO mail.lst.de") by vger.kernel.org with ESMTP id S262377AbVFJPBB (ORCPT ); Fri, 10 Jun 2005 11:01:01 -0400 To: akpm@osdl.org Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org XFS will have to look at iocb->private to fix aio+dio. No other filesystem is using the blockdev_direct_IO* end_io callback. Signed-off-by: Christoph Hellwig Index: xfs-2.6.x/include/linux/fs.h =================================================================== --- xfs-2.6.x.orig/include/linux/fs.h 2005-06-10 14:40:34.000000000 +0200 +++ xfs-2.6.x/include/linux/fs.h 2005-06-10 14:42:26.000000000 +0200 @@ -219,6 +219,7 @@ struct iovec; struct nameidata; +struct kiocb; struct pipe_inode_info; struct poll_table_struct; struct kstatfs; @@ -239,7 +240,7 @@ typedef int (get_blocks_t)(struct inode *inode, sector_t iblock, unsigned long max_blocks, struct buffer_head *bh_result, int create); -typedef void (dio_iodone_t)(struct inode *inode, loff_t offset, +typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, ssize_t bytes, void *private); /* @@ -301,7 +302,6 @@ struct page; struct address_space; struct writeback_control; -struct kiocb; struct address_space_operations { int (*writepage)(struct page *page, struct writeback_control *wbc); Index: xfs-2.6.x/fs/direct-io.c =================================================================== --- xfs-2.6.x.orig/fs/direct-io.c 2005-06-10 14:40:34.000000000 +0200 +++ xfs-2.6.x/fs/direct-io.c 2005-06-10 14:42:26.000000000 +0200 @@ -214,7 +214,7 @@ static void dio_complete(struct dio *dio, loff_t offset, ssize_t bytes) { if (dio->end_io && dio->result) - dio->end_io(dio->inode, offset, bytes, dio->map_bh.b_private); + dio->end_io(dio->iocb, offset, bytes, dio->map_bh.b_private); if (dio->lock_type == DIO_LOCKING) up_read(&dio->inode->i_alloc_sem); } Index: xfs-2.6.x/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- xfs-2.6.x.orig/fs/xfs/linux-2.6/xfs_aops.c 2005-06-10 14:40:34.000000000 +0200 +++ xfs-2.6.x/fs/xfs/linux-2.6/xfs_aops.c 2005-06-10 15:53:54.000000000 +0200 @@ -167,11 +167,12 @@ */ STATIC void linvfs_unwritten_convert_direct( - struct inode *inode, + struct kiocb *iocb, loff_t offset, ssize_t size, void *private) { + struct inode *inode = iocb->ki_filp->f_dentry->d_inode; ASSERT(!private || inode == (struct inode *)private); /* private indicates an unwritten extent lay beneath this IO */