linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/5] xfs: const-ify xfs_owner_info arguments
Date: Tue, 20 Nov 2018 11:17:08 -0500	[thread overview]
Message-ID: <20181120161708.GA48509@bfoster> (raw)
In-Reply-To: <154171920773.30818.10284610883734405907.stgit@magnolia>

On Thu, Nov 08, 2018 at 03:20:07PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Only certain functions actually change the contents of an
> xfs_owner_info; the rest can accept a const struct pointer.  This will
> enable us to save stack space by hoisting static owner info types to
> be const global variables.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/libxfs/xfs_alloc.c  |    4 -
>  fs/xfs/libxfs/xfs_alloc.h  |    4 -
>  fs/xfs/libxfs/xfs_bmap.c   |    2 
>  fs/xfs/libxfs/xfs_bmap.h   |    4 -
>  fs/xfs/libxfs/xfs_rmap.c   |  212 ++++++++++++++++++++++----------------------
>  fs/xfs/libxfs/xfs_rmap.h   |   12 +-
>  fs/xfs/scrub/btree.c       |   45 +++++----
>  fs/xfs/scrub/btree.h       |   22 ++---
>  fs/xfs/scrub/common.c      |   14 +--
>  fs/xfs/scrub/common.h      |    2 
>  fs/xfs/scrub/refcount.c    |   11 +-
>  fs/xfs/scrub/repair.c      |   50 +++++-----
>  fs/xfs/scrub/repair.h      |    7 +
>  fs/xfs/scrub/rmap.c        |   30 +++---
>  fs/xfs/scrub/scrub.h       |    4 -
>  fs/xfs/xfs_trace.h         |    4 -
>  fs/xfs/xfs_trans.h         |    3 -
>  fs/xfs/xfs_trans_extfree.c |    2 
>  18 files changed, 218 insertions(+), 214 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index e1c0c0d2f1b0..bce46fa0ee38 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -1699,7 +1699,7 @@ xfs_free_ag_extent(
>  	xfs_agnumber_t		agno,
>  	xfs_agblock_t		bno,
>  	xfs_extlen_t		len,
> -	struct xfs_owner_info	*oinfo,
> +	const struct xfs_owner_info	*oinfo,
>  	enum xfs_ag_resv_type	type)
>  {
>  	xfs_btree_cur_t	*bno_cur;	/* cursor for by-block btree */
> @@ -3013,7 +3013,7 @@ __xfs_free_extent(
>  	struct xfs_trans	*tp,	/* transaction pointer */
>  	xfs_fsblock_t		bno,	/* starting block number of extent */
>  	xfs_extlen_t		len,	/* length of extent */
> -	struct xfs_owner_info	*oinfo,	/* extent owner */
> +	const struct xfs_owner_info	*oinfo,	/* extent owner */
>  	enum xfs_ag_resv_type	type,	/* block reservation type */
>  	bool			skip_discard)
>  {

Looks like we missed some function arg alignment fixups here.

...
> diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h
> index 157dc722ad35..00e38505037f 100644
> --- a/fs/xfs/libxfs/xfs_rmap.h
> +++ b/fs/xfs/libxfs/xfs_rmap.h
> @@ -52,7 +52,7 @@ xfs_rmap_skip_owner_update(
>  
>  static inline bool
>  xfs_rmap_should_skip_owner_update(
> -	struct xfs_owner_info	*oi)
> +	const struct xfs_owner_info	*oi)
>  {
>  	return oi->oi_owner == XFS_RMAP_OWN_NULL;
>  }
> @@ -103,7 +103,7 @@ xfs_rmap_irec_offset_unpack(
>  
>  static inline void
>  xfs_owner_info_unpack(
> -	struct xfs_owner_info	*oinfo,
> +	const struct xfs_owner_info	*oinfo,
>  	uint64_t		*owner,
>  	uint64_t		*offset,
>  	unsigned int		*flags)

... and here.

...
> diff --git a/fs/xfs/xfs_trans_extfree.c b/fs/xfs/xfs_trans_extfree.c
> index 73b11ed6795e..5210f86a9114 100644
> --- a/fs/xfs/xfs_trans_extfree.c
> +++ b/fs/xfs/xfs_trans_extfree.c
> @@ -57,7 +57,7 @@ xfs_trans_free_extent(
>  	struct xfs_efd_log_item	*efdp,
>  	xfs_fsblock_t		start_block,
>  	xfs_extlen_t		ext_len,
> -	struct xfs_owner_info	*oinfo,
> +	const struct xfs_owner_info	*oinfo,
>  	bool			skip_discard)

... and here.

With those fixed up:

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

>  {
>  	struct xfs_mount	*mp = tp->t_mountp;
> 

  reply	other threads:[~2018-11-21  2:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 23:20 [PATCH 0/5] xfs-5.0: miscellaneous cleanups Darrick J. Wong
2018-11-08 23:20 ` [PATCH 1/5] xfs: const-ify xfs_owner_info arguments Darrick J. Wong
2018-11-20 16:17   ` Brian Foster [this message]
2018-11-20 16:27     ` Darrick J. Wong
2018-11-08 23:20 ` [PATCH 2/5] xfs: remove xfs_rmap_ag_owner and friends Darrick J. Wong
2018-11-20 16:20   ` Brian Foster
2018-11-20 16:30     ` Darrick J. Wong
2018-11-08 23:20 ` [PATCH 3/5] xfs: add a block to inode count converter Darrick J. Wong
2018-11-20 16:21   ` Brian Foster
2018-11-20 16:31     ` Darrick J. Wong
2018-11-08 23:20 ` [PATCH 4/5] xfs: precalculate inodes and blocks per inode cluster Darrick J. Wong
2018-11-20 16:23   ` Brian Foster
2018-11-20 16:33     ` Darrick J. Wong
2018-11-08 23:20 ` [PATCH 5/5] xfs: precalculate cluster alignment in inodes and blocks Darrick J. Wong
2018-11-20 16:23   ` Brian Foster
2018-11-20 16:56     ` Darrick J. Wong

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=20181120161708.GA48509@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --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).