NFS: Add a helper nfs_wb_folio()

...and use it in nfs_launder_folio().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Trond Myklebust 2023-01-19 16:33:40 -05:00 committed by Anna Schumaker
parent cbefa53cb1
commit 4b27232a6e
3 changed files with 15 additions and 1 deletions

View File

@ -469,7 +469,7 @@ static int nfs_launder_folio(struct folio *folio)
inode->i_ino, folio_pos(folio));
folio_wait_fscache(folio);
return nfs_wb_page(inode, &folio->page);
return nfs_wb_folio(inode, folio);
}
static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file,

View File

@ -2106,6 +2106,19 @@ out_error:
return ret;
}
/**
* nfs_wb_folio - Write back all requests on one page
* @inode: pointer to page
* @folio: pointer to folio
*
* Assumes that the folio has been locked by the caller, and will
* not unlock it.
*/
int nfs_wb_folio(struct inode *inode, struct folio *folio)
{
return nfs_wb_page(inode, &folio->page);
}
#ifdef CONFIG_MIGRATION
int nfs_migrate_folio(struct address_space *mapping, struct folio *dst,
struct folio *src, enum migrate_mode mode)

View File

@ -578,6 +578,7 @@ extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned
*/
extern int nfs_sync_inode(struct inode *inode);
extern int nfs_wb_all(struct inode *inode);
extern int nfs_wb_folio(struct inode *inode, struct folio *folio);
extern int nfs_wb_page(struct inode *inode, struct page *page);
int nfs_wb_folio_cancel(struct inode *inode, struct folio *folio);
extern int nfs_commit_inode(struct inode *, int);