Commit 8fb72b4a authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

fscache: Convert fscache_set_page_dirty() to fscache_dirty_folio()



Convert all users of fscache_set_page_dirty to use fscache_dirty_folio.

Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs
Tested-by: David Howells <dhowells@redhat.com> # afs
parent 6f31a5a2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -345,7 +345,8 @@ The following facilities are provided to manage this:

To support this, the following functions are provided::

	int fscache_set_page_dirty(struct page *page,
	bool fscache_dirty_folio(struct address_space *mapping,
				 struct folio *folio,
				 struct fscache_cookie *cookie);
	void fscache_unpin_writeback(struct writeback_control *wbc,
				     struct fscache_cookie *cookie);
@@ -354,7 +355,7 @@ To support this, the following functions are provided::
					   const void *aux);

The *set* function is intended to be called from the filesystem's
``set_page_dirty`` address space operation.  If ``I_PINNING_FSCACHE_WB`` is not
``dirty_folio`` address space operation.  If ``I_PINNING_FSCACHE_WB`` is not
set, it sets that flag and increments the use count on the cookie (the caller
must already have called ``fscache_use_cookie()``).

+5 −5
Original line number Diff line number Diff line
@@ -359,20 +359,20 @@ static int v9fs_write_end(struct file *filp, struct address_space *mapping,
 * Mark a page as having been made dirty and thus needing writeback.  We also
 * need to pin the cache object to write back to.
 */
static int v9fs_set_page_dirty(struct page *page)
static bool v9fs_dirty_folio(struct address_space *mapping, struct folio *folio)
{
	struct v9fs_inode *v9inode = V9FS_I(page->mapping->host);
	struct v9fs_inode *v9inode = V9FS_I(mapping->host);

	return fscache_set_page_dirty(page, v9fs_inode_cookie(v9inode));
	return fscache_dirty_folio(mapping, folio, v9fs_inode_cookie(v9inode));
}
#else
#define v9fs_set_page_dirty __set_page_dirty_nobuffers
#define v9fs_dirty_folio filemap_dirty_folio
#endif

const struct address_space_operations v9fs_addr_operations = {
	.readpage = v9fs_vfs_readpage,
	.readahead = v9fs_vfs_readahead,
	.set_page_dirty = v9fs_set_page_dirty,
	.dirty_folio = v9fs_dirty_folio,
	.writepage = v9fs_vfs_writepage,
	.write_begin = v9fs_write_begin,
	.write_end = v9fs_write_end,
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ const struct inode_operations afs_file_inode_operations = {
const struct address_space_operations afs_file_aops = {
	.readpage	= afs_readpage,
	.readahead	= afs_readahead,
	.set_page_dirty	= afs_set_page_dirty,
	.dirty_folio	= afs_dirty_folio,
	.launder_folio	= afs_launder_folio,
	.releasepage	= afs_releasepage,
	.invalidate_folio = afs_invalidate_folio,
+2 −2
Original line number Diff line number Diff line
@@ -1521,9 +1521,9 @@ extern int afs_check_volume_status(struct afs_volume *, struct afs_operation *);
 * write.c
 */
#ifdef CONFIG_AFS_FSCACHE
extern int afs_set_page_dirty(struct page *);
bool afs_dirty_folio(struct address_space *, struct folio *);
#else
#define afs_set_page_dirty __set_page_dirty_nobuffers
#define afs_dirty_folio filemap_dirty_folio
#endif
extern int afs_write_begin(struct file *file, struct address_space *mapping,
			loff_t pos, unsigned len, unsigned flags,
+3 −2
Original line number Diff line number Diff line
@@ -22,9 +22,10 @@ static void afs_write_to_cache(struct afs_vnode *vnode, loff_t start, size_t len
 * Mark a page as having been made dirty and thus needing writeback.  We also
 * need to pin the cache object to write back to.
 */
int afs_set_page_dirty(struct page *page)
bool afs_dirty_folio(struct address_space *mapping, struct folio *folio)
{
	return fscache_set_page_dirty(page, afs_vnode_cache(AFS_FS_I(page->mapping->host)));
	return fscache_dirty_folio(mapping, folio,
				afs_vnode_cache(AFS_FS_I(mapping->host)));
}
static void afs_folio_start_fscache(bool caching, struct folio *folio)
{
Loading