From mboxrd@z Thu Jan 1 00:00:00 1970 From: Badari Pulavarty Subject: Re: [PATCH] pass iocb to dio_iodone_t Date: 10 Jun 2005 08:25:01 -0700 Message-ID: <1118417101.4301.315.camel@dyn9047017072.beaverton.ibm.com> References: <20050610150052.GA1632@lst.de> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Andrew Morton , linux-fsdevel Return-path: Received: from e3.ny.us.ibm.com ([32.97.182.143]:52888 "EHLO e3.ny.us.ibm.com") by vger.kernel.org with ESMTP id S262587AbVFJPrb (ORCPT ); Fri, 10 Jun 2005 11:47:31 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e3.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j5AFlVAZ017493 for ; Fri, 10 Jun 2005 11:47:31 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j5AFlVHJ192172 for ; Fri, 10 Jun 2005 11:47:31 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j5AFlUOP007954 for ; Fri, 10 Jun 2005 11:47:31 -0400 To: Christoph Hellwig In-Reply-To: <20050610150052.GA1632@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Just curious on why XFS needs end_io callback ? And also, why is dio->inode != iocb->ki_filp->f_dentry->d_inode for XFS ? Thanks, Badari On Fri, 2005-06-10 at 08:00, Christoph Hellwig wrote: > 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 */ > - > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >