summaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
authorNathan Scott2006-03-14 03:18:19 +0100
committerNathan Scott2006-03-14 03:18:19 +0100
commit8758280fcc6129be89503efe93bb59eaf2f85d28 (patch)
tree395246120b571385c1f3efad773b83a932d008da /fs/xfs/linux-2.6/xfs_super.c
parent[XFS] On machines with more than 8 cpus, when running parallel I/O (diff)
downloadkernel-qcow2-linux-8758280fcc6129be89503efe93bb59eaf2f85d28.tar.gz
kernel-qcow2-linux-8758280fcc6129be89503efe93bb59eaf2f85d28.tar.xz
kernel-qcow2-linux-8758280fcc6129be89503efe93bb59eaf2f85d28.zip
[XFS] Cleanup the use of zones/slabs, more consistent and allows flags to
be passed. SGI-PV: 949073 SGI-Modid: xfs-linux-melb:xfs-kern:25122a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 59989f6f83ef..0c7ed4b29c54 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -337,8 +337,8 @@ linvfs_alloc_inode(
{
vnode_t *vp;
- vp = kmem_cache_alloc(xfs_vnode_zone, kmem_flags_convert(KM_SLEEP));
- if (!vp)
+ vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
+ if (unlikely(!vp))
return NULL;
return LINVFS_GET_IP(vp);
}
@@ -352,23 +352,21 @@ linvfs_destroy_inode(
STATIC void
linvfs_inode_init_once(
- void *data,
- kmem_cache_t *cachep,
+ void *vnode,
+ kmem_zone_t *zonep,
unsigned long flags)
{
- vnode_t *vp = (vnode_t *)data;
-
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
- SLAB_CTOR_CONSTRUCTOR)
- inode_init_once(LINVFS_GET_IP(vp));
+ SLAB_CTOR_CONSTRUCTOR)
+ inode_init_once(LINVFS_GET_IP((vnode_t *)vnode));
}
STATIC int
-linvfs_init_zones(void)
+xfs_init_zones(void)
{
- xfs_vnode_zone = kmem_cache_create("xfs_vnode",
- sizeof(vnode_t), 0, SLAB_RECLAIM_ACCOUNT,
- linvfs_inode_init_once, NULL);
+ xfs_vnode_zone = kmem_zone_init_flags(sizeof(vnode_t), "xfs_vnode_t",
+ KM_ZONE_HWALIGN | KM_ZONE_RECLAIM,
+ linvfs_inode_init_once);
if (!xfs_vnode_zone)
goto out;
@@ -377,14 +375,12 @@ linvfs_init_zones(void)
goto out_destroy_vnode_zone;
xfs_ioend_pool = mempool_create(4 * MAX_BUF_PER_PAGE,
- mempool_alloc_slab, mempool_free_slab,
- xfs_ioend_zone);
+ mempool_alloc_slab, mempool_free_slab,
+ xfs_ioend_zone);
if (!xfs_ioend_pool)
goto out_free_ioend_zone;
-
return 0;
-
out_free_ioend_zone:
kmem_zone_destroy(xfs_ioend_zone);
out_destroy_vnode_zone:
@@ -394,7 +390,7 @@ linvfs_init_zones(void)
}
STATIC void
-linvfs_destroy_zones(void)
+xfs_destroy_zones(void)
{
mempool_destroy(xfs_ioend_pool);
kmem_zone_destroy(xfs_vnode_zone);
@@ -405,7 +401,7 @@ linvfs_destroy_zones(void)
* Attempt to flush the inode, this will actually fail
* if the inode is pinned, but we dirty the inode again
* at the point when it is unpinned after a log write,
- * since this is when the inode itself becomes flushable.
+ * since this is when the inode itself becomes flushable.
*/
STATIC int
linvfs_write_inode(
@@ -963,7 +959,7 @@ init_xfs_fs( void )
ktrace_init(64);
- error = linvfs_init_zones();
+ error = xfs_init_zones();
if (error < 0)
goto undo_zones;
@@ -986,7 +982,7 @@ undo_register:
xfs_buf_terminate();
undo_buffers:
- linvfs_destroy_zones();
+ xfs_destroy_zones();
undo_zones:
return error;
@@ -1000,7 +996,7 @@ exit_xfs_fs( void )
unregister_filesystem(&xfs_fs_type);
xfs_cleanup();
xfs_buf_terminate();
- linvfs_destroy_zones();
+ xfs_destroy_zones();
ktrace_uninit();
}