diff options
| author | Darrick J. Wong <djwong@kernel.org> | 2024-10-03 08:09:16 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-08 16:28:19 +0100 |
| commit | 451b0a27ca6a75bec3f0afb841f3f97c298964a9 (patch) | |
| tree | 45b9be17bab3d0336aa9f703dbcc05fb4800f795 /include | |
| parent | 3c06d13ec80bec0833e054bf72453dc4ac698060 (diff) | |
| download | linux-451b0a27ca6a75bec3f0afb841f3f97c298964a9.tar.gz linux-451b0a27ca6a75bec3f0afb841f3f97c298964a9.tar.bz2 linux-451b0a27ca6a75bec3f0afb841f3f97c298964a9.zip | |
iomap: share iomap_unshare_iter predicate code with fsdax
[ Upstream commit 6ef6a0e821d3dad6bf8a5d5508762dba9042c84b ]
The predicate code that iomap_unshare_iter uses to decide if it's really
needs to unshare a file range mapping should be shared with the fsdax
version, because right now they're opencoded and inconsistent.
Note that we simplify the predicate logic a bit -- we no longer allow
unsharing of inline data mappings, but there aren't any filesystems that
allow shared inline data currently.
This is a fix in the sense that it should have been ported to fsdax.
Fixes: b53fdb215d13 ("iomap: improve shared block detection in iomap_unshare_iter")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/172796813294.1131942.15762084021076932620.stgit@frogsfrogsfrogs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Stable-dep-of: 50793801fc7f ("fsdax: dax_unshare_iter needs to copy entire blocks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/iomap.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 96dd0acbba44..846cd2f1454c 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -271,6 +271,7 @@ void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len); bool iomap_dirty_folio(struct address_space *mapping, struct folio *folio); int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len, const struct iomap_ops *ops); +bool iomap_want_unshare_iter(const struct iomap_iter *iter); int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero, const struct iomap_ops *ops); int iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, |
