Skip to content

btrfs reads through iomap

Goldwyn Rodrigues linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12iomap: check if folio size is equal to FS block sizefs/iomap/buffered-io.c+28 -134 replies
2/12iomap: Introduce iomap_read_folio_opsblock/fops.c fs/erofs/data.c fs/gfs2/aops.c +4 more+46 -193 replies
3/12iomap: add bioset in iomap_read_folio_ops for filesystems to use own biosetfs/iomap/buffered-io.c include/linux/iomap.h+20 -62 replies
4/12iomap: include iomap_read_end_io() in headerfs/iomap/buffered-io.c include/linux/iomap.h+2 -12 replies
5/12iomap: Introduce IOMAP_ENCODEDfs/iomap/buffered-io.c include/linux/iomap.h+19 -94 replies
6/12iomap: Introduce read_inline() function hookfs/iomap/buffered-io.c include/linux/iomap.h+16 -37 replies
7/12btrfs: btrfs_em_to_iomap() to convert em to iomapfs/btrfs/extent_io.c+30 -00 replies
8/12btrfs: iomap_begin() for buffered readsfs/btrfs/extent_io.c+28 -00 replies
9/12btrfs: define btrfs_iomap_read_folio_opsfs/btrfs/bio.c fs/btrfs/bio.h fs/btrfs/extent_io.c+31 -10 replies
10/12btrfs: define btrfs_iomap_folio_opsfs/btrfs/extent_io.c+13 -00 replies
11/12btrfs: add read_inline for folio operations for read() callsfs/btrfs/extent_io.c+18 -00 replies
12/12btrfs: switch to iomap for buffered readsfs/btrfs/extent_io.c+13 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] btrfs reads through iomap

From: Goldwyn Rodrigues <[email protected]>

These patches incorporate btrfs buffered reads using iomap code. The final goal here is to give all folio handling to iomap. This is the first installment to be followed by writes, writebacks and eventually subpage support.

The crux of the changes are:
* Since btrfs uses it's own bio handling structure, the btrfs bioset is
passed to iomap code in order to create a bio with the folios.
* For compressed extents:
- IOMAP_ENCODED which behaves like IOMAP_MAPPED, except, we supply the iomap back to submit_io() to identify if it is encoded.
- The iomap code needs to keep a track of the previous iomap struct in order to pass it to submit_io with the corresponding iomap
- A change in iomap struct should create a new bio

I have tested this patchset against a full run of xfstests for btrfs.

The current code does not support subpage access of iomap. Subpage will be hopefully incorporated once the write and the writeback goes through.

Code is available at https://github.com/goldwynr/linux/tree/buffered-iomap

Goldwyn Rodrigues (12):
iomap: check if folio size is equal to FS block size
iomap: Introduce iomap_read_folio_ops
iomap: add bioset in iomap_read_folio_ops for filesystems to use own
bioset
iomap: include iomap_read_end_io() in header
iomap: Introduce IOMAP_ENCODED
iomap: Introduce read_inline() function hook
btrfs: btrfs_em_to_iomap() to convert em to iomap
btrfs: iomap_begin() for buffered reads
btrfs: define btrfs_iomap_read_folio_ops
btrfs: define btrfs_iomap_folio_ops
btrfs: add read_inline for folio operations for read() calls
btrfs: switch to iomap for buffered reads

 block/fops.c           |   4 +-
 fs/btrfs/bio.c         |   2 +-
 fs/btrfs/bio.h         |   1 +
 fs/btrfs/extent_io.c   | 131 +++++++++++++++++++++++++++++++++++++++++
 fs/erofs/data.c        |   4 +-
 fs/gfs2/aops.c         |   4 +-
 fs/iomap/buffered-io.c | 117 +++++++++++++++++++++++++-----------
 fs/xfs/xfs_aops.c      |   4 +-
 fs/zonefs/file.c       |   4 +-
 include/linux/iomap.h  |  37 +++++++++++-
 10 files changed, 260 insertions(+), 48 deletions(-)
Signature · 1 line
2.46.1