pass iocb to dio_iodone_t
Subsystems (2)
PATCH 1/1 pass iocb to dio_iodone_t
XFS will have to look at iocb->private to fix aio+dio. No other filesystem is using the blockdev_direct_IO* end_io callback.
include/linux/fs.h +2 -2
@@ -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);
fs/direct-io.c +1 -1
@@ -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); }
fs/xfs/linux-2.6/xfs_aops.c +2 -1
@@ -167,11 +167,12 @@*/ STATIC voidlinvfs_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 */
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
Quoted 71 lines · Christoph Hellwig
XFS will have to look at
iocb->privateto fix aio+dio. No other filesystem is using the blockdev_direct_IO*end_iocallback.Signed-off-by Christoph Hellwig <[email protected]>Index:
xfs-2.6.x/include/linux/fs.h
===================================================================include/linux/fs.h +2
-2@@ -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
===================================================================fs/direct-io.c +1
-1@@ -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
===================================================================fs/xfs/linux-2.6/xfs_aops.c +2
-2@@ -167,11 +167,12 @@*/ STATIC voidlinvfs_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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line · Badari Pulavarty
Just curious on why XFS needs
end_iocallback ?
To convert unwritten extents to written extents.
Quoted 2 lines
And also, why is
dio->inode!=iocb->ki_filp->f_dentry->d_inodefor XFS ?
It's not.
Quoted 9 lines · Christoph Hellwig
Quoted 1 line · Badari Pulavarty
Just curious on why XFS needs
end_iocallback ?To convert unwritten extents to written extents.
Quoted 2 lines
And also, why is
dio->inode!=iocb->ki_filp->f_dentry->d_inodefor 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
Quoted 6 lines · Badari Pulavarty
Quoted 5 lines · Christoph Hellwig
Quoted 1 line · Badari Pulavarty
Just curious on why XFS needs
end_iocallback ?To convert unwritten extents to written extents.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
And also, why is
dio->inode!=iocb->ki_filp->f_dentry->d_inodefor 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.
Quoted 4 lines
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.