public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/4] xfs: remove __xfs_filemap_fault
Date: Tue, 29 Oct 2024 09:00:48 -0700	[thread overview]
Message-ID: <20241029160048.GX2386201@frogsfrogsfrogs> (raw)
In-Reply-To: <20241029151214.255015-4-hch@lst.de>

On Tue, Oct 29, 2024 at 04:11:59PM +0100, Christoph Hellwig wrote:
> xfs_filemap_huge_fault only ever serves DAX faults, so hard code the
> call to xfs_dax_read_fault and open code __xfs_filemap_fault in the
> only remaining caller.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_file.c | 29 +++++++++++------------------
>  1 file changed, 11 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 0b8e36f8703c..7464d874e766 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -1481,20 +1481,6 @@ xfs_write_fault(
>  	return ret;
>  }
>  
> -static vm_fault_t
> -__xfs_filemap_fault(
> -	struct vm_fault		*vmf,
> -	unsigned int		order)
> -{
> -	struct inode		*inode = file_inode(vmf->vma->vm_file);
> -
> -	if (IS_DAX(inode))
> -		return xfs_dax_read_fault(vmf, order);
> -
> -	trace_xfs_read_fault(XFS_I(inode), order);
> -	return filemap_fault(vmf);
> -}
> -
>  static inline bool
>  xfs_is_write_fault(
>  	struct vm_fault		*vmf)
> @@ -1507,10 +1493,17 @@ static vm_fault_t
>  xfs_filemap_fault(
>  	struct vm_fault		*vmf)
>  {
> +	struct inode		*inode = file_inode(vmf->vma->vm_file);
> +
>  	/* DAX can shortcut the normal fault path on write faults! */
> -	if (IS_DAX(file_inode(vmf->vma->vm_file)) && xfs_is_write_fault(vmf))
> -		return xfs_write_fault(vmf, 0);
> -	return __xfs_filemap_fault(vmf, 0);
> +	if (IS_DAX(inode)) {
> +		if (xfs_is_write_fault(vmf))
> +			return xfs_write_fault(vmf, 0);
> +		return xfs_dax_read_fault(vmf, 0);
> +	}
> +
> +	trace_xfs_read_fault(XFS_I(inode), 0);
> +	return filemap_fault(vmf);
>  }
>  
>  static vm_fault_t
> @@ -1524,7 +1517,7 @@ xfs_filemap_huge_fault(
>  	/* DAX can shortcut the normal fault path on write faults! */
>  	if (xfs_is_write_fault(vmf))
>  		return xfs_write_fault(vmf, order);
> -	return __xfs_filemap_fault(vmf, order);
> +	return xfs_dax_read_fault(vmf, order);
>  }
>  
>  static vm_fault_t
> -- 
> 2.45.2
> 
> 

  reply	other threads:[~2024-10-29 16:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 15:11 misc page fault handler cleanups Christoph Hellwig
2024-10-29 15:11 ` [PATCH 1/4] xfs: split the page fault trace event Christoph Hellwig
2024-10-29 15:51   ` Darrick J. Wong
2024-10-29 15:11 ` [PATCH 2/4] xfs: split write fault handling out of __xfs_filemap_fault Christoph Hellwig
2024-10-29 15:57   ` Darrick J. Wong
2024-10-29 15:11 ` [PATCH 3/4] xfs: remove __xfs_filemap_fault Christoph Hellwig
2024-10-29 16:00   ` Darrick J. Wong [this message]
2024-10-29 15:12 ` [PATCH 4/4] xfs: remove xfs_page_mkwrite_iomap_ops Christoph Hellwig
2024-10-29 15:56   ` Darrick J. Wong
2024-10-30  4:45     ` Christoph Hellwig
2024-10-29 20:54 ` misc page fault handler cleanups Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241029160048.GX2386201@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox