mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
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>
This commit is contained in:
committed by
Anna Schumaker
parent
8e0bdc7021
commit
6dd85e83f3
@@ -189,6 +189,19 @@ static inline struct page *nfs_page_to_page(const struct nfs_page *req,
|
||||
return folio_page(folio, pgbase >> PAGE_SHIFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* nfs_page_to_inode - Retrieve an inode for the request
|
||||
* @req: pointer to a struct nfs_page
|
||||
*/
|
||||
static inline struct inode *nfs_page_to_inode(const struct nfs_page *req)
|
||||
{
|
||||
struct folio *folio = nfs_page_to_folio(req);
|
||||
|
||||
if (folio == NULL)
|
||||
return page_file_mapping(req->wb_page)->host;
|
||||
return folio_file_mapping(folio)->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* nfs_page_max_length - Retrieve the maximum possible length for a request
|
||||
* @req: pointer to a struct nfs_page
|
||||
|
||||
Reference in New Issue
Block a user