Skip to content

Commit 4ef7c6d

Browse files
Christoph HellwigChandan Babu R
authored andcommitted
xfs: use kfree_rcu_mightsleep to free the perag structures
Using the kfree_rcu_mightsleep is simpler and removes the need for a rcu_head in the perag structure. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Chandan Babu R <[email protected]>
1 parent 70045da commit 4ef7c6d

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

fs/xfs/libxfs/xfs_ag.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,6 @@ xfs_initialize_perag_data(
235235
return error;
236236
}
237237

238-
STATIC void
239-
__xfs_free_perag(
240-
struct rcu_head *head)
241-
{
242-
struct xfs_perag *pag = container_of(head, struct xfs_perag, rcu_head);
243-
244-
ASSERT(!delayed_work_pending(&pag->pag_blockgc_work));
245-
kfree(pag);
246-
}
247-
248238
/*
249239
* Free up the per-ag resources associated with the mount structure.
250240
*/
@@ -270,7 +260,7 @@ xfs_free_perag(
270260
xfs_perag_rele(pag);
271261
XFS_IS_CORRUPT(pag->pag_mount,
272262
atomic_read(&pag->pag_active_ref) != 0);
273-
call_rcu(&pag->rcu_head, __xfs_free_perag);
263+
kfree_rcu_mightsleep(pag);
274264
}
275265
}
276266

fs/xfs/libxfs/xfs_ag.h

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

66-
/* for rcu-safe freeing */
67-
struct rcu_head rcu_head;
68-
6966
/* Precalculated geometry info */
7067
xfs_agblock_t block_count;
7168
xfs_agblock_t min_block;

0 commit comments

Comments
 (0)