add patch exit-cleanly-if-ext4_derive_key_aes-fails
[ext4-patch-queue.git] / replace-ext4_io_submit-io_op-with-io_wbc
blobdef8e5a04f1b6682c820a9e2d129c9198d334533
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>
16 ---
17  fs/ext4/ext4.h    | 2 +-
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
23 --- a/fs/ext4/ext4.h
24 +++ b/fs/ext4/ext4.h
25 @@ -191,7 +191,7 @@ typedef struct ext4_io_end {
26  } ext4_io_end_t;
28  struct ext4_io_submit {
29 -       int                     io_op;
30 +       struct writeback_control *io_wbc;
31         struct bio              *io_bio;
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;
41         if (bio) {
42 +               int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ?
43 +                           WRITE_SYNC : WRITE;
44                 bio_get(io->io_bio);
45 -               submit_bio(io->io_op, io->io_bio);
46 +               submit_bio(io_op, io->io_bio);
47                 bio_put(io->io_bio);
48         }
49         io->io_bio = NULL;
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)
53  {
54 -       io->io_op = (wbc->sync_mode == WB_SYNC_ALL ?  WRITE_SYNC : WRITE);
55 +       io->io_wbc = wbc;
56         io->io_bio = NULL;
57         io->io_end = NULL;
58  }
59 -- 
60 2.4.3