Skip to content

Commit 10149c6

Browse files
Kanchan Joshikawasaki
authored andcommitted
fs: propagate write stream
bio->bi_write_stream is not set by the filesystem code. Use inode's write stream value to do that. Signed-off-by: Kanchan Joshi <[email protected]>
1 parent 49cc9da commit 10149c6

7 files changed

Lines changed: 15 additions & 5 deletions

File tree

fs/btrfs/extent_io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ static void alloc_new_bio(struct btrfs_inode *inode,
666666
bio_ctrl->end_io_func, NULL);
667667
bbio->bio.bi_iter.bi_sector = disk_bytenr >> SECTOR_SHIFT;
668668
bbio->bio.bi_write_hint = inode->vfs_inode.i_write_hint;
669+
bbio->bio.bi_write_stream = inode->vfs_inode.i_write_stream;
669670
bbio->inode = inode;
670671
bbio->file_offset = file_offset;
671672
bio_ctrl->bbio = bbio;

fs/buffer.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555

5656
static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);
5757
static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
58-
enum rw_hint hint, struct writeback_control *wbc);
58+
enum rw_hint hint, u8 write_stream,
59+
struct writeback_control *wbc);
5960

6061
#define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers)
6162

@@ -1931,7 +1932,8 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
19311932
struct buffer_head *next = bh->b_this_page;
19321933
if (buffer_async_write(bh)) {
19331934
submit_bh_wbc(REQ_OP_WRITE | write_flags, bh,
1934-
inode->i_write_hint, wbc);
1935+
inode->i_write_hint,
1936+
inode->i_write_stream, wbc);
19351937
nr_underway++;
19361938
}
19371939
bh = next;
@@ -1986,7 +1988,8 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
19861988
if (buffer_async_write(bh)) {
19871989
clear_buffer_dirty(bh);
19881990
submit_bh_wbc(REQ_OP_WRITE | write_flags, bh,
1989-
inode->i_write_hint, wbc);
1991+
inode->i_write_hint,
1992+
inode->i_write_stream, wbc);
19901993
nr_underway++;
19911994
}
19921995
bh = next;
@@ -2778,7 +2781,7 @@ static void end_bio_bh_io_sync(struct bio *bio)
27782781
}
27792782

27802783
static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
2781-
enum rw_hint write_hint,
2784+
enum rw_hint write_hint, u8 write_stream,
27822785
struct writeback_control *wbc)
27832786
{
27842787
const enum req_op op = opf & REQ_OP_MASK;
@@ -2807,6 +2810,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
28072810

28082811
bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
28092812
bio->bi_write_hint = write_hint;
2813+
bio->bi_write_stream = write_stream;
28102814

28112815
bio_add_folio_nofail(bio, bh->b_folio, bh->b_size, bh_offset(bh));
28122816

@@ -2826,7 +2830,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
28262830

28272831
void submit_bh(blk_opf_t opf, struct buffer_head *bh)
28282832
{
2829-
submit_bh_wbc(opf, bh, WRITE_LIFE_NOT_SET, NULL);
2833+
submit_bh_wbc(opf, bh, WRITE_LIFE_NOT_SET, 0, NULL);
28302834
}
28312835
EXPORT_SYMBOL(submit_bh);
28322836

fs/direct-io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio,
410410
if (dio->is_pinned)
411411
bio_set_flag(bio, BIO_PAGE_PINNED);
412412
bio->bi_write_hint = file_inode(dio->iocb->ki_filp)->i_write_hint;
413+
bio->bi_write_stream = file_inode(dio->iocb->ki_filp)->i_write_stream;
413414

414415
sdio->bio = bio;
415416
sdio->logical_offset_in_bio = sdio->cur_page_fs_offset;

fs/ext4/page-io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ static void io_submit_add_bh(struct ext4_io_submit *io,
447447
if (io->io_bio == NULL) {
448448
io_submit_init_bio(io, bh);
449449
io->io_bio->bi_write_hint = inode->i_write_hint;
450+
io->io_bio->bi_write_stream = inode->i_write_stream;
450451
}
451452
if (!bio_add_folio(io->io_bio, io_folio, bh->b_size, bh_offset(bh)))
452453
goto submit_and_retry;

fs/iomap/direct-io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ static int iomap_dio_bio_iter(struct iomap_iter *iter, struct iomap_dio *dio)
430430
GFP_KERNEL);
431431
bio->bi_iter.bi_sector = iomap_sector(iomap, pos);
432432
bio->bi_write_hint = inode->i_write_hint;
433+
bio->bi_write_stream = inode->i_write_stream;
433434
bio->bi_ioprio = dio->iocb->ki_ioprio;
434435
bio->bi_private = dio;
435436
bio->bi_end_io = iomap_dio_bio_end_io;

fs/iomap/ioend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static struct iomap_ioend *iomap_alloc_ioend(struct iomap_writepage_ctx *wpc,
107107
GFP_NOFS, &iomap_ioend_bioset);
108108
bio->bi_iter.bi_sector = iomap_sector(&wpc->iomap, pos);
109109
bio->bi_write_hint = wpc->inode->i_write_hint;
110+
bio->bi_write_stream = wpc->inode->i_write_stream;
110111
wbc_init_bio(wpc->wbc, bio);
111112
wpc->nr_folios = 0;
112113
return iomap_init_ioend(wpc->inode, bio, pos, ioend_flags);

fs/mpage.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ static int mpage_write_folio(struct writeback_control *wbc, struct folio *folio,
595595
bio->bi_iter.bi_sector = first_block << (blkbits - 9);
596596
wbc_init_bio(wbc, bio);
597597
bio->bi_write_hint = inode->i_write_hint;
598+
bio->bi_write_stream = inode->i_write_stream;
598599
}
599600

600601
/*

0 commit comments

Comments
 (0)