FAILED: patch "[PATCH] iomap: consolidate bio submission" failed to apply to 7.1-stable tree
Subsystems (6)
[email protected]
maintainerThe patch below does not apply to the 7.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.1.y
git checkout FETCH_HEAD
git cherry-pick -x 044472d5ee7d71f918fa3f61bd65e4933a0c006e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026071548-sinister-joystick-e062@gregkh' --subject-prefix 'PATCH 7.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 044472d5ee7d71f918fa3f61bd65e4933a0c006e Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <[email protected]>
Date: Mon, 29 Jun 2026 14:17:38 +0200
Subject: [PATCH] iomap: consolidate bio submission
Add a iomap_bio_submit_read_endio helper factored out of iomap_bio_submit_read to that all ->submit_read implementations for iomap_read_ops that use iomap_bio_read_folio_range can shared the logic.
Right now that logic is mostly trivial, but already has a bug for XFS because the XFS version is too trivial: file system integrity validation needs a workqueue context and thus can't happen from the default iomap bi_end_io I/O handler. Unfortunately the iomap refactoring just before fs integrity landed moved code around here and the call go misplaced, meaning it never got called. The PI information still is verified by the block layer, but the offloading is less efficient (and the future userspace interface can't get at it).
fs/exfat/iomap.c +1 -4
@@ -253,10 +253,7 @@ static void exfat_iomap_read_end_io(struct bio *bio)static void exfat_iomap_bio_submit_read (const struct iomap_iter *iter,struct iomap_read_folio_ctx *ctx) { -struct bio *bio = ctx->read_ctx; - - bio->bi_end_io = exfat_iomap_read_end_io; -submit_bio (bio); +iomap_bio_submit_read_endio (iter, ctx, exfat_iomap_read_end_io); }const struct iomap_read_ops exfat_iomap_bio_read_ops = {
fs/iomap/bio.c +10 -3
@@ -78,15 +78,23 @@ u32 iomap_finish_ioend_buffered_read(struct iomap_ioend *ioend)return __iomap_read_end_io (&ioend->io_bio, ioend->io_error); } -static void iomap_bio_submit_read (const struct iomap_iter *iter, -struct iomap_read_folio_ctx *ctx) +void iomap_bio_submit_read_endio (const struct iomap_iter *iter, +struct iomap_read_folio_ctx *ctx,bio_end_io_t end_io) {struct bio *bio = ctx->read_ctx; + bio->bi_end_io = end_io;if (iter->iomap.flags &IOMAP_F_INTEGRITY )fs_bio_integrity_alloc (bio);submit_bio (bio); } +EXPORT_SYMBOL_GPL (iomap_bio_submit_read_endio); + +static void iomap_bio_submit_read (const struct iomap_iter *iter, +struct iomap_read_folio_ctx *ctx) +{ +return iomap_bio_submit_read_endio (iter, ctx, iomap_read_end_io); +}static struct bio_set *iomap_read_bio_set (struct iomap_read_folio_ctx *ctx) {
@@ -127,7 +135,6 @@ static void iomap_read_alloc_bio(const struct iomap_iter *iter,if (ctx->rac) bio->bi_opf |=REQ_RAHEAD ; bio->bi_iter.bi_sector =iomap_sector (iomap, iter->pos); - bio->bi_end_io = iomap_read_end_io;bio_add_folio_nofail (bio, folio, plen,offset_in_folio (folio, iter->pos)); ctx->read_ctx = bio;
fs/ntfs/aops.c +2 -4
@@ -38,11 +38,9 @@ static void ntfs_iomap_read_end_io(struct bio *bio) }static void ntfs_iomap_bio_submit_read (const struct iomap_iter *iter, -struct iomap_read_folio_ctx *ctx) +struct iomap_read_folio_ctx *ctx) { -struct bio *bio = ctx->read_ctx; - bio->bi_end_io = ntfs_iomap_read_end_io; -submit_bio (bio); +iomap_bio_submit_read_endio (iter, ctx, ntfs_iomap_read_end_io); }static const struct iomap_read_ops ntfs_iomap_bio_read_ops = {
fs/ntfs3/inode.c +1 -4
@@ -608,10 +608,7 @@ static void ntfs_iomap_read_end_io(struct bio *bio)static void ntfs_iomap_bio_submit_read (const struct iomap_iter *iter,struct iomap_read_folio_ctx *ctx) { -struct bio *bio = ctx->read_ctx; - - bio->bi_end_io = ntfs_iomap_read_end_io; -submit_bio (bio); +iomap_bio_submit_read_endio (iter, ctx, ntfs_iomap_read_end_io); }static const struct iomap_read_ops ntfs_iomap_bio_read_ops = {
fs/xfs/xfs_aops.c +1 -2
@@ -764,8 +764,7 @@ xfs_bio_submit_read(/* defer read completions to the ioend workqueue */ iomap_init_ioend (iter->inode, bio, ctx->read_ctx_file_offset,0 ); - bio->bi_end_io = xfs_end_bio; -submit_bio (bio); +iomap_bio_submit_read_endio (iter, ctx, xfs_end_bio); }static const struct iomap_read_ops xfs_iomap_read_ops = {
include/linux/iomap.h +2 -0
@@ -622,6 +622,8 @@ extern struct bio_set iomap_ioend_bioset;#ifdef CONFIG_BLOCK int iomap_bio_read_folio_range (const struct iomap_iter *iter,struct iomap_read_folio_ctx *ctx,size_t plen); +void iomap_bio_submit_read_endio (const struct iomap_iter *iter, +struct iomap_read_folio_ctx *ctx,bio_end_io_t end_io);extern const struct iomap_read_ops iomap_bio_read_ops;
Sasha Levin
maintainerPATCH 1/5 exfat: replace unsafe macros with static inline functions
From: Namjae Jeon <[email protected]>
[ Upstream commit f07db38084dc45162d5fe2871ed72674ddc0f9ae ]
The current exFAT driver relies on various macros for unit conversions between clusters, blocks, sectors, and directory entries. These macros are structurally unsafe as they lack type enforcement and are prone to potential integer overflows during bit-shift operations, especially on 64-bit architectures. Replace all arithmetic macros with static inline functions to provide strict type checking and explicit casting.
Stable-dep-of: 044472d5ee7d ("iomap: consolidate bio submission")
--- fs/exfat/balloc.c | 2 +- fs/exfat/dir.c | 48 ++++++++--------- fs/exfat/exfat_fs.h | 122 ++++++++++++++++++++++++++++++++------------ fs/exfat/fatent.c | 4 +- fs/exfat/file.c | 8 +-- fs/exfat/inode.c | 19 +++---- fs/exfat/namei.c | 26 +++++----- fs/exfat/super.c | 4 +- 8 files changed, 147 insertions(+), 86 deletions(-)
fs/exfat/balloc.c +1 -1
@@ -112,7 +112,7 @@ static int exfat_allocate_bitmap(struct super_block *sb, }if (exfat_test_bitmap_range (sb, sbi->map_clu, -EXFAT_B_TO_CLU_ROUND_UP (map_size, sbi)) == false) +exfat_bytes_to_cluster_round_up (sbi, map_size)) == false) goto err_out;return 0 ;
fs/exfat/dir.c +25 -23
149 lines not on this page · raw message
fs/exfat/exfat_fs.h +89 -33
140 lines not on this page · raw message
fs/exfat/fatent.c +2 -2
@@ -412,8 +412,8 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)if (IS_DIRSYNC (dir))return sync_blockdev_range (sb->s_bdev, -EXFAT_BLK_TO_B (blknr, sb), -EXFAT_BLK_TO_B (last_blknr, sb) -1 ); +exfat_block_to_bytes (sb, blknr), +exfat_block_to_bytes (sb, last_blknr) -1 );return 0 ; }
fs/exfat/file.c +4 -4
@@ -33,9 +33,9 @@ static int exfat_cont_expand(struct inode *inode, loff_t size)if (ret)return ret; - num_clusters =EXFAT_B_TO_CLU (exfat_ondisk_size (inode), sbi); + num_clusters =exfat_bytes_to_cluster (sbi,exfat_ondisk_size (inode));/* integer overflow is already checked in inode_newsize_ok(). */ - new_num_clusters =EXFAT_B_TO_CLU_ROUND_UP (size, sbi); + new_num_clusters =exfat_bytes_to_cluster_round_up (sbi, size);if (new_num_clusters == num_clusters) goto out;
@@ -200,8 +200,8 @@ int __exfat_truncate(struct inode *inode)exfat_set_volume_dirty (sb); - num_clusters_new =EXFAT_B_TO_CLU_ROUND_UP (i_size_read (inode), sbi); - num_clusters_phys =EXFAT_B_TO_CLU (exfat_ondisk_size (inode), sbi); + num_clusters_new =exfat_bytes_to_cluster_round_up (sbi,i_size_read (inode)); + num_clusters_phys =exfat_bytes_to_cluster (sbi,exfat_ondisk_size (inode));exfat_chain_set (&clu, ei->start_clu, num_clusters_phys, ei->flags);
fs/exfat/inode.c +10 -9
@@ -135,7 +135,7 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,unsigned int local_clu_offset = clu_offset;unsigned int num_to_be_allocated =0 , num_clusters; - num_clusters =EXFAT_B_TO_CLU (exfat_ondisk_size (inode), sbi); + num_clusters =exfat_bytes_to_cluster (sbi,exfat_ondisk_size (inode));if (clu_offset >= num_clusters) num_to_be_allocated = clu_offset - num_clusters +1 ;
@@ -216,7 +216,8 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset, *clu = new_clu.dir; - inode->i_blocks +=EXFAT_CLU_TO_B (num_to_be_allocated, sbi) >>9 ; + inode->i_blocks += +exfat_cluster_to_sectors (sbi, num_to_be_allocated);/* * Move *clu pointer along FAT chains (hole care) because the
@@ -254,12 +255,12 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,mutex_lock (&sbi->s_lock); i_size =i_size_read (inode); - last_block =EXFAT_B_TO_BLK_ROUND_UP (i_size, sb); + last_block =exfat_bytes_to_block_round_up (sb, i_size);if (iblock >= last_block && !create) goto done;/* Is this block already allocated? */ - count =EXFAT_B_TO_CLU_ROUND_UP (bh_result->b_size, sbi); + count =exfat_bytes_to_cluster_round_up (sbi, bh_result->b_size); err =exfat_map_cluster (inode, iblock >> sbi->sect_per_clus_bits, &cluster, &count, create);if (err) {
@@ -296,9 +297,9 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,* care the last nested block if valid_size is not equal to i_size. */ if (i_size == ei->valid_size || create || !bh_result->b_folio) - valid_blks =EXFAT_B_TO_BLK_ROUND_UP (ei->valid_size, sb); + valid_blks =exfat_bytes_to_block_round_up (sb, ei->valid_size);else - valid_blks =EXFAT_B_TO_BLK (ei->valid_size, sb); + valid_blks =exfat_bytes_to_block (sb, ei->valid_size);/* The range has been fully written, map it */ if (iblock + max_blocks < valid_blks)
@@ -313,7 +314,7 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,/* The area has not been written, map and mark as new for create case */ if (create) {set_buffer_new (bh_result); - ei->valid_size =EXFAT_BLK_TO_B (iblock + max_blocks, sb); + ei->valid_size =exfat_block_to_bytes (sb, iblock + max_blocks);mark_inode_dirty (inode); goto done; }
@@ -343,7 +344,7 @@ static int exfat_get_block(struct inode *inode, sector_t iblock, goto done; } - pos =EXFAT_BLK_TO_B (iblock, sb); + pos =exfat_block_to_bytes (sb, iblock); size = ei->valid_size - pos; addr =folio_address (bh_result->b_folio) +offset_in_folio (bh_result->b_folio, pos);
@@ -374,7 +375,7 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,*/ clear_buffer_mapped (bh_result); done: - bh_result->b_size =EXFAT_BLK_TO_B (max_blocks, sb); + bh_result->b_size =exfat_block_to_bytes (sb, max_blocks);if (err <0 )clear_buffer_mapped (bh_result); unlock_ret:
fs/exfat/namei.c +14 -12
@@ -208,7 +208,7 @@ static int exfat_search_empty_slot(struct super_block *sb,int dentries_per_clu;struct exfat_chain clu;struct exfat_sb_info *sbi =EXFAT_SB (sb); -int total_entries =EXFAT_CLU_TO_DEN (p_dir->size, sbi); +unsigned int total_entries =exfat_cluster_to_dentries (sbi, p_dir->size); dentries_per_clu = sbi->dentries_per_clu;
@@ -266,7 +266,7 @@ static int exfat_search_empty_slot(struct super_block *sb,static int exfat_check_max_dentries (struct inode *inode) { -if (EXFAT_B_TO_DEN (i_size_read (inode)) >=MAX_EXFAT_DENTRIES ) { +if (exfat_bytes_to_dentries (i_size_read (inode)) >=MAX_EXFAT_DENTRIES ) {/* * exFAT spec allows a dir to grow up to 8388608(256MB) * dentries
@@ -314,7 +314,8 @@ int exfat_find_empty_entry(struct inode *inode, }exfat_chain_set (p_dir, ei->start_clu, -EXFAT_B_TO_CLU (i_size_read (inode), sbi), ei->flags); +exfat_bytes_to_cluster (sbi,i_size_read (inode)), + ei->flags);while ((dentry =exfat_search_empty_slot (sb, &hint_femp, p_dir, num_entries, es)) <0 ) {
@@ -375,7 +376,7 @@ int exfat_find_empty_entry(struct inode *inode, hint_femp.cur.size++; p_dir->size++; - size =EXFAT_CLU_TO_B (p_dir->size, sbi); + size =exfat_cluster_to_bytes (sbi, p_dir->size);/* directory inode should be updated in here */ i_size_write (inode, size);
@@ -604,7 +605,7 @@ static int exfat_find(struct inode *dir, const struct qstr *qname,return ret;exfat_chain_set (&cdir, ei->start_clu, -EXFAT_B_TO_CLU (i_size_read (dir), sbi), ei->flags); +exfat_bytes_to_cluster (sbi,i_size_read (dir)), ei->flags);/* check the validation of hint_stat and initialize it if required */ if (ei->version != (inode_peek_iversion_raw (dir) &0xffffffff )) {
@@ -681,7 +682,7 @@ static int exfat_find(struct inode *dir, const struct qstr *qname,return -EIO ; } -if (unlikely (EXFAT_B_TO_CLU_ROUND_UP (info->size, sbi) > sbi->used_clusters)) { +if (unlikely (exfat_bytes_to_cluster_round_up (sbi, info->size) > sbi->used_clusters)) {exfat_fs_error (sb,"data size is invalid(%lld)" , info->size);return -EIO ; }
@@ -695,7 +696,8 @@ static int exfat_find(struct inode *dir, const struct qstr *qname,if (info->type ==TYPE_DIR ) {exfat_chain_set (&cdir, info->start_clu, -EXFAT_B_TO_CLU (info->size, sbi), info->flags); +exfat_bytes_to_cluster (sbi, info->size), + info->flags); count =exfat_count_dir_entries (sb, &cdir);if (count <0 )return -EIO ;
@@ -951,7 +953,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) }exfat_chain_set (&clu_to_free, ei->start_clu, -EXFAT_B_TO_CLU_ROUND_UP (i_size_read (inode), sbi), ei->flags); +exfat_bytes_to_cluster_round_up (sbi,i_size_read (inode)), ei->flags); err =exfat_check_dir_empty (sb, &clu_to_free);if (err) {
@@ -1207,8 +1209,8 @@ static int __exfat_rename(struct inode *old_parent_inode, new_clu.dir = new_ei->start_clu; new_clu.size = -EXFAT_B_TO_CLU_ROUND_UP (i_size_read (new_inode), - sbi); +exfat_bytes_to_cluster_round_up (sbi, +i_size_read (new_inode)); new_clu.flags = new_ei->flags; ret =exfat_check_dir_empty (sb, &new_clu);
@@ -1252,8 +1254,8 @@ static int __exfat_rename(struct inode *old_parent_inode,struct exfat_chain new_clu_to_free;exfat_chain_set (&new_clu_to_free, new_ei->start_clu, -EXFAT_B_TO_CLU_ROUND_UP (i_size_read (new_inode), - sbi), new_ei->flags); +exfat_bytes_to_cluster_round_up (sbi,i_size_read (new_inode)), + new_ei->flags);if (exfat_free_cluster (new_inode, &new_clu_to_free)) {/* just set I/O error only */
fs/exfat/super.c +2 -2
@@ -369,7 +369,7 @@ static int exfat_read_root(struct inode *inode, struct exfat_chain *root_clu) ei->hint_stat.clu = sbi->root_dir; ei->hint_femp.eidx =EXFAT_HINT_NONE ; -i_size_write (inode,EXFAT_CLU_TO_B (root_clu->size, sbi)); +i_size_write (inode,exfat_cluster_to_bytes (sbi, root_clu->size)); num_subdirs =exfat_count_dir_entries (sb, root_clu);if (num_subdirs <0 )
@@ -538,7 +538,7 @@ static int exfat_read_boot_sector(struct super_block *sb)* machines. */ sb->s_maxbytes =min (MAX_LFS_FILESIZE , -EXFAT_CLU_TO_B ((loff_t )EXFAT_MAX_NUM_CLUSTER , sbi)); +exfat_cluster_to_bytes (sbi, (loff_t )EXFAT_MAX_NUM_CLUSTER ));/* check logical sector size */ if (exfat_calibrate_blocksize (sb,1 << p_boot->sect_size_bits))
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/5 exfat: add balloc parameter to exfat_map_cluster() for iomap support
From: Namjae Jeon <[email protected]>
[ Upstream commit 3474416bb9abafca2e79b7ff700a100b7e8bc766 ]
In preparation for supporting the iomap infrastructure, we need to know whether a new cluster was allocated or not in exfat_map_cluster().
Add an optional 'bool *balloc' output parameter. When a new cluster is allocated, *balloc is set to true. Pass NULL from exfat_get_block() to preserve the existing behavior.
Stable-dep-of: 044472d5ee7d ("iomap: consolidate bio submission")
--- fs/exfat/inode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/exfat/inode.c +5 -2
@@ -124,7 +124,8 @@ void exfat_sync_inode(struct inode *inode)* *clu = (~0), if it's unable to allocate a new cluster */ static int exfat_map_cluster (struct inode *inode,unsigned int clu_offset, -unsigned int *clu,unsigned int *count,int create) +unsigned int *clu,unsigned int *count,int create, +bool *balloc) {int ret;unsigned int last_clu;
@@ -229,6 +230,8 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,if (exfat_cluster_walk (sb, clu, num_to_be_allocated -1 , ei->flags))return -EIO ; *count =1 ; +if (balloc) + *balloc = true; }/* hint information */
@@ -262,7 +265,7 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,/* Is this block already allocated? */ count =exfat_bytes_to_cluster_round_up (sbi, bh_result->b_size); err =exfat_map_cluster (inode, iblock >> sbi->sect_per_clus_bits, - &cluster, &count, create); + &cluster, &count, create,NULL );if (err) {if (err != -ENOSPC ) exfat_fs_error_ratelimit(sb,
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 3/5 exfat: add data_start_bytes and exfat_cluster_to_phys_bytes() helper
In reply to Sasha LevinFrom: Namjae Jeon <[email protected]>
[ Upstream commit 3b9450beeb961c7ddf4cccddba37fcfa6d1fcb7a ]
This caches the data area start offset in bytes (data_start_bytes) and introduces a helper function exfat_cluster_to_phys_bytes() to compute the physical byte position of a given cluster.
Stable-dep-of: 044472d5ee7d ("iomap: consolidate bio submission")
--- fs/exfat/exfat_fs.h | 8 ++++++++ fs/exfat/super.c | 1 + 2 files changed, 9 insertions(+)
fs/exfat/exfat_fs.h +8 -0
@@ -227,6 +227,7 @@ struct exfat_sb_info {unsigned long long FAT1_start_sector;/* FAT1 start sector */ unsigned long long FAT2_start_sector;/* FAT2 start sector */ unsigned long long data_start_sector;/* data area start sector */ +unsigned long long data_start_bytes;unsigned int num_FAT_sectors;/* num of FAT sectors */ unsigned int root_dir;/* root dir cluster */ unsigned int dentries_per_clu;/* num of dentries per cluster */
@@ -400,6 +401,13 @@ static inline loff_t exfat_ondisk_size(const struct inode *inode)return ((loff_t )inode->i_blocks) <<9 ; } +static inline loff_t exfat_cluster_to_phys_bytes (struct exfat_sb_info *sbi, +unsigned int clus) +{ +return ((loff_t)(clus -EXFAT_RESERVED_CLUSTERS ) << sbi->cluster_size_bits) + + sbi->data_start_bytes; +} +/* * helpers for cluster size to byte conversion. */
fs/exfat/super.c +1 -0
@@ -499,6 +499,7 @@ static int exfat_read_boot_sector(struct super_block *sb)if (p_boot->num_fats ==2 ) sbi->FAT2_start_sector += sbi->num_FAT_sectors; sbi->data_start_sector =le32_to_cpu (p_boot->clu_offset); + sbi->data_start_bytes = sbi->data_start_sector << p_boot->sect_size_bits; sbi->num_sectors =le64_to_cpu (p_boot->vol_length);/* because the cluster index starts with 2 */ sbi->num_clusters = le32_to_cpu(p_boot->clu_count) +
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 4/5 exfat: fix implicit declaration of brelse()
In reply to Sasha LevinFrom: Namjae Jeon <[email protected]>
[ Upstream commit f0d1b2e1e02c11e29c953f22a485449e3da2a575 ]
exfat_cluster_walk() calls brelse(bh) without including the header that declares the function, causing the following build error:
fs/exfat/exfat_fs.h:542:9: error: implicit declaration of function ‘brelse’ [-Werror=implicit-function-declaration]
Fix this by adding the missing buffer_head.h in exfat_fs.h.
Stable-dep-of: 044472d5ee7d ("iomap: consolidate bio submission")
--- fs/exfat/exfat_fs.h | 1 + 1 file changed, 1 insertion(+)
fs/exfat/exfat_fs.h +1 -0
@@ -12,6 +12,7 @@#include <linux/blkdev.h> #include <linux/backing-dev.h> #include <uapi/linux/exfat.h> +#include <linux/buffer_head.h> #define EXFAT_ROOT_INO 1
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 5/5 iomap: consolidate bio submission
In reply to Sasha LevinFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 044472d5ee7d71f918fa3f61bd65e4933a0c006e ]
Add a iomap_bio_submit_read_endio helper factored out of iomap_bio_submit_read to that all ->submit_read implementations for iomap_read_ops that use iomap_bio_read_folio_range can shared the logic.
Right now that logic is mostly trivial, but already has a bug for XFS because the XFS version is too trivial: file system integrity validation needs a workqueue context and thus can't happen from the default iomap bi_end_io I/O handler. Unfortunately the iomap refactoring just before fs integrity landed moved code around here and the call go misplaced, meaning it never got called. The PI information still is verified by the block layer, but the offloading is less efficient (and the future userspace interface can't get at it).
--- fs/iomap/bio.c | 13 ++++++++++--- fs/ntfs/aops.c | 6 ++---- fs/ntfs3/inode.c | 5 +---- fs/xfs/xfs_aops.c | 3 +-- include/linux/iomap.h | 2 ++ 5 files changed, 16 insertions(+), 13 deletions(-)
fs/iomap/bio.c +10 -3
@@ -78,15 +78,23 @@ u32 iomap_finish_ioend_buffered_read(struct iomap_ioend *ioend)return __iomap_read_end_io (&ioend->io_bio, ioend->io_error); } -static void iomap_bio_submit_read (const struct iomap_iter *iter, -struct iomap_read_folio_ctx *ctx) +void iomap_bio_submit_read_endio (const struct iomap_iter *iter, +struct iomap_read_folio_ctx *ctx,bio_end_io_t end_io) {struct bio *bio = ctx->read_ctx; + bio->bi_end_io = end_io;if (iter->iomap.flags &IOMAP_F_INTEGRITY )fs_bio_integrity_alloc (bio);submit_bio (bio); } +EXPORT_SYMBOL_GPL (iomap_bio_submit_read_endio); + +static void iomap_bio_submit_read (const struct iomap_iter *iter, +struct iomap_read_folio_ctx *ctx) +{ +return iomap_bio_submit_read_endio (iter, ctx, iomap_read_end_io); +}static struct bio_set *iomap_read_bio_set (struct iomap_read_folio_ctx *ctx) {
@@ -127,7 +135,6 @@ static void iomap_read_alloc_bio(const struct iomap_iter *iter,if (ctx->rac) bio->bi_opf |=REQ_RAHEAD ; bio->bi_iter.bi_sector =iomap_sector (iomap, iter->pos); - bio->bi_end_io = iomap_read_end_io;bio_add_folio_nofail (bio, folio, plen,offset_in_folio (folio, iter->pos)); ctx->read_ctx = bio;
fs/ntfs/aops.c +2 -4
@@ -38,11 +38,9 @@ static void ntfs_iomap_read_end_io(struct bio *bio) }static void ntfs_iomap_bio_submit_read (const struct iomap_iter *iter, -struct iomap_read_folio_ctx *ctx) +struct iomap_read_folio_ctx *ctx) { -struct bio *bio = ctx->read_ctx; - bio->bi_end_io = ntfs_iomap_read_end_io; -submit_bio (bio); +iomap_bio_submit_read_endio (iter, ctx, ntfs_iomap_read_end_io); }static const struct iomap_read_ops ntfs_iomap_bio_read_ops = {
fs/ntfs3/inode.c +1 -4
@@ -609,10 +609,7 @@ static void ntfs_iomap_read_end_io(struct bio *bio)static void ntfs_iomap_bio_submit_read (const struct iomap_iter *iter,struct iomap_read_folio_ctx *ctx) { -struct bio *bio = ctx->read_ctx; - - bio->bi_end_io = ntfs_iomap_read_end_io; -submit_bio (bio); +iomap_bio_submit_read_endio (iter, ctx, ntfs_iomap_read_end_io); }static const struct iomap_read_ops ntfs_iomap_bio_read_ops = {
fs/xfs/xfs_aops.c +1 -2
@@ -753,8 +753,7 @@ xfs_bio_submit_read(/* defer read completions to the ioend workqueue */ iomap_init_ioend (iter->inode, bio, ctx->read_ctx_file_offset,0 ); - bio->bi_end_io = xfs_end_bio; -submit_bio (bio); +iomap_bio_submit_read_endio (iter, ctx, xfs_end_bio); }static const struct iomap_read_ops xfs_iomap_read_ops = {
include/linux/iomap.h +2 -0
@@ -615,6 +615,8 @@ extern struct bio_set iomap_ioend_bioset;#ifdef CONFIG_BLOCK int iomap_bio_read_folio_range (const struct iomap_iter *iter,struct iomap_read_folio_ctx *ctx,size_t plen); +void iomap_bio_submit_read_endio (const struct iomap_iter *iter, +struct iomap_read_folio_ctx *ctx,bio_end_io_t end_io);extern const struct iomap_read_ops iomap_bio_read_ops;
Signature · 1 line
2.53.0