linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/2] xfs: simplify xlog_recover_inode_ra_pass2
Date: Tue, 28 Apr 2020 11:11:06 -0400	[thread overview]
Message-ID: <20200428151106.GD27954@bfoster> (raw)
In-Reply-To: <20200427193349.GB24934@lst.de>

On Mon, Apr 27, 2020 at 09:33:49PM +0200, Christoph Hellwig wrote:
> Don't bother to allocate memory and convert the log item when we
> only need the block number and the length.  Just extract them directly
> and call xlog_buf_readahead separately in each branch.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_log_recover.c | 21 ++++++++-------------
>  1 file changed, 8 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 4cb8f24f3aa63..fe4dad5b77a95 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -3890,22 +3890,17 @@ xlog_recover_inode_ra_pass2(
>  	struct xlog                     *log,
>  	struct xlog_recover_item        *item)
>  {
> -	struct xfs_inode_log_format	ilf_buf;
> -	struct xfs_inode_log_format	*ilfp;
> -	int			error;
> -
>  	if (item->ri_buf[0].i_len == sizeof(struct xfs_inode_log_format)) {
> -		ilfp = item->ri_buf[0].i_addr;
> +		struct xfs_inode_log_format	*ilfp = item->ri_buf[0].i_addr;
> +
> +		xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len,
> +				   &xfs_inode_buf_ra_ops);
>  	} else {
> -		ilfp = &ilf_buf;
> -		memset(ilfp, 0, sizeof(*ilfp));
> -		error = xfs_inode_item_format_convert(&item->ri_buf[0], ilfp);
> -		if (error)
> -			return;
> -	}
> +		struct xfs_inode_log_format_32	*ilfp = item->ri_buf[0].i_addr;
>  
> -	xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len,
> -			   &xfs_inode_buf_ra_ops);
> +		xlog_buf_readahead(log, ilfp->ilf_blkno, ilfp->ilf_len,
> +				   &xfs_inode_buf_ra_ops);
> +	}
>  }
>  
>  STATIC void
> -- 
> 2.26.1
> 


      reply	other threads:[~2020-04-28 15:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 13:52 two small log recovery cleanups Christoph Hellwig
2020-04-27 13:52 ` [PATCH 1/2] xfs: refactor the buffer cancellation table helpers Christoph Hellwig
2020-04-27 18:12   ` Darrick J. Wong
2020-04-28 15:10   ` Brian Foster
2020-04-27 13:52 ` [PATCH 2/2] xfs: rename inode_list xlog_recover_reorder_trans Christoph Hellwig
2020-04-27 18:05   ` Darrick J. Wong
2020-04-28 15:10   ` Brian Foster
2020-04-27 19:33 ` [PATCH 3/2] xfs: factor out a xlog_buf_readahead helper Christoph Hellwig
2020-04-28 15:10   ` Brian Foster
2020-04-27 19:33 ` [PATCH 4/2] xfs: simplify xlog_recover_inode_ra_pass2 Christoph Hellwig
2020-04-28 15:11   ` Brian Foster [this message]

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=20200428151106.GD27954@bfoster \
    --to=bfoster@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).