diff mbox series

[3/8] sgx: use ->f_mapping...

Message ID YwFBAdENeoM+CSTT@ZenIV (mailing list archive)
State New, archived
Headers show
Series [1/8] ibmvmc: don't open-code file_inode() | expand

Commit Message

Al Viro Aug. 20, 2022, 8:16 p.m. UTC
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/x86/kernel/cpu/sgx/encl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jarkko Sakkinen Aug. 25, 2022, 4:22 a.m. UTC | #1
On Sat, Aug 20, 2022 at 09:16:01PM +0100, Al Viro wrote:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  arch/x86/kernel/cpu/sgx/encl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
> index 24c1bb8eb196..6de17468ca16 100644
> --- a/arch/x86/kernel/cpu/sgx/encl.c
> +++ b/arch/x86/kernel/cpu/sgx/encl.c
> @@ -906,8 +906,7 @@ const cpumask_t *sgx_encl_cpumask(struct sgx_encl *encl)
>  static struct page *sgx_encl_get_backing_page(struct sgx_encl *encl,
>  					      pgoff_t index)
>  {
> -	struct inode *inode = encl->backing->f_path.dentry->d_inode;
> -	struct address_space *mapping = inode->i_mapping;
> +	struct address_space *mapping = encl->backing->f_mapping;
>  	gfp_t gfpmask = mapping_gfp_mask(mapping);
>  
>  	return shmem_read_mapping_page_gfp(mapping, index, gfpmask);
> -- 
> 2.30.2
> 

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
index 24c1bb8eb196..6de17468ca16 100644
--- a/arch/x86/kernel/cpu/sgx/encl.c
+++ b/arch/x86/kernel/cpu/sgx/encl.c
@@ -906,8 +906,7 @@  const cpumask_t *sgx_encl_cpumask(struct sgx_encl *encl)
 static struct page *sgx_encl_get_backing_page(struct sgx_encl *encl,
 					      pgoff_t index)
 {
-	struct inode *inode = encl->backing->f_path.dentry->d_inode;
-	struct address_space *mapping = inode->i_mapping;
+	struct address_space *mapping = encl->backing->f_mapping;
 	gfp_t gfpmask = mapping_gfp_mask(mapping);
 
 	return shmem_read_mapping_page_gfp(mapping, index, gfpmask);