public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@redhat.com
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 1/3] libxfs: #ifdef out perag code for userspace
Date: Tue, 9 Nov 2021 20:23:53 -0800	[thread overview]
Message-ID: <20211110042353.GZ24307@magnolia> (raw)
In-Reply-To: <7e8a7998-5915-a9a4-e3db-50932781aee3@redhat.com>

On Tue, Nov 09, 2021 at 07:58:34PM -0600, Eric Sandeen wrote:
> The xfs_perag structure and initialization is unused in userspace,
> so #ifdef it out with __KERNEL__ to facilitate the xfsprogs sync
> and build.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks severely whitespace damaged, but /me has gotten tired of dealing
with all the navel gazing around #ifdef __KERNEL__.  I want to move on
to more difficult topics like grokking and evaluating online repair, and
get us away from arguing about how to preprocessor.

This gets us closer to parity between the two libxfses, and reflects
what the two libxfs maintainers more or less agree upon, so with patch
4/3 added in and the whitespace fixed...

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

--D

> ---
> 
> diff --git a/fs/xfs/libxfs/xfs_ag.c b/fs/xfs/libxfs/xfs_ag.c
> index 005abfd9fd34..ecfb213d8fa3 100644
> --- a/fs/xfs/libxfs/xfs_ag.c
> +++ b/fs/xfs/libxfs/xfs_ag.c
> @@ -248,6 +248,7 @@ xfs_initialize_perag(
>  		spin_unlock(&mp->m_perag_lock);
>  		radix_tree_preload_end();
> +#ifdef __KERNEL__
>  		/* Place kernel structure only init below this point. */
>  		spin_lock_init(&pag->pag_ici_lock);
>  		spin_lock_init(&pag->pagb_lock);
> @@ -257,6 +258,7 @@ xfs_initialize_perag(
>  		init_waitqueue_head(&pag->pagb_wait);
>  		pag->pagb_count = 0;
>  		pag->pagb_tree = RB_ROOT;
> +#endif	/* __KERNEL_ */
>  		error = xfs_buf_hash_init(pag);
>  		if (error)
> diff --git a/fs/xfs/libxfs/xfs_ag.h b/fs/xfs/libxfs/xfs_ag.h
> index 4c6f9045baca..01c36cfe6909 100644
> --- a/fs/xfs/libxfs/xfs_ag.h
> +++ b/fs/xfs/libxfs/xfs_ag.h
> @@ -64,6 +64,10 @@ struct xfs_perag {
>  	/* Blocks reserved for the reverse mapping btree. */
>  	struct xfs_ag_resv	pag_rmapbt_resv;
> +	/* for rcu-safe freeing */
> +	struct rcu_head	rcu_head;
> +
> +#ifdef __KERNEL__
>  	/* -- kernel only structures below this line -- */
>  	/*
> @@ -90,9 +94,6 @@ struct xfs_perag {
>  	spinlock_t	pag_buf_lock;	/* lock for pag_buf_hash */
>  	struct rhashtable pag_buf_hash;
> -	/* for rcu-safe freeing */
> -	struct rcu_head	rcu_head;
> -
>  	/* background prealloc block trimming */
>  	struct delayed_work	pag_blockgc_work;
> @@ -102,6 +103,7 @@ struct xfs_perag {
>  	 * or have some other means to control concurrency.
>  	 */
>  	struct rhashtable	pagi_unlinked_hash;
> +#endif	/* __KERNEL__ */
>  };
>  int xfs_initialize_perag(struct xfs_mount *mp, xfs_agnumber_t agcount,
> 

  reply	other threads:[~2021-11-10  4:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  1:56 [PATCH 0/3] xfs: #ifdef out perag code for userspace Eric Sandeen
2021-11-10  1:58 ` [PATCH 1/3] libxfs: " Eric Sandeen
2021-11-10  4:23   ` Darrick J. Wong [this message]
2021-11-10  2:00 ` [PATCH 2/3] libxfs: #ifdef out perag code for userspace (xfsprogs version) Eric Sandeen
2021-11-10  2:02 ` [PATCH 3/3] xfsprogs: remove kernel stubs from xfs_shared.h Eric Sandeen
2021-11-10  4:26   ` Darrick J. Wong
2021-11-10  2:34 ` [PATCH 4/3] xfs: sync xfs_btree_split macros with userspace libxfs Darrick J. Wong
2021-11-10 17:12   ` Eric Sandeen

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=20211110042353.GZ24307@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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