diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-20 01:59:21 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:59 +0300 |
commit | ff9c301f287657c445136d9168261b5fa7f7ae91 (patch) | |
tree | e64227ac251e28ed20015fe6233c040e43b6aa83 /fs | |
parent | 30bff5944eb51a1d28b286c766599845939d2a47 (diff) | |
download | linux-ff9c301f287657c445136d9168261b5fa7f7ae91.tar.xz |
bcachefs: bio_for_each_segment_all() -> bio_for_each_folio_all()
This converts the writepage end_io path to folios.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/fs-io.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index c688adc2527f..018ada1a0136 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -1316,34 +1316,33 @@ static void bch2_writepage_io_done(struct bch_write_op *op) container_of(op, struct bch_writepage_io, op); struct bch_fs *c = io->op.c; struct bio *bio = &io->op.wbio.bio; - struct bvec_iter_all iter; - struct bio_vec *bvec; + struct folio_iter fi; unsigned i; if (io->op.error) { set_bit(EI_INODE_ERROR, &io->inode->ei_flags); - bio_for_each_segment_all(bvec, bio, iter) { + bio_for_each_folio_all(fi, bio) { struct bch_folio *s; - SetPageError(bvec->bv_page); - mapping_set_error(bvec->bv_page->mapping, -EIO); + folio_set_error(fi.folio); + mapping_set_error(fi.folio->mapping, -EIO); - s = __bch2_folio(page_folio(bvec->bv_page)); + s = __bch2_folio(fi.folio); spin_lock(&s->lock); - for (i = 0; i < PAGE_SECTORS; i++) + for (i = 0; i < folio_sectors(fi.folio); i++) s->s[i].nr_replicas = 0; spin_unlock(&s->lock); } } if (io->op.flags & BCH_WRITE_WROTE_DATA_INLINE) { - bio_for_each_segment_all(bvec, bio, iter) { + bio_for_each_folio_all(fi, bio) { struct bch_folio *s; - s = __bch2_folio(page_folio(bvec->bv_page)); + s = __bch2_folio(fi.folio); spin_lock(&s->lock); - for (i = 0; i < PAGE_SECTORS; i++) + for (i = 0; i < folio_sectors(fi.folio); i++) s->s[i].nr_replicas = 0; spin_unlock(&s->lock); } @@ -1368,12 +1367,11 @@ static void bch2_writepage_io_done(struct bch_write_op *op) */ i_sectors_acct(c, io->inode, NULL, io->op.i_sectors_delta); - bio_for_each_segment_all(bvec, bio, iter) { - struct folio *folio = page_folio(bvec->bv_page); - struct bch_folio *s = __bch2_folio(folio); + bio_for_each_folio_all(fi, bio) { + struct bch_folio *s = __bch2_folio(fi.folio); if (atomic_dec_and_test(&s->write_count)) - folio_end_writeback(folio); + folio_end_writeback(fi.folio); } bio_put(&io->op.wbio.bio); |