summaryrefslogtreecommitdiff
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2023-01-19 16:33:38 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2023-02-14 14:22:32 -0500
commit6dd85e83f3f182b56770f8bb6dbed1f0dafb9117 (patch)
treeaf799a6b2e3571bdc680206fb5a5135a79b75010 /fs/nfs/write.c
parent8e0bdc7021f713fdf3b985cda3ce715e41b06698 (diff)
NFS: Add a helper to convert a struct nfs_page into an inode
Replace all the open coded calls to page_file_mapping(req->wb_page)->host. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 80c240e50952..1cbb92824791 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -421,7 +421,7 @@ static void nfs_set_page_writeback(struct page *page)
static void nfs_end_page_writeback(struct nfs_page *req)
{
- struct inode *inode = page_file_mapping(req->wb_page)->host;
+ struct inode *inode = nfs_page_to_inode(req);
struct nfs_server *nfss = NFS_SERVER(inode);
bool is_done;
@@ -592,8 +592,7 @@ nfs_lock_and_join_requests(struct page *page)
static void nfs_write_error(struct nfs_page *req, int error)
{
- trace_nfs_write_error(page_file_mapping(req->wb_page)->host, req,
- error);
+ trace_nfs_write_error(nfs_page_to_inode(req), req, error);
nfs_mapping_set_error(req->wb_page, error);
nfs_inode_remove_request(req);
nfs_end_page_writeback(req);
@@ -1420,7 +1419,7 @@ static void nfs_initiate_write(struct nfs_pgio_header *hdr,
*/
static void nfs_redirty_request(struct nfs_page *req)
{
- struct nfs_inode *nfsi = NFS_I(page_file_mapping(req->wb_page)->host);
+ struct nfs_inode *nfsi = NFS_I(nfs_page_to_inode(req));
/* Bump the transmission count */
req->wb_nio++;