public inbox for linux-xfs@vger.kernel.org
 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/8] xfs: remove xlog_write_adv_cnt and simplify xlog_write_partial
Date: Thu, 17 Jun 2021 12:23:21 -0400	[thread overview]
Message-ID: <YMt2+UeYHozGG9oM@bfoster> (raw)
In-Reply-To: <20210616163212.1480297-5-hch@lst.de>

On Wed, Jun 16, 2021 at 06:32:08PM +0200, Christoph Hellwig wrote:
> xlog_write_adv_cnt is now only used for writing the continuation ophdr.
> Remove xlog_write_adv_cnt and simplify the caller now that we don't need
> the ptr iteration variable, and don't need to increment / decrement
> len for the accounting shengians.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

fs/xfs/xfs_log.c: In function ‘xlog_write_partial’:
fs/xfs/xfs_log.c:2261:10: warning: unused variable ‘ptr’ [-Wunused-variable]

With that fixed:

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

>  fs/xfs/xfs_log.c      | 12 +++++-------
>  fs/xfs/xfs_log_priv.h |  8 --------
>  2 files changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 5b431d53287d2c..1bc32f056a5bcf 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -2331,24 +2331,22 @@ xlog_write_partial(
>  			 * a new iclog. This is necessary so that we reserve
>  			 * space in the iclog for it.
>  			 */
> -			*len += sizeof(struct xlog_op_header);
>  			ticket->t_curr_res -= sizeof(struct xlog_op_header);
>  
>  			error = xlog_write_get_more_iclog_space(log, ticket,
> -					&iclog, log_offset, *len, record_cnt,
> -					data_cnt);
> +					&iclog, log_offset,
> +					*len + sizeof(struct xlog_op_header),
> +					record_cnt, data_cnt);
>  			if (error)
>  				return ERR_PTR(error);
> -			ptr = iclog->ic_datap + *log_offset;
>  
> -			ophdr = ptr;
> +			ophdr = iclog->ic_datap + *log_offset;
>  			ophdr->oh_tid = cpu_to_be32(ticket->t_tid);
>  			ophdr->oh_clientid = XFS_TRANSACTION;
>  			ophdr->oh_res2 = 0;
>  			ophdr->oh_flags = XLOG_WAS_CONT_TRANS;
>  
> -			xlog_write_adv_cnt(&ptr, len, log_offset,
> -						sizeof(struct xlog_op_header));
> +			*log_offset += sizeof(struct xlog_op_header);
>  			*data_cnt += sizeof(struct xlog_op_header);
>  
>  			/*
> diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
> index 96dbe713954f7e..1b3b3d2bb8a5d1 100644
> --- a/fs/xfs/xfs_log_priv.h
> +++ b/fs/xfs/xfs_log_priv.h
> @@ -467,14 +467,6 @@ extern kmem_zone_t *xfs_log_ticket_zone;
>  struct xlog_ticket *xlog_ticket_alloc(struct xlog *log, int unit_bytes,
>  		int count, bool permanent);
>  
> -static inline void
> -xlog_write_adv_cnt(void **ptr, int *len, int *off, size_t bytes)
> -{
> -	*ptr += bytes;
> -	*len -= bytes;
> -	*off += bytes;
> -}
> -
>  void	xlog_print_tic_res(struct xfs_mount *mp, struct xlog_ticket *ticket);
>  void	xlog_print_trans(struct xfs_trans *);
>  int	xlog_write(struct xlog *log, struct list_head *lv_chain,
> -- 
> 2.30.2
> 


  reply	other threads:[~2021-06-17 16:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 16:32 log write cleanups Christoph Hellwig
2021-06-16 16:32 ` [PATCH 1/8] xfs: change the type of ic_datap Christoph Hellwig
2021-06-17 16:22   ` Brian Foster
2021-06-18  5:52   ` Chandan Babu R
2021-06-16 16:32 ` [PATCH 2/8] xfs: list entry elements don't need to be initialized Christoph Hellwig
2021-06-17 16:23   ` Brian Foster
2021-06-18  5:59   ` Chandan Babu R
2021-06-16 16:32 ` [PATCH 3/8] xfs: factor out a helper to write a log_iovec into the iclog Christoph Hellwig
2021-06-17 16:23   ` Brian Foster
2021-06-18 13:24     ` Christoph Hellwig
2021-06-18  7:42   ` Chandan Babu R
2021-06-16 16:32 ` [PATCH 4/8] xfs: remove xlog_write_adv_cnt and simplify xlog_write_partial Christoph Hellwig
2021-06-17 16:23   ` Brian Foster [this message]
2021-06-18  7:50   ` Chandan Babu R
2021-06-16 16:32 ` [PATCH 5/8] xfs: remove xlog_verify_dest_ptr Christoph Hellwig
2021-06-17 16:24   ` Brian Foster
2021-06-18 10:31   ` Chandan Babu R
2021-06-16 16:32 ` [PATCH 6/8] xfs: simplify the xlog_write_partial calling conventions Christoph Hellwig
2021-06-17 16:24   ` Brian Foster
2021-06-18 11:07   ` Chandan Babu R
2021-06-16 16:32 ` [PATCH 7/8] xfs: factor out a xlog_write_full_log_vec helper Christoph Hellwig
2021-06-17 16:24   ` Brian Foster
2021-06-18 13:33     ` Christoph Hellwig
2021-06-16 16:32 ` [PATCH 8/8] xfs: simplify the list iteration in xlog_write Christoph Hellwig
2021-06-17 16:24   ` Brian Foster
2021-06-18 22:51 ` log write 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=YMt2+UeYHozGG9oM@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