1 ext4: replace ext4_io_submit->io_op with ->io_wbc
3 From: Tejun Heo <tj@kernel.org>
5 ext4_io_submit_init() takes the pointer to writeback_control to test
6 its sync_mode and determine between WRITE and WRITE_SYNC and records
7 the result in ->io_op. This patch makes it record the pointer
8 directly and moves the test to ext4_io_submit().
10 This doesn't cause any noticeable differences now but having
11 writeback_control available throughout IO submission path will be
12 depended upon by the planned cgroup writeback support.
14 Signed-off-by: Tejun Heo <tj@kernel.org>
15 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
18 fs/ext4/page-io.c | 6 ++++--
19 2 files changed, 5 insertions(+), 3 deletions(-)
21 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
22 index 009a059..74a4923 100644
25 @@ -191,7 +191,7 @@ typedef struct ext4_io_end {
28 struct ext4_io_submit {
30 + struct writeback_control *io_wbc;
32 ext4_io_end_t *io_end;
33 sector_t io_next_block;
34 diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
35 index c5d81e8..3f80cb2 100644
36 --- a/fs/ext4/page-io.c
37 +++ b/fs/ext4/page-io.c
38 @@ -357,8 +357,10 @@ void ext4_io_submit(struct ext4_io_submit *io)
39 struct bio *bio = io->io_bio;
42 + int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ?
45 - submit_bio(io->io_op, io->io_bio);
46 + submit_bio(io_op, io->io_bio);
50 @@ -367,7 +369,7 @@ void ext4_io_submit(struct ext4_io_submit *io)
51 void ext4_io_submit_init(struct ext4_io_submit *io,
52 struct writeback_control *wbc)
54 - io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE);