btrfs direct-io using iomap
Subsystems (7)
v9 cover btrfs direct-io using iomap
This is an effort to use iomap for direct I/O in btrfs. This would change the call from __blockdev_direct_io() to iomap_dio_rw(). These are remanants of the series which was revoked due to page invalidation errors and adds patches in iomap for proper buffered fallback.
The main objective is to lose the buffer head and use bio defined by iomap code, and hopefully to use more of generic-FS codebase.
These patches are based and tested on vanilla. I have tested it against xfstests.
The tree is available at
https://github.com/goldwynr/linux/tree/btrfs-iomap-dio
Changes since v1
- Incorporated back the efficiency change for inode locking
- Review comments about coding style and git comments
- Merge related patches into one
- Direct read to go through btrfs_direct_IO()
- Removal of no longer used function dio_end_io()
Changes since v2
- aligning iomap offset/length to the position/length of I/O
- Removed btrfs_dio_data
- Removed BTRFS_INODE_READDIO_NEED_LOCK
- Re-incorporating write efficiency changes caused lockdep_assert() in iomap to be triggered, remove that code.
Changes since v3
- Fixed freeze on generic/095. Use iomap_end() to account for failed/incomplete dio instead of btrfs_dio_data
Changes since v4
- moved lockdep_assert_held() to functions calling iomap_dio_rw() This may be called immidiately after calling inode lock and may feel not required, but it seems important.
- Removed comments which are no longer required
- Changed commit comments to make them more appropriate
Changes since v5
- restore inode_dio_wait() in truncate
- Removed lockdep_assert_held() near callers
Changes since v6
- Fixed hangs due to underlying device failures
- Removed the patch to wait while releasing pages
Changes since v7
- Moved reservation into btrfs iomap begin()/end() for correct reservation cleanup in case of device error.
- Merged patches switch to iomap, and adding btrfs_iomap_end() for easier bisection. The switch to iomap would fail in case of dio after buffered writes.
Changes since v8
- Added a flag to iomap_dio_rw() to return zero for buffered fallback
--
Goldwyn
PATCH v9 1/6 iomap: Convert wait_for_completion to flags
From: Goldwyn Rodrigues <[email protected]>
Convert wait_for_completion boolean to flags so we can pass more flags to iomap_dio_rw()
--- fs/ext4/file.c | 11 +++++++++-- fs/gfs2/file.c | 7 ++++--- fs/iomap/direct-io.c | 3 ++- fs/xfs/xfs_file.c | 10 ++++++---- fs/zonefs/super.c | 8 ++++++-- include/linux/iomap.h | 9 ++++++++- 6 files changed, 35 insertions(+), 13 deletions(-)
fs/ext4/file.c +9 -2
@@ -53,6 +53,7 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) {ssize_t ret;struct inode *inode =file_inode (iocb->ki_filp); +int flags =0 ;if (iocb->ki_flags &IOCB_NOWAIT ) {if (!inode_trylock_shared (inode))
@@ -74,8 +75,11 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to)return generic_file_read_iter (iocb, to); } +if (is_sync_kiocb (iocb)) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ; + ret =iomap_dio_rw (iocb, to, &ext4_iomap_ops,NULL , -is_sync_kiocb (iocb)); + flags);inode_unlock_shared (inode);file_accessed (iocb->ki_filp);
@@ -457,6 +461,7 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)const struct iomap_ops *iomap_ops = &ext4_iomap_ops;bool extend = false, unaligned_io = false;bool ilock_shared = true; +int flags =0 ;/* * We initially start with shared inode lock unless it is
@@ -540,10 +545,12 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)ext4_journal_stop (handle); } +if (is_sync_kiocb (iocb) || unaligned_io || extend) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ;if (ilock_shared) iomap_ops = &ext4_iomap_overwrite_ops; ret =iomap_dio_rw (iocb, from, iomap_ops, &ext4_dio_write_ops, -is_sync_kiocb (iocb) || unaligned_io || extend); + flags);if (extend) ret =ext4_handle_inode_extension (inode, offset, ret, count);
fs/gfs2/file.c +4 -3
@@ -767,6 +767,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to)size_t count =iov_iter_count (to);struct gfs2_holder gh;ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;if (!count)return 0 ;/* skip atime */
@@ -777,7 +778,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to) goto out_uninit; ret =iomap_dio_rw (iocb, to, &gfs2_iomap_ops,NULL , -is_sync_kiocb (iocb)); + flags);gfs2_glock_dq (&gh); out_uninit:
@@ -794,6 +795,7 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from)loff_t offset = iocb->ki_pos;struct gfs2_holder gh;ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;/* * Deferred lock, even if its a write, since we do no allocation on
@@ -812,8 +814,7 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from)if (offset + len >i_size_read (&ip->i_inode)) goto out; - ret =iomap_dio_rw (iocb, from, &gfs2_iomap_ops,NULL , -is_sync_kiocb (iocb)); + ret =iomap_dio_rw (iocb, from, &gfs2_iomap_ops,NULL , flags); out:gfs2_glock_dq (&gh);
fs/iomap/direct-io.c +2 -1
@@ -405,7 +405,7 @@ iomap_dio_actor(struct inode *inode, loff_t pos, loff_t length,ssize_t iomap_dio_rw (struct kiocb *iocb,struct iov_iter *iter,const struct iomap_ops *ops,const struct iomap_dio_ops *dops, -bool wait_for_completion) +int dio_flags) {struct address_space *mapping = iocb->ki_filp->f_mapping;struct inode *inode =file_inode (iocb->ki_filp);
@@ -415,6 +415,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,unsigned int flags =IOMAP_DIRECT ;struct blk_plug plug;struct iomap_dio *dio; +bool wait_for_completion = !!(dio_flags &IOMAP_DIOF_WAIT_FOR_COMPLETION );if (!count)return 0 ;
fs/xfs/xfs_file.c +6 -4
@@ -169,6 +169,7 @@ xfs_file_dio_aio_read(struct xfs_inode *ip =XFS_I (file_inode (iocb->ki_filp));size_t count =iov_iter_count (to);ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;trace_xfs_file_direct_read (ip, count, iocb->ki_pos);
@@ -183,8 +184,7 @@ xfs_file_dio_aio_read( }else {xfs_ilock (ip,XFS_IOLOCK_SHARED ); } - ret =iomap_dio_rw (iocb, to, &xfs_read_iomap_ops,NULL , -is_sync_kiocb (iocb)); + ret =iomap_dio_rw (iocb, to, &xfs_read_iomap_ops,NULL , flags);xfs_iunlock (ip,XFS_IOLOCK_SHARED );return ret;
@@ -483,6 +483,7 @@ xfs_file_dio_aio_write(int iolock;size_t count =iov_iter_count (from);struct xfs_buftarg *target =xfs_inode_buftarg (ip); +int flags =0 ;/* DIO must be aligned to device logical sector size */ if ((iocb->ki_pos | count) & target->bt_logical_sectormask)
@@ -546,9 +547,10 @@ xfs_file_dio_aio_write(* If unaligned, this is the only IO in-flight. Wait on it before we * release the iolock to prevent subsequent overlapping IO. */ +if (is_sync_kiocb (iocb) || unaligned_io) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ; ret =iomap_dio_rw (iocb, from, &xfs_direct_write_iomap_ops, - &xfs_dio_write_ops, -is_sync_kiocb (iocb) || unaligned_io); + &xfs_dio_write_ops, flags); out:xfs_iunlock (ip, iolock);
fs/zonefs/super.c +6 -2
@@ -715,7 +715,8 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) ret =zonefs_file_dio_append (iocb, from); else ret =iomap_dio_rw (iocb, from, &zonefs_iomap_ops, - &zonefs_write_dio_ops, sync); + &zonefs_write_dio_ops, + sync ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 );if (zi->i_ztype ==ZONEFS_ZTYPE_SEQ && (ret >0 || ret == -EIOCBQUEUED )) {if (ret >0 )
@@ -814,6 +815,7 @@ static ssize_t zonefs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)struct super_block *sb = inode->i_sb;loff_t isize;ssize_t ret; +int flags =0 ;/* Offline zones cannot be read */ if (unlikely (IS_IMMUTABLE (inode) && !(inode->i_mode &0777 )))
@@ -848,8 +850,10 @@ static ssize_t zonefs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) goto inode_unlock; }file_accessed (iocb->ki_filp); +if (is_sync_kiocb (iocb)) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ; ret =iomap_dio_rw (iocb, to, &zonefs_iomap_ops, - &zonefs_read_dio_ops,is_sync_kiocb (iocb)); + &zonefs_read_dio_ops, flags); }else { ret =generic_file_read_iter (iocb, to);if (ret == -EIO )
include/linux/iomap.h +8 -1
@@ -255,9 +255,16 @@ struct iomap_dio_ops { struct bio *bio, loff_t file_offset); }; +/* +* Flags to pass iomap_dio_rw() +*/ + +/* Wait for completion of DIO */ +#define IOMAP_DIOF_WAIT_FOR_COMPLETION 0x1 +ssize_t iomap_dio_rw (struct kiocb *iocb,struct iov_iter *iter,const struct iomap_ops *ops,const struct iomap_dio_ops *dops, -bool wait_for_completion); +int flags);int iomap_dio_iopoll (struct kiocb *kiocb,bool spin);#ifdef CONFIG_SWAP
Signature · 1 line
2.25.0
Re: [PATCH 1/6] iomap: Convert wait_for_completion to flags
fs/zonefs/super.c static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) · line 719
Quoted 11 lines · Goldwyn Rodrigues
fs/zonefs/super.c +2
-1@@ -715,7 +715,8 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) ret =zonefs_file_dio_append (iocb, from); else ret =iomap_dio_rw (iocb, from, &zonefs_iomap_ops, - &zonefs_write_dio_ops, sync); + &zonefs_write_dio_ops, + sync ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 );
Not a huge fan of that construct above but for zonefs:
Re: [PATCH 1/6] iomap: Convert wait_for_completion to flags
In reply to Goldwyn RodriguesQuoted 145 lines · Goldwyn Rodrigues
From: Goldwyn Rodrigues <[email protected]>
Convert
wait_for_completionboolean to flags so we can pass more flags toiomap_dio_rw()Signed-off-by Goldwyn Rodrigues <[email protected]>--- fs/ext4/file.c | 11 +++++++++-- fs/gfs2/file.c | 7 ++++--- fs/iomap/direct-io.c | 3 ++- fs/xfs/xfs_file.c | 10 ++++++---- fs/zonefs/super.c | 8 ++++++-- include/linux/iomap.h | 9 ++++++++- 6 files changed, 35 insertions(+), 13 deletions(-)fs/ext4/file.c +9
-2@@ -53,6 +53,7 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) {ssize_t ret;struct inode *inode =file_inode (iocb->ki_filp); +int flags =0 ;if (iocb->ki_flags &IOCB_NOWAIT ) {if (!inode_trylock_shared (inode))@@ -74,8 +75,11 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to)return generic_file_read_iter (iocb, to); } +if (is_sync_kiocb (iocb)) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ; + ret =iomap_dio_rw (iocb, to, &ext4_iomap_ops,NULL , -is_sync_kiocb (iocb)); + flags);inode_unlock_shared (inode);file_accessed (iocb->ki_filp);@@ -457,6 +461,7 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)const struct iomap_ops *iomap_ops = &ext4_iomap_ops;bool extend = false, unaligned_io = false;bool ilock_shared = true; +int flags =0 ;/* * We initially start with shared inode lock unless it is @@ -540,10 +545,12 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)ext4_journal_stop (handle); } +if (is_sync_kiocb (iocb) || unaligned_io || extend) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ;if (ilock_shared) iomap_ops = &ext4_iomap_overwrite_ops; ret =iomap_dio_rw (iocb, from, iomap_ops, &ext4_dio_write_ops, -is_sync_kiocb (iocb) || unaligned_io || extend); + flags);if (extend) ret =ext4_handle_inode_extension (inode, offset, ret, count);fs/gfs2/file.c +4
-3@@ -767,6 +767,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to)size_t count =iov_iter_count (to);struct gfs2_holder gh;ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;if (!count)return 0 ;/* skip atime */ @@ -777,7 +778,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to) goto out_uninit; ret =iomap_dio_rw (iocb, to, &gfs2_iomap_ops,NULL , -is_sync_kiocb (iocb)); + flags);gfs2_glock_dq (&gh); out_uninit:@@ -794,6 +795,7 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from)loff_t offset = iocb->ki_pos;struct gfs2_holder gh;ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;/* * Deferred lock, even if its a write, since we do no allocation on @@ -812,8 +814,7 @@ static ssize_t gfs2_file_direct_write(struct kiocb *iocb, struct iov_iter *from)if (offset + len >i_size_read (&ip->i_inode)) goto out; - ret =iomap_dio_rw (iocb, from, &gfs2_iomap_ops,NULL , -is_sync_kiocb (iocb)); + ret =iomap_dio_rw (iocb, from, &gfs2_iomap_ops,NULL , flags); out:gfs2_glock_dq (&gh);fs/iomap/direct-io.c +2
-1@@ -405,7 +405,7 @@ iomap_dio_actor(struct inode *inode, loff_t pos, loff_t length,ssize_t iomap_dio_rw (struct kiocb *iocb,struct iov_iter *iter,const struct iomap_ops *ops,const struct iomap_dio_ops *dops, -bool wait_for_completion) +int dio_flags) {struct address_space *mapping = iocb->ki_filp->f_mapping;struct inode *inode =file_inode (iocb->ki_filp);@@ -415,6 +415,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,unsigned int flags =IOMAP_DIRECT ;struct blk_plug plug;struct iomap_dio *dio; +bool wait_for_completion = !!(dio_flags &IOMAP_DIOF_WAIT_FOR_COMPLETION );if (!count)return 0 ;fs/xfs/xfs_file.c +2
-2@@ -169,6 +169,7 @@ xfs_file_dio_aio_read(struct xfs_inode *ip =XFS_I (file_inode (iocb->ki_filp));size_t count =iov_iter_count (to);ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;trace_xfs_file_direct_read (ip, count, iocb->ki_pos);@@ -183,8 +184,7 @@ xfs_file_dio_aio_read( }else {xfs_ilock (ip,XFS_IOLOCK_SHARED ); } - ret =iomap_dio_rw (iocb, to, &xfs_read_iomap_ops,NULL , -is_sync_kiocb (iocb)); + ret =iomap_dio_rw (iocb, to, &xfs_read_iomap_ops,NULL , flags);xfs_iunlock (ip,XFS_IOLOCK_SHARED );return ret;
fs/xfs/xfs_file.c xfs_file_dio_aio_write( · line 486
Quoted 4 lines
fs/xfs/xfs_file.c +1
-0@@ -483,6 +483,7 @@ xfs_file_dio_aio_write(int iolock;size_t count =iov_iter_count (from);struct xfs_buftarg *target =xfs_inode_buftarg (ip); +int flags =0 ;
The variable names ought to be lined up.
Quoted 54 lines
fs/xfs/xfs_file.c +3
-2/* DIO must be aligned to device logical sector size */ if ((iocb->ki_pos | count) & target->bt_logical_sectormask)@@ -546,9 +547,10 @@ xfs_file_dio_aio_write(* If unaligned, this is the only IO in-flight. Wait on it before we * release the iolock to prevent subsequent overlapping IO. */ +if (is_sync_kiocb (iocb) || unaligned_io) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ; ret =iomap_dio_rw (iocb, from, &xfs_direct_write_iomap_ops, - &xfs_dio_write_ops, -is_sync_kiocb (iocb) || unaligned_io); + &xfs_dio_write_ops, flags); out:xfs_iunlock (ip, iolock);fs/zonefs/super.c +6
-2@@ -715,7 +715,8 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from) ret =zonefs_file_dio_append (iocb, from); else ret =iomap_dio_rw (iocb, from, &zonefs_iomap_ops, - &zonefs_write_dio_ops, sync); + &zonefs_write_dio_ops, + sync ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 );if (zi->i_ztype ==ZONEFS_ZTYPE_SEQ && (ret >0 || ret == -EIOCBQUEUED )) {if (ret >0 )@@ -814,6 +815,7 @@ static ssize_t zonefs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)struct super_block *sb = inode->i_sb;loff_t isize;ssize_t ret; +int flags =0 ;/* Offline zones cannot be read */ if (unlikely (IS_IMMUTABLE (inode) && !(inode->i_mode &0777 )))@@ -848,8 +850,10 @@ static ssize_t zonefs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) goto inode_unlock; }file_accessed (iocb->ki_filp); +if (is_sync_kiocb (iocb)) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ; ret =iomap_dio_rw (iocb, to, &zonefs_iomap_ops, - &zonefs_read_dio_ops,is_sync_kiocb (iocb)); + &zonefs_read_dio_ops, flags); }else { ret =generic_file_read_iter (iocb, to);if (ret == -EIO )include/linux/iomap.h +0
-0
include/linux/iomap.h struct iomap_dio_ops { · line 263
Quoted 9 lines
include/linux/iomap.h +6
-0@@ -255,9 +255,16 @@ struct iomap_dio_ops { struct bio *bio, loff_t file_offset); }; +/* +* Flags to pass iomap_dio_rw() +*/ + +/* Wait for completion of DIO */ +#define IOMAP_DIOF_WAIT_FOR_COMPLETION 0x1
There's a space after "COMPLETION" but before the tabs.
--D
Quoted 11 lines
include/linux/iomap.h +2
-1+ssize_t iomap_dio_rw (struct kiocb *iocb,struct iov_iter *iter,const struct iomap_ops *ops,const struct iomap_dio_ops *dops, -bool wait_for_completion); +int flags);int iomap_dio_iopoll (struct kiocb *kiocb,bool spin);#ifdef CONFIG_SWAP Signature · 1 line
2.25.0
Re: [PATCH 1/6] iomap: Convert wait_for_completion to flags
In reply to Goldwyn RodriguesQuoted 28 lines · Goldwyn Rodrigues
From: Goldwyn Rodrigues <[email protected]>
Convert
wait_for_completionboolean to flags so we can pass more flags toiomap_dio_rw()Signed-off-by Goldwyn Rodrigues <[email protected]>--- fs/ext4/file.c | 11 +++++++++-- fs/gfs2/file.c | 7 ++++--- fs/iomap/direct-io.c | 3 ++- fs/xfs/xfs_file.c | 10 ++++++---- fs/zonefs/super.c | 8 ++++++-- include/linux/iomap.h | 9 ++++++++- 6 files changed, 35 insertions(+), 13 deletions(-)fs/ext4/file.c +1
-0@@ -53,6 +53,7 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) {ssize_t ret;struct inode *inode =file_inode (iocb->ki_filp); +int flags =0 ;if (iocb->ki_flags &IOCB_NOWAIT ) {if (!inode_trylock_shared (inode))
fs/ext4/file.c static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) · line 79
Quoted 5 lines
fs/ext4/file.c +2
-0@@ -74,8 +75,11 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to)return generic_file_read_iter (iocb, to); } +if (is_sync_kiocb (iocb)) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ;
The name of the flag conflates implementation with intent. "wait for completion" is the implementation, "synchronous IO" is the intent.
Can you name this <namespace>_SYNCIO, please? Read further below for comments on the flag namespace issues...
fs/ext4/file.c static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) · line 549
Quoted 5 lines
fs/ext4/file.c +2
-0ext4_journal_stop (handle); } +if (is_sync_kiocb (iocb) || unaligned_io || extend) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ;
Then stuff like this is self documenting:
if (any of this is true)
IO needs to be issued synchronously
Quoted 9 lines
fs/ext4/file.c +1
-0@@ -767,6 +767,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to)size_t count =iov_iter_count (to);struct gfs2_holder gh;ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;if (!count)return 0 ;/* skip atime */
fs/ext4/file.c static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to) · line 781
Quoted 5 lines
fs/ext4/file.c +1
-1@@ -777,7 +778,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to) goto out_uninit; ret =iomap_dio_rw (iocb, to, &gfs2_iomap_ops,NULL , -is_sync_kiocb (iocb)); + flags);
Why do we need a new flags variable here, but not for other conversions that are identical?
Hmmm - you use 3 different methods of calculating flags to pass to iomap_dio_rw() in this patchset. Can you pick one method and use it for all the code? e.g. make all the code look like this:
int flags = 0; .... if (is_sync_kiocb(iocb) flags |= IOMAP_DIOF_SYNCIO; ret = iomap_dio_rw(....., flags); ....
So the setting of the flags is right next to the iomap_dio_rw() call and we don't have to go searching for them?
Quoted 14 lines
fs/iomap/direct-io.c +1
-1@@ -405,7 +405,7 @@ iomap_dio_actor(struct inode *inode, loff_t pos, loff_t length,ssize_t iomap_dio_rw (struct kiocb *iocb,struct iov_iter *iter,const struct iomap_ops *ops,const struct iomap_dio_ops *dops, -bool wait_for_completion) +int dio_flags) {struct address_space *mapping = iocb->ki_filp->f_mapping;struct inode *inode =file_inode (iocb->ki_filp);
fs/iomap/direct-io.c iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · line 418
Quoted 4 lines
fs/iomap/direct-io.c +1
-0@@ -415,6 +415,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,unsigned int flags =IOMAP_DIRECT ;struct blk_plug plug;struct iomap_dio *dio; +bool wait_for_completion = !!(dio_flags &IOMAP_DIOF_WAIT_FOR_COMPLETION );
1. the compiler will squash (x & y) down to a boolean state correctly without needing to add double negatives.
2. I don't like variable names shadowing core kernel API functions (i.e. wait_for_completion()). Especially as this has nothign to do with the completion API...
Quoted 5 lines
include/linux/iomap.h +0
-0
include/linux/iomap.h struct iomap_dio_ops { · line 263
Quoted 9 lines
include/linux/iomap.h +6
-0@@ -255,9 +255,16 @@ struct iomap_dio_ops { struct bio *bio, loff_t file_offset); }; +/* +* Flags to pass iomap_dio_rw() +*/ + +/* Wait for completion of DIO */ +#define IOMAP_DIOF_WAIT_FOR_COMPLETION 0x1
Hmmm. Namespace issues. We already have a IOMAP_DIO_* flags defined for passing to ->end_io. It's going to be confusing having a set of flags with almost exactly the namespace but with an "F" for flags and no indication which iomap operation the flags actually belong to.
This is simples, though:
#define IOMAP_DIO_RWF_SYNCIO (1 << 0)
And it might also be worthwhile renaming the ->endio flags to:
#define IOMAP_DIO_ENDIO_UNWRITTEN (1 << 0)
#define IOMAP_DIO_ENDIO_COW (1 << 1)
So there's no confusion there either.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
Re: [PATCH 1/6] iomap: Convert wait_for_completion to flags
Quoted 32 lines · Dave Chinner
Quoted 31 lines · Goldwyn Rodrigues
From: Goldwyn Rodrigues <[email protected]>
Convert
wait_for_completionboolean to flags so we can pass more flags toiomap_dio_rw()Signed-off-by Goldwyn Rodrigues <[email protected]>--- fs/ext4/file.c | 11 +++++++++-- fs/gfs2/file.c | 7 ++++--- fs/iomap/direct-io.c | 3 ++- fs/xfs/xfs_file.c | 10 ++++++---- fs/zonefs/super.c | 8 ++++++-- include/linux/iomap.h | 9 ++++++++- 6 files changed, 35 insertions(+), 13 deletions(-)fs/ext4/file.c +1
-0@@ -53,6 +53,7 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) {ssize_t ret;struct inode *inode =file_inode (iocb->ki_filp); +int flags =0 ;if (iocb->ki_flags &IOCB_NOWAIT ) {if (!inode_trylock_shared (inode))@@ -74,8 +75,11 @@ static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to)return generic_file_read_iter (iocb, to); }
Quoted 8 lines
fs/ext4/file.c static ssize_t ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to) · line 79
Quoted 2 lines
fs/ext4/file.c +2
-0+if (is_sync_kiocb (iocb)) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ;The name of the flag conflates implementation with intent. "wait for completion" is the implementation, "synchronous IO" is the intent.
Can you name this <namespace>_SYNCIO, please? Read further below for comments on the flag namespace issues...
Yes, sure. I just hope it is not confused with RWF_SYNC.
Quoted 43 lines
fs/ext4/file.c static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) · line 549
Quoted 6 lines
fs/ext4/file.c +2
-0ext4_journal_stop (handle); } +if (is_sync_kiocb (iocb) || unaligned_io || extend) + flags |=IOMAP_DIOF_WAIT_FOR_COMPLETION ;Then stuff like this is self documenting:
if (any of this is true)
IO needs to be issued synchronouslyQuoted 9 lines
fs/ext4/file.c +1
-0@@ -767,6 +767,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to)size_t count =iov_iter_count (to);struct gfs2_holder gh;ssize_t ret; +int flags =is_sync_kiocb (iocb) ?IOMAP_DIOF_WAIT_FOR_COMPLETION :0 ;if (!count)return 0 ;/* skip atime */ fs/ext4/file.c static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to) · line 781
Quoted 5 lines
fs/ext4/file.c +1
-1@@ -777,7 +778,7 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to) goto out_uninit; ret =iomap_dio_rw (iocb, to, &gfs2_iomap_ops,NULL , -is_sync_kiocb (iocb)); + flags);Why do we need a new flags variable here, but not for other conversions that are identical?
Hmmm - you use 3 different methods of calculating flags to pass to
iomap_dio_rw()in this patchset. Can you pick one method and use it for all the code? e.g. make all the code look like this:int flags = 0; .... if (is_sync_kiocb(iocb) flags |= IOMAP_DIOF_SYNCIO; ret = iomap_dio_rw(....., flags); ....
Quoted 3 lines
So the setting of the flags is right next to the
iomap_dio_rw()call and we don't have to go searching for them?
I agree. Will change this.
Quoted 14 lines
Quoted 14 lines
fs/iomap/direct-io.c +1
-1@@ -405,7 +405,7 @@ iomap_dio_actor(struct inode *inode, loff_t pos, loff_t length,ssize_t iomap_dio_rw (struct kiocb *iocb,struct iov_iter *iter,const struct iomap_ops *ops,const struct iomap_dio_ops *dops, -bool wait_for_completion) +int dio_flags) {struct address_space *mapping = iocb->ki_filp->f_mapping;struct inode *inode =file_inode (iocb->ki_filp);
Quoted 9 lines
fs/iomap/direct-io.c iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · line 418
Quoted 5 lines
fs/iomap/direct-io.c +1
-0@@ -415,6 +415,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,unsigned int flags =IOMAP_DIRECT ;struct blk_plug plug;struct iomap_dio *dio; +bool wait_for_completion = !!(dio_flags &IOMAP_DIOF_WAIT_FOR_COMPLETION );1. the compiler will squash (x & y) down to a boolean state correctly without needing to add double negatives.
okay, will change this.
Quoted 3 lines
2. I don't like variable names shadowing core kernel API functions (i.e.
wait_for_completion()). Especially as this has nothign to do with the completion API...
hmm, the change moves the wait_for_completion from function prototype to a derived variable in the function. This should be a separate patch and not combined with this change, if really required. wait_for_completion is also a variable in struct iomap_dio as well.
Quoted 21 lines
Quoted 6 lines
include/linux/iomap.h +0
-0include/linux/iomap.h struct iomap_dio_ops { · line 263
Quoted 9 lines
include/linux/iomap.h +6
-0@@ -255,9 +255,16 @@ struct iomap_dio_ops { struct bio *bio, loff_t file_offset); }; +/* +* Flags to pass iomap_dio_rw() +*/ + +/* Wait for completion of DIO */ +#define IOMAP_DIOF_WAIT_FOR_COMPLETION 0x1Hmmm. Namespace issues. We already have a IOMAP_DIO_* flags defined for passing to ->end_io. It's going to be confusing having a set of flags with almost exactly the namespace but with an "F" for flags and no indication which iomap operation the flags actually belong to.
Quoted 3 lines
This is simples, though:
#define
IOMAP_DIO_RWF_SYNCIO(1 << 0)
Agree with this one.
Quoted 8 lines
And it might also be worthwhile renaming the ->endio flags to:
#define
IOMAP_DIO_ENDIO_UNWRITTEN(1 << 0)
#defineIOMAP_DIO_ENDIO_COW(1 << 1)So there's no confusion there either.
This again should be a separate patch.
I will incorporate the changes relevant to this series.
Signature · 1 line
Goldwyn
PATCH v9 2/6 iomap: IOMAP_DIOF_PGINVALID_FAIL return if page invalidation fails
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
The flag indicates that if the page invalidation fails, it should return back control to the filesystem so it may fallback to buffered mode.
--- fs/iomap/direct-io.c | 8 +++++++- include/linux/iomap.h | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-)
fs/iomap/direct-io.c +7 -1
@@ -484,8 +484,14 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,*/ ret =invalidate_inode_pages2_range (mapping, pos >>PAGE_SHIFT , end >>PAGE_SHIFT ); -if (ret) +if (ret) { +if (dio_flags &IOMAP_DIOF_PGINVALID_FAIL ) { +if (ret == -EBUSY ) + ret =0 ; + goto out_free_dio; + }dio_warn_stale_pagecache (iocb->ki_filp); + } ret =0 ; if (iov_iter_rw(iter) == WRITE && !wait_for_completion &&
include/linux/iomap.h +5 -0
@@ -261,6 +261,11 @@ struct iomap_dio_ops {/* Wait for completion of DIO */ #define IOMAP_DIOF_WAIT_FOR_COMPLETION 0x1 +/* +* Return zero if page invalidation fails, so caller filesystem may fallback +* to buffered I/O +*/ +#define IOMAP_DIOF_PGINVALID_FAIL 0x2 ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, const struct iomap_dio_ops *dops,
Signature · 1 line
2.25.0
Re: [PATCH 2/6] iomap: IOMAP_DIOF_PGINVALID_FAIL return if page invalidation fails
Quoted 6 lines · Goldwyn Rodrigues
From: Goldwyn Rodrigues <[email protected]>
The flag indicates that if the page invalidation fails, it should return back control to the filesystem so it may fallback to buffered mode.
Signed-off-by Goldwyn Rodrigues <[email protected]>
Looks reasonable enough, I suppose...
--D
Quoted 44 lines
--- fs/iomap/direct-io.c | 8 +++++++- include/linux/iomap.h | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-)fs/iomap/direct-io.c +7
-1@@ -484,8 +484,14 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,*/ ret =invalidate_inode_pages2_range (mapping, pos >>PAGE_SHIFT , end >>PAGE_SHIFT ); -if (ret) +if (ret) { +if (dio_flags &IOMAP_DIOF_PGINVALID_FAIL ) { +if (ret == -EBUSY ) + ret =0 ; + goto out_free_dio; + }dio_warn_stale_pagecache (iocb->ki_filp); + } ret =0 ; if (iov_iter_rw(iter) == WRITE && !wait_for_completion &&include/linux/iomap.h +5
-0@@ -261,6 +261,11 @@ struct iomap_dio_ops {/* Wait for completion of DIO */ #define IOMAP_DIOF_WAIT_FOR_COMPLETION 0x1 +/* +* Return zero if page invalidation fails, so caller filesystem may fallback +* to buffered I/O +*/ +#define IOMAP_DIOF_PGINVALID_FAIL 0x2 ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, const struct iomap_dio_ops *dops,Signature · 1 line
2.25.0
Re: [PATCH 2/6] iomap: IOMAP_DIOF_PGINVALID_FAIL return if page invalidation fails
Quoted 45 lines · Darrick J. Wong
Quoted 6 lines · Goldwyn Rodrigues
From: Goldwyn Rodrigues <[email protected]>
The flag indicates that if the page invalidation fails, it should return back control to the filesystem so it may fallback to buffered mode.
Signed-off-by Goldwyn Rodrigues <[email protected]>Looks reasonable enough, I suppose...
Reviewed-by Darrick J. Wong <[email protected]>--D
Quoted 31 lines
--- fs/iomap/direct-io.c | 8 +++++++- include/linux/iomap.h | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-)fs/iomap/direct-io.c +7
-1@@ -484,8 +484,14 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,*/ ret =invalidate_inode_pages2_range (mapping, pos >>PAGE_SHIFT , end >>PAGE_SHIFT ); -if (ret) +if (ret) { +if (dio_flags &IOMAP_DIOF_PGINVALID_FAIL ) { +if (ret == -EBUSY ) + ret =0 ; + goto out_free_dio; + }dio_warn_stale_pagecache (iocb->ki_filp); + } ret =0 ; if (iov_iter_rw(iter) == WRITE && !wait_for_completion &&include/linux/iomap.h +0
-0@@ -261,6 +261,11 @@ struct iomap_dio_ops {
Quoted 7 lines
include/linux/iomap.h struct iomap_dio_ops { · line 268
Quoted 7 lines
include/linux/iomap.h +5
-0/* Wait for completion of DIO */ #define IOMAP_DIOF_WAIT_FOR_COMPLETION 0x1 +/* +* Return zero if page invalidation fails, so caller filesystem may fallback +* to buffered I/O +*/ +#define IOMAP_DIOF_PGINVALID_FAIL 0x2
That's a mouthful of letter salad. :(
Basically, you want the DIO to return a short IO if there is a busy page cache on the inode?
IOWs, you don't want the page cache to become stale as a result of the DIO being executed? So what the caller is actually asking for is that the dio avoids creating stale page cache pages? Hence:
/*
* Direct IO will attempt to keep the page cache coherent by
* invalidating the inode's page cache over the range of the DIO.
* That can fail if something else is actively using the page cache.
* If this happens and the DIO continues, the data in the page
* cache will become stale.
*
* Set this flag if you want the DIO to abort without issuing any IO
* or error if it fails to invalidate the page cache successfully.
* This allows the IO submitter to resubmit the entire IO as a
* buffered IO through the page cache.
*/
#define IOMAP_DIO_RWF_NO_STALE_PAGECACHE (1 << 1)
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v9 3/6 btrfs: switch to iomap_dio_rw() for dio
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
Switch from __blockdev_direct_IO() to iomap_dio_rw(). Rename btrfs_get_blocks_direct() to btrfs_dio_iomap_begin() and use it as iomap_begin() for iomap direct I/O functions. This function allocates and locks all the blocks required for the I/O. btrfs_submit_direct() is used as the submit_io() hook for direct I/O ops.
Since we need direct I/O reads to go through iomap_dio_rw(), we change file_operations.read_iter() to a btrfs_file_read_iter() which calls btrfs_direct_IO() for direct reads and falls back to generic_file_buffered_read() for incomplete reads and buffered reads.
We don't need address_space.direct_IO() anymore so set it to noop. Similarly, we don't need flags used in __blockdev_direct_IO(). iomap is capable of direct I/O reads from a hole, so we don't need to return -ENOENT.
BTRFS direct I/O is now done under i_rwsem, shared in case of reads and exclusive in case of writes. This guards against simultaneous truncates.
Use iomap->iomap_end() to check for failed or incomplete direct I/O:
- for writes, call __endio_write_update_ordered()
- for reads, unlock extents
btrfs_dio_data is now hooked in iomap->private and not current->journal_info. It carries the reservation variable and the amount of data submitted, so we can calculate the amount of data to call __endio_write_update_ordered in case of an error.
This patch removes last use of struct buffer_head from btrfs.
--- fs/btrfs/Kconfig | 1 + fs/btrfs/ctree.h | 1 + fs/btrfs/file.c | 21 +++- fs/btrfs/inode.c | 316 ++++++++++++++++++++++------------------------- 4 files changed, 170 insertions(+), 169 deletions(-)
fs/btrfs/Kconfig +1 -0
@@ -14,6 +14,7 @@ config BTRFS_FS select LZO_DECOMPRESS select ZSTD_COMPRESS select ZSTD_DECOMPRESS + select FS_IOMAP select RAID6_PQ select XOR_BLOCKS select SRCU
fs/btrfs/ctree.h +1 -0
@@ -2933,6 +2933,7 @@ int btrfs_writepage_cow_fixup(struct page *page, u64 start, u64 end);void btrfs_writepage_endio_finish_ordered (struct page *page,u64 start,u64 end,int uptodate);extern const struct dentry_operations btrfs_dentry_operations; +ssize_t btrfs_direct_IO (struct kiocb *iocb,struct iov_iter *iter);/* ioctl.c */ long btrfs_ioctl (struct file *file,unsigned int cmd,unsigned long arg);
fs/btrfs/file.c +19 -2
@@ -1819,7 +1819,7 @@ static ssize_t __btrfs_direct_write(struct kiocb *iocb, struct iov_iter *from)loff_t endbyte;int err; - written =generic_file_direct_write (iocb, from); + written =btrfs_direct_IO (iocb, from);if (written <0 || !iov_iter_count (from))return written;
@@ -3476,9 +3476,26 @@ static int btrfs_file_open(struct inode *inode, struct file *filp)return generic_file_open (inode, filp); } +static ssize_t btrfs_file_read_iter (struct kiocb *iocb,struct iov_iter *to) +{ +ssize_t ret =0 ; + +if (iocb->ki_flags &IOCB_DIRECT ) { +struct inode *inode =file_inode (iocb->ki_filp); + +inode_lock_shared (inode); + ret =btrfs_direct_IO (iocb, to); +inode_unlock_shared (inode); +if (ret <0 ) +return ret; + } + +return generic_file_buffered_read (iocb, to, ret); +} +const struct file_operations btrfs_file_operations = { .llseek = btrfs_file_llseek, - .read_iter = generic_file_read_iter, + .read_iter = btrfs_file_read_iter, .splice_read = generic_file_splice_read, .write_iter = btrfs_file_write_iter, .mmap = btrfs_file_mmap,
fs/btrfs/inode.c +149 -167
498 lines not on this page · raw message
Signature · 1 line
2.25.0
PATCH v9 4/6 fs: remove dio_end_io()
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
Since we removed the last user of dio_end_io(), remove the helper function dio_end_io().
--- fs/direct-io.c | 19 ------------------- include/linux/fs.h | 2 -- 2 files changed, 21 deletions(-)
fs/direct-io.c +0 -19
@@ -386,25 +386,6 @@ static void dio_bio_end_io(struct bio *bio)spin_unlock_irqrestore (&dio->bio_lock, flags); } -/** -* dio_end_io - handle the end io action for the given bio -* @bio: The direct io bio thats being completed -* -* This is meant to be called by any filesystem that uses their own dio_submit_t -* so that the DIO specific endio actions are dealt with after the filesystem -* has done it's completion work. -*/ -void dio_end_io (struct bio *bio) -{ -struct dio *dio = bio->bi_private; - -if (dio->is_async) -dio_bio_end_aio (bio); -else -dio_bio_end_io (bio); -} -EXPORT_SYMBOL_GPL (dio_end_io); - static inline void dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, struct block_device *bdev,
include/linux/fs.h +0 -2
@@ -3202,8 +3202,6 @@ enum { DIO_SKIP_HOLES = 0x02, }; -void dio_end_io (struct bio *bio); - ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, struct block_device *bdev, struct iov_iter *iter, get_block_t get_block,
Signature · 1 line
2.25.0
PATCH v9 5/6 btrfs: remove BTRFS_INODE_READDIO_NEED_LOCK
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
Since we now perform direct reads using i_rwsem, we can remove this inode flag used to co-ordinate unlocked reads.
The truncate call takes i_rwsem. This means it is correctly synchronized with concurrent direct reads.
--- fs/btrfs/btrfs_inode.h | 18 ------------------ fs/btrfs/inode.c | 3 --- 2 files changed, 21 deletions(-)
fs/btrfs/btrfs_inode.h +0 -18
@@ -28,7 +28,6 @@ enum {BTRFS_INODE_NEEDS_FULL_SYNC ,BTRFS_INODE_COPY_EVERYTHING ,BTRFS_INODE_IN_DELALLOC_LIST , -BTRFS_INODE_READDIO_NEED_LOCK ,BTRFS_INODE_HAS_PROPS , BTRFS_INODE_SNAPSHOT_FLUSH, };
@@ -313,23 +312,6 @@ struct btrfs_dio_private {u8 csums[]; }; -/* -* Disable DIO read nolock optimization, so new dio readers will be forced -* to grab i_mutex. It is used to avoid the endless truncate due to -* nonlocked dio read. -*/ -static inline void btrfs_inode_block_unlocked_dio (struct btrfs_inode *inode) -{ -set_bit (BTRFS_INODE_READDIO_NEED_LOCK , &inode->runtime_flags); -smp_mb (); -} - -static inline void btrfs_inode_resume_unlocked_dio (struct btrfs_inode *inode) -{ -smp_mb__before_atomic (); -clear_bit (BTRFS_INODE_READDIO_NEED_LOCK , &inode->runtime_flags); -} -/* Array of bytes with variable length, hexadecimal format 0x1234 */ #define CSUM_FMT "0x%*phN"#define CSUM_FMT_VALUE (size, bytes) size, bytes
fs/btrfs/inode.c +0 -3
@@ -4811,10 +4811,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)truncate_setsize (inode, newsize); -/* Disable nonlocked read DIO to avoid the endless truncate */ -btrfs_inode_block_unlocked_dio (BTRFS_I (inode));inode_dio_wait (inode); -btrfs_inode_resume_unlocked_dio (BTRFS_I (inode)); ret =btrfs_truncate (inode, newsize == oldsize);if (ret && inode->i_nlink) {
Signature · 1 line
2.25.0
PATCH v9 6/6 btrfs: split btrfs_direct_IO to read and write part
In reply to Goldwyn RodriguesFrom: Goldwyn Rodrigues <[email protected]>
The read and write versions don't have anything in common except for the call to iomap_dio_rw. So split this function, and merge each half into its only caller.
Originally proposed by Christoph Hellwig <[email protected]>
--- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 95 +++++++++++++++++++++++++++++++++++++++++++----- fs/btrfs/inode.c | 86 +------------------------------------------ 3 files changed, 90 insertions(+), 94 deletions(-)
fs/btrfs/ctree.h +3 -0
@@ -28,6 +28,7 @@#include <linux/dynamic_debug.h> #include <linux/refcount.h> #include <linux/crc32c.h> +#include <linux/iomap.h> #include "extent-io-tree.h" #include "extent_io.h" #include "extent_map.h"
@@ -2934,6 +2935,8 @@ void btrfs_writepage_endio_finish_ordered(struct page *page, u64 start, u64 end, int uptodate);extern const struct dentry_operations btrfs_dentry_operations;ssize_t btrfs_direct_IO (struct kiocb *iocb,struct iov_iter *iter); +extern const struct iomap_ops btrfs_dio_iomap_ops; +extern const struct iomap_dio_ops btrfs_dops;/* ioctl.c */ long btrfs_ioctl (struct file *file,unsigned int cmd,unsigned long arg);
fs/btrfs/file.c +85 -10
129 lines not on this page · raw message
fs/btrfs/inode.c +2 -84
105 lines not on this page · raw message
Signature · 1 line
2.25.0