From: Eric Sandeen Date: Fri, 12 Nov 2021 20:17:14 +0000 (-0500) Subject: xfs: #ifdef out perag code for userspace X-Git-Tag: v5.14.0-rc1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ff88c62c13974809558a31f2bc1733cbc7bbb4b;p=thirdparty%2Fxfsprogs-dev.git xfs: #ifdef out perag code for userspace Source kernel commit: 29f11fce211c7fcf32713457c031e71785fb6088 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 Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_ag.c b/libxfs/xfs_ag.c index 9eda6ebac..da950e10a 100644 --- a/libxfs/xfs_ag.c +++ b/libxfs/xfs_ag.c @@ -246,6 +246,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); @@ -255,6 +256,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/libxfs/xfs_ag.h b/libxfs/xfs_ag.h index 4c6f9045b..2522f7661 100644 --- a/libxfs/xfs_ag.h +++ b/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,