[PATCH v4 0/7] hfsplus: convert regular file I/O to iomap-based operations

Viacheslav Dubeyko posted 7 patches 1 week, 3 days ago
fs/hfsplus/Kconfig         |   2 +-
fs/hfsplus/Makefile        |   5 +-
fs/hfsplus/bitmap.c        |  18 +++
fs/hfsplus/extents.c       | 165 ++++++++++++++------
fs/hfsplus/file.c          | 304 +++++++++++++++++++++++++++++++++++++
fs/hfsplus/hfsplus_fs.h    |  26 +++-
fs/hfsplus/inode.c         | 282 +++++++++++-----------------------
fs/hfsplus/iomap.c         | 190 +++++++++++++++++++++++
fs/hfsplus/iomap.h         |  18 +++
include/linux/hfs_common.h |   8 +-
include/linux/iomap.h      |  20 +++
11 files changed, 787 insertions(+), 251 deletions(-)
create mode 100644 fs/hfsplus/file.c
create mode 100644 fs/hfsplus/iomap.c
create mode 100644 fs/hfsplus/iomap.h
[PATCH v4 0/7] hfsplus: convert regular file I/O to iomap-based operations
Posted by Viacheslav Dubeyko 1 week, 3 days ago
This series moves HFS+ regular file data I/O off the legacy
buffer_head/blockdev_direct_IO() path onto iomap-based operations with
the goal to retire the older buffer_head-based direct I/O infrastructure.

v2
Christoph Hellwig has detected that taking the page lock around
the kmap/modify/kunmap section is not enough on its own:
writeback drops the page lock before the write actually completes,
so a mutator that only waits on the lock can still start rewriting
a page whose old contents are still in flight to the device.
Mark the allocation file's mapping with mapping_set_stable_writes()
and call folio_wait_stable() right after taking the page lock in
both functions, so a mutator also waits out any writeback that was
already in progress when it acquired the lock.

Christoph Hellwig suggested to introduce a generalized version
of iomap_dio_end_io() that was placed into include/linux/iomap.h.

The hfsplus_btree_aops uses hfsplus_btree_read_folio() and
hfsplus_btree_writepages() methods. The hfsplus_symlink_aops
uses hfsplus_symlink_read_folio() and hfsplus_symlink_writepages()
methods. Also, hfsplus_setattr() doesn't distinguish the regular
and not regular file cases anymore.

v3
Matthew Wilcox recommended to use folio_wait_writeback()
instead of folio_wait_stable().

Fix failures in generic/091, generic/521, and generic/551.

v4
Fix failure in generic/363 test-case.

Viacheslav Dubeyko (7):
  hfs/hfsplus: exchange hardcoded number of extents on named constants
  hfsplus: rework hfsplus_get_block() logic
  hfsplus: take the bitmap page lock for allocate/free
  hfsplus: add iomap operations for regular file data
  hfsplus: move file related operations to file.c
  hfsplus: introduce iomap-based file_operations
  hfsplus: switch address_space_operations on iomap-based support

 fs/hfsplus/Kconfig         |   2 +-
 fs/hfsplus/Makefile        |   5 +-
 fs/hfsplus/bitmap.c        |  18 +++
 fs/hfsplus/extents.c       | 165 ++++++++++++++------
 fs/hfsplus/file.c          | 304 +++++++++++++++++++++++++++++++++++++
 fs/hfsplus/hfsplus_fs.h    |  26 +++-
 fs/hfsplus/inode.c         | 282 +++++++++++-----------------------
 fs/hfsplus/iomap.c         | 190 +++++++++++++++++++++++
 fs/hfsplus/iomap.h         |  18 +++
 include/linux/hfs_common.h |   8 +-
 include/linux/iomap.h      |  20 +++
 11 files changed, 787 insertions(+), 251 deletions(-)
 create mode 100644 fs/hfsplus/file.c
 create mode 100644 fs/hfsplus/iomap.c
 create mode 100644 fs/hfsplus/iomap.h

-- 
2.43.0