Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: remove unnecessary bio get/put

ext4_io_submit() used to check for EOPNOTSUPP after bio submission,
which is why it had to get an extra reference to the bio before
submitting it. But since we no longer touch the bio after submission,
get rid of the redundant get/put of the bio. If we do get the extra
reference, we enter the slower path of having to flag this bio as now
having external references.

Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Jens Axboe and committed by
Theodore Ts'o
32157de2 935244cd

-2
-2
fs/ext4/page-io.c
··· 342 342 if (bio) { 343 343 int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ? 344 344 WRITE_SYNC : WRITE; 345 - bio_get(io->io_bio); 346 345 submit_bio(io_op, io->io_bio); 347 - bio_put(io->io_bio); 348 346 } 349 347 io->io_bio = NULL; 350 348 }