* [PATCH 2 of 4] Factor per-ag radix tree intialisation
@ 2007-08-09 11:39 David Chinner
0 siblings, 0 replies; only message in thread
From: David Chinner @ 2007-08-09 11:39 UTC (permalink / raw)
To: xfs-dev; +Cc: xfs-oss
Factor out common intialisation code.
Signed-off-by: Dave Chinner <dgc@sgi.com>
---
fs/xfs/xfs_mount.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
Index: 2.6.x-xfs-new/fs/xfs/xfs_mount.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_mount.c 2007-08-09 13:03:53.000000000 +1000
+++ 2.6.x-xfs-new/fs/xfs/xfs_mount.c 2007-08-09 13:07:53.410065825 +1000
@@ -337,6 +337,17 @@ xfs_mount_validate_sb(
return 0;
}
+STATIC void
+xfs_initialize_perag_icache(
+ xfs_perag_t *pag)
+{
+ if (!pag->pag_ici_init) {
+ rwlock_init(&pag->pag_ici_lock);
+ INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC);
+ pag->pag_ici_init = 1;
+ }
+}
+
xfs_agnumber_t
xfs_initialize_perag(
bhv_vfs_t *vfs,
@@ -391,22 +402,14 @@ xfs_initialize_perag(
pag->pagi_inodeok = 1;
if (index < max_metadata)
pag->pagf_metadata = 1;
- if (!pag->pag_ici_init) {
- rwlock_init(&pag->pag_ici_lock);
- INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC);
- pag->pag_ici_init = 1;
- }
+ xfs_initialize_perag_icache(pag);
}
} else {
/* Setup default behavior for smaller filesystems */
for (index = 0; index < agcount; index++) {
pag = &mp->m_perag[index];
pag->pagi_inodeok = 1;
- if (!pag->pag_ici_init) {
- rwlock_init(&pag->pag_ici_lock);
- INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC);
- pag->pag_ici_init = 1;
- }
+ xfs_initialize_perag_icache(pag);
}
}
return index;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-09 11:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-09 11:39 [PATCH 2 of 4] Factor per-ag radix tree intialisation David Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox