X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=fs%2Ff2fs%2Fsegment.c;h=36e8afd8e1e44bd986ef09eefd42b7af65f8f872;hb=4f024f3797c43cb4b73cd2c50cec728842d0e49e;hp=fa284d397199faed53f1c8ffb4de611440ad2e73;hpb=7e1a1e9378018aeea2c7e8a3dd2ceb1db1523b0b;p=mirror_ubuntu-bionic-kernel.git diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index fa284d397199..36e8afd8e1e4 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -575,16 +575,14 @@ static const struct segment_allocation default_salloc_ops = { static void f2fs_end_io_write(struct bio *bio, int err) { - const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); - struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; struct bio_private *p = bio->bi_private; + struct bio_vec *bvec; + int i; - do { + bio_for_each_segment_all(bvec, bio, i) { struct page *page = bvec->bv_page; - if (--bvec >= bio->bi_io_vec) - prefetchw(&bvec->bv_page->flags); - if (!uptodate) { + if (err) { SetPageError(page); if (page->mapping) set_bit(AS_EIO, &page->mapping->flags); @@ -593,7 +591,7 @@ static void f2fs_end_io_write(struct bio *bio, int err) } end_page_writeback(page); dec_page_count(p->sbi, F2FS_WRITEBACK); - } while (bvec >= bio->bi_io_vec); + } if (p->is_sync) complete(p->wait); @@ -684,7 +682,7 @@ retry: bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi)); sbi->bio[type] = f2fs_bio_alloc(bdev, bio_blocks); - sbi->bio[type]->bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr); + sbi->bio[type]->bi_iter.bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr); sbi->bio[type]->bi_private = priv; /* * The end_io will be assigned at the sumbission phase.