* [PATCH] pass iocb to dio_iodone_t
@ 2005-06-10 15:00 Christoph Hellwig
2005-06-10 15:25 ` Badari Pulavarty
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2005-06-10 15:00 UTC (permalink / raw)
To: akpm; +Cc: linux-fsdevel
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 <hch@lst.de>
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 */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pass iocb to dio_iodone_t
2005-06-10 15:00 [PATCH] pass iocb to dio_iodone_t Christoph Hellwig
@ 2005-06-10 15:25 ` Badari Pulavarty
2005-06-10 15:48 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Badari Pulavarty @ 2005-06-10 15:25 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Andrew Morton, linux-fsdevel
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 <hch@lst.de>
>
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pass iocb to dio_iodone_t
2005-06-10 15:48 ` Christoph Hellwig
@ 2005-06-10 15:37 ` Badari Pulavarty
2005-06-10 16:03 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Badari Pulavarty @ 2005-06-10 15:37 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Andrew Morton, linux-fsdevel
On Fri, 2005-06-10 at 08:48, Christoph Hellwig wrote:
> On Fri, Jun 10, 2005 at 08:25:01AM -0700, Badari Pulavarty wrote:
> > Just curious on why XFS needs end_io callback ?
>
> To convert unwritten extents to written extents.
>
> > And also, why is dio->inode != iocb->ki_filp->f_dentry->d_inode
> > for XFS ?
>
> It's not.
Hmm.. Then, I don't understand your patch. Is there a follow up
patch to make use of iocb in linvfs_unwritten_convert_direct() ?
All you did was, to pass "iocb" instead of "inode". Then got
inode from "iocb". (which you claimed they are same).
Am I miss understanding something ?
Thanks,
Badari
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pass iocb to dio_iodone_t
2005-06-10 15:25 ` Badari Pulavarty
@ 2005-06-10 15:48 ` Christoph Hellwig
2005-06-10 15:37 ` Badari Pulavarty
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2005-06-10 15:48 UTC (permalink / raw)
To: Badari Pulavarty; +Cc: Christoph Hellwig, Andrew Morton, linux-fsdevel
On Fri, Jun 10, 2005 at 08:25:01AM -0700, Badari Pulavarty wrote:
> Just curious on why XFS needs end_io callback ?
To convert unwritten extents to written extents.
> And also, why is dio->inode != iocb->ki_filp->f_dentry->d_inode
> for XFS ?
It's not.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pass iocb to dio_iodone_t
2005-06-10 15:37 ` Badari Pulavarty
@ 2005-06-10 16:03 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2005-06-10 16:03 UTC (permalink / raw)
To: Badari Pulavarty; +Cc: Christoph Hellwig, Andrew Morton, linux-fsdevel
On Fri, Jun 10, 2005 at 08:37:49AM -0700, Badari Pulavarty wrote:
> On Fri, 2005-06-10 at 08:48, Christoph Hellwig wrote:
> > On Fri, Jun 10, 2005 at 08:25:01AM -0700, Badari Pulavarty wrote:
> > > Just curious on why XFS needs end_io callback ?
> >
> > To convert unwritten extents to written extents.
> >
> > > And also, why is dio->inode != iocb->ki_filp->f_dentry->d_inode
> > > for XFS ?
> >
> > It's not.
>
> Hmm.. Then, I don't understand your patch. Is there a follow up
> patch to make use of iocb in linvfs_unwritten_convert_direct() ?
Yes. It'll go in through the the normal xfs tree merges.
> All you did was, to pass "iocb" instead of "inode". Then got
> inode from "iocb". (which you claimed they are same).
>
> Am I miss understanding something ?
No, I should have mentioned that this is just a trivial infrastructure
bit, the actual fix is a little more complicated.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-06-10 16:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-10 15:00 [PATCH] pass iocb to dio_iodone_t Christoph Hellwig
2005-06-10 15:25 ` Badari Pulavarty
2005-06-10 15:48 ` Christoph Hellwig
2005-06-10 15:37 ` Badari Pulavarty
2005-06-10 16:03 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).