The following commit has been merged in the master branch: commit d151e8bea1509a6f72a8929882d9ecb66e936b09 Merge: 8762069330316392331e693befd8a5b632833618 471859f57d42537626a56312cfb50cd6acee09ae Author: Linus Torvalds torvalds@linux-foundation.org Date: Wed Feb 22 13:50:13 2023 -0800
Merge tag 'iomap-6.3-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull iomap updates from Darrick Wong: "This is mostly rearranging things to make life easier for gfs2, nothing all that mindblowing for this release.
- Change when the iomap page_done function is called so that we still have a locked folio in the success case. This fixes a writeback race in gfs2
- Change when the iomap page_prepare function is called so that gfs2 can recover from OOM scenarios more gracefully
- Rename the iomap page_ops to folio_ops, since they operate on folios now"
* tag 'iomap-6.3-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: Rename page_ops to folio_ops iomap: Rename page_prepare handler to get_folio iomap: Add __iomap_get_folio helper iomap/gfs2: Get page in page_prepare handler iomap: Add iomap_get_folio helper iomap: Rename page_done handler to put_folio iomap/gfs2: Unlock and put folio in page_done handler iomap: Add __iomap_put_folio helper
diff --combined include/linux/iomap.h index fca43a4bd96b,c70a9d4fb447..0f8123504e5e --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@@ -13,6 -13,7 +13,7 @@@ struct address_space; struct fiemap_extent_info; struct inode; + struct iomap_iter; struct iomap_dio; struct iomap_writepage_ctx; struct iov_iter; @@@ -58,7 -59,8 +59,7 @@@ struct vm_fault #define IOMAP_F_SHARED (1U << 2) #define IOMAP_F_MERGED (1U << 3) #define IOMAP_F_BUFFER_HEAD (1U << 4) -#define IOMAP_F_ZONE_APPEND (1U << 5) -#define IOMAP_F_XATTR (1U << 6) +#define IOMAP_F_XATTR (1U << 5)
/* * Flags set by the core iomap code during operations: @@@ -84,7 -86,7 +85,7 @@@ */ #define IOMAP_NULL_ADDR -1ULL /* addr is not valid */
- struct iomap_page_ops; + struct iomap_folio_ops;
struct iomap { u64 addr; /* disk offset of mapping, bytes */ @@@ -96,7 -98,7 +97,7 @@@ struct dax_device *dax_dev; /* dax_dev for dax operations */ void *inline_data; void *private; /* filesystem private */ - const struct iomap_page_ops *page_ops; + const struct iomap_folio_ops *folio_ops; u64 validity_cookie; /* used with .iomap_valid() */ };
@@@ -124,19 -126,20 +125,20 @@@ static inline bool iomap_inline_data_va }
/* - * When a filesystem sets page_ops in an iomap mapping it returns, page_prepare - * and page_done will be called for each page written to. This only applies to - * buffered writes as unbuffered writes will not typically have pages + * When a filesystem sets folio_ops in an iomap mapping it returns, get_folio + * and put_folio will be called for each folio written to. This only applies + * to buffered writes as unbuffered writes will not typically have folios * associated with them. * - * When page_prepare succeeds, page_done will always be called to do any - * cleanup work necessary. In that page_done call, @page will be NULL if the - * associated page could not be obtained. + * 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. */ - struct iomap_page_ops { - int (*page_prepare)(struct inode *inode, loff_t pos, unsigned len); - void (*page_done)(struct inode *inode, loff_t pos, unsigned copied, - struct page *page); + struct iomap_folio_ops { + struct folio *(*get_folio)(struct iomap_iter *iter, loff_t pos, + unsigned len); + void (*put_folio)(struct inode *inode, loff_t pos, unsigned copied, + struct folio *folio);
/* * Check that the cached iomap still maps correctly to the filesystem's @@@ -259,6 -262,7 +261,7 @@@ int iomap_file_buffered_write_punch_del int iomap_read_folio(struct folio *folio, const struct iomap_ops *ops); void iomap_readahead(struct readahead_control *, const struct iomap_ops *ops); bool iomap_is_partially_uptodate(struct folio *, size_t from, size_t count); + struct folio *iomap_get_folio(struct iomap_iter *iter, loff_t pos); bool iomap_release_folio(struct folio *folio, gfp_t gfp_flags); void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len); int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len,
linux-merge@lists.open-mesh.org