add patch handle-transient-enospc-properly-for-DAX
[ext4-patch-queue.git] / remove-unnecessary-bio-get-put
blobe1bc20580d4573234c32b99bfee2c548a0394bb3
1 ext4: remove unnecessary bio get/put
3 From: Jens Axboe <axboe@fb.com>
5 ext4_io_submit() used to check for EOPNOTSUPP after bio submission,
6 which is why it had to get an extra reference to the bio before
7 submitting it. But since we no longer touch the bio after submission,
8 get rid of the redundant get/put of the bio. If we do get the extra
9 reference, we enter the slower path of having to flag this bio as now
10 having external references.
12 Signed-off-by: Jens Axboe <axboe@fb.com>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 ---
15 diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
16 index 349d7aa04fe7..a81939236707 100644
17 --- a/fs/ext4/page-io.c
18 +++ b/fs/ext4/page-io.c
19 @@ -351,9 +351,7 @@ void ext4_io_submit(struct ext4_io_submit *io)
20         if (bio) {
21                 int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ?
22                             WRITE_SYNC : WRITE;
23 -               bio_get(io->io_bio);
24                 submit_bio(io_op, io->io_bio);
25 -               bio_put(io->io_bio);
26         }
27         io->io_bio = NULL;
28  }
30 -- 
31 Jens Axboe