Skip to content

Commit 4b27232

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
NFS: Add a helper nfs_wb_folio()
...and use it in nfs_launder_folio(). Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent cbefa53 commit 4b27232

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

fs/nfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ static int nfs_launder_folio(struct folio *folio)
469469
inode->i_ino, folio_pos(folio));
470470

471471
folio_wait_fscache(folio);
472-
return nfs_wb_page(inode, &folio->page);
472+
return nfs_wb_folio(inode, folio);
473473
}
474474

475475
static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file,

fs/nfs/write.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,6 +2106,19 @@ int nfs_wb_page(struct inode *inode, struct page *page)
21062106
return ret;
21072107
}
21082108

2109+
/**
2110+
* nfs_wb_folio - Write back all requests on one page
2111+
* @inode: pointer to page
2112+
* @folio: pointer to folio
2113+
*
2114+
* Assumes that the folio has been locked by the caller, and will
2115+
* not unlock it.
2116+
*/
2117+
int nfs_wb_folio(struct inode *inode, struct folio *folio)
2118+
{
2119+
return nfs_wb_page(inode, &folio->page);
2120+
}
2121+
21092122
#ifdef CONFIG_MIGRATION
21102123
int nfs_migrate_folio(struct address_space *mapping, struct folio *dst,
21112124
struct folio *src, enum migrate_mode mode)

include/linux/nfs_fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned
578578
*/
579579
extern int nfs_sync_inode(struct inode *inode);
580580
extern int nfs_wb_all(struct inode *inode);
581+
extern int nfs_wb_folio(struct inode *inode, struct folio *folio);
581582
extern int nfs_wb_page(struct inode *inode, struct page *page);
582583
int nfs_wb_folio_cancel(struct inode *inode, struct folio *folio);
583584
extern int nfs_commit_inode(struct inode *, int);

0 commit comments

Comments
 (0)