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

f2fs: clean up __bio_alloc()'s parameter

Just cleanup, no logic change.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
b757f6ed 9ea2f0be

+11 -16
+11 -16
fs/f2fs/data.c
··· 259 259 /* 260 260 * Low-level block read/write IO operations. 261 261 */ 262 - static struct bio *__bio_alloc(struct f2fs_sb_info *sbi, block_t blk_addr, 263 - struct writeback_control *wbc, 264 - int npages, bool is_read, 265 - enum page_type type, enum temp_type temp) 262 + static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages) 266 263 { 264 + struct f2fs_sb_info *sbi = fio->sbi; 267 265 struct bio *bio; 268 266 269 267 bio = f2fs_bio_alloc(sbi, npages, true); 270 268 271 - f2fs_target_device(sbi, blk_addr, bio); 272 - if (is_read) { 269 + f2fs_target_device(sbi, fio->new_blkaddr, bio); 270 + if (is_read_io(fio->op)) { 273 271 bio->bi_end_io = f2fs_read_end_io; 274 272 bio->bi_private = NULL; 275 273 } else { 276 274 bio->bi_end_io = f2fs_write_end_io; 277 275 bio->bi_private = sbi; 278 - bio->bi_write_hint = f2fs_io_type_to_rw_hint(sbi, type, temp); 276 + bio->bi_write_hint = f2fs_io_type_to_rw_hint(sbi, 277 + fio->type, fio->temp); 279 278 } 280 - if (wbc) 281 - wbc_init_bio(wbc, bio); 279 + if (fio->io_wbc) 280 + wbc_init_bio(fio->io_wbc, bio); 282 281 283 282 return bio; 284 283 } ··· 460 461 f2fs_trace_ios(fio, 0); 461 462 462 463 /* Allocate a new bio */ 463 - bio = __bio_alloc(fio->sbi, fio->new_blkaddr, fio->io_wbc, 464 - 1, is_read_io(fio->op), fio->type, fio->temp); 464 + bio = __bio_alloc(fio, 1); 465 465 466 466 if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { 467 467 bio_put(bio); ··· 536 538 } 537 539 alloc_new: 538 540 if (!bio) { 539 - bio = __bio_alloc(fio->sbi, fio->new_blkaddr, fio->io_wbc, 540 - BIO_MAX_PAGES, false, fio->type, fio->temp); 541 + bio = __bio_alloc(fio, BIO_MAX_PAGES); 541 542 bio_set_op_attrs(bio, fio->op, fio->op_flags); 542 543 } 543 544 ··· 613 616 fio->retry = true; 614 617 goto skip; 615 618 } 616 - io->bio = __bio_alloc(sbi, fio->new_blkaddr, fio->io_wbc, 617 - BIO_MAX_PAGES, false, 618 - fio->type, fio->temp); 619 + io->bio = __bio_alloc(fio, BIO_MAX_PAGES); 619 620 io->fio = *fio; 620 621 } 621 622