diff options
| author | Namjae Jeon <linkinjeon@kernel.org> | 2026-05-11 23:11:51 +0900 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-05-11 16:56:53 +0200 |
| commit | 5a78a15537d4f260275d404edf7da1dd2d7157db (patch) | |
| tree | 77a1708a08f7b173e64120a58e90907747d88611 /include/linux | |
| parent | ecf22101ba7a398eb1aefbb4eaba5fdddf7b08e4 (diff) | |
| download | lwn-5a78a15537d4f260275d404edf7da1dd2d7157db.tar.gz lwn-5a78a15537d4f260275d404edf7da1dd2d7157db.zip | |
iomap: remove over-strict inline data boundary check
The current iomap_inline_data_valid() check ensures that inline data
does not cross a PAGE_SIZE boundary. However, this is an unnecessarily
strict constraint. If a filesystem provides a valid iomap::inline_data
pointer and iomap::length, we should trust that the caller has mapped
sufficient memory for the range, even if it spans across page boundaries.
Removing this check allows filesystems to point directly to their
internal data structures without forced page-alignment or additional
redundant allocations. This remove iomap_inline_data_valid() and
its callers in buffered and direct I/O paths.
Suggested-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Link: https://patch.msgid.link/20260511141151.6021-1-linkinjeon@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iomap.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 2c5685adf3a9..52bfd6783417 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -143,16 +143,6 @@ static inline void *iomap_inline_data(const struct iomap *iomap, loff_t pos) } /* - * Check if the mapping's length is within the valid range for inline data. - * This is used to guard against accessing data beyond the page inline_data - * points at. - */ -static inline bool iomap_inline_data_valid(const struct iomap *iomap) -{ - return iomap->length <= PAGE_SIZE - offset_in_page(iomap->inline_data); -} - -/* * When get_folio succeeds, put_folio will always be called to do any * cleanup work necessary. put_folio is responsible for unlocking and putting * @folio. |
