Skip to content

Commit 29f11fc

Browse files
Eric SandeenDarrick J. Wong
authored andcommitted
xfs: #ifdef out perag code for userspace
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 5b068aa commit 29f11fc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

fs/xfs/libxfs/xfs_ag.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ xfs_initialize_perag(
248248
spin_unlock(&mp->m_perag_lock);
249249
radix_tree_preload_end();
250250

251+
#ifdef __KERNEL__
251252
/* Place kernel structure only init below this point. */
252253
spin_lock_init(&pag->pag_ici_lock);
253254
spin_lock_init(&pag->pagb_lock);
@@ -257,6 +258,7 @@ xfs_initialize_perag(
257258
init_waitqueue_head(&pag->pagb_wait);
258259
pag->pagb_count = 0;
259260
pag->pagb_tree = RB_ROOT;
261+
#endif /* __KERNEL__ */
260262

261263
error = xfs_buf_hash_init(pag);
262264
if (error)

fs/xfs/libxfs/xfs_ag.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ struct xfs_perag {
6464
/* Blocks reserved for the reverse mapping btree. */
6565
struct xfs_ag_resv pag_rmapbt_resv;
6666

67+
/* for rcu-safe freeing */
68+
struct rcu_head rcu_head;
69+
70+
#ifdef __KERNEL__
6771
/* -- kernel only structures below this line -- */
6872

6973
/*
@@ -90,9 +94,6 @@ struct xfs_perag {
9094
spinlock_t pag_buf_lock; /* lock for pag_buf_hash */
9195
struct rhashtable pag_buf_hash;
9296

93-
/* for rcu-safe freeing */
94-
struct rcu_head rcu_head;
95-
9697
/* background prealloc block trimming */
9798
struct delayed_work pag_blockgc_work;
9899

@@ -102,6 +103,7 @@ struct xfs_perag {
102103
* or have some other means to control concurrency.
103104
*/
104105
struct rhashtable pagi_unlinked_hash;
106+
#endif /* __KERNEL__ */
105107
};
106108

107109
int xfs_initialize_perag(struct xfs_mount *mp, xfs_agnumber_t agcount,

0 commit comments

Comments
 (0)