diff options
author | Christoph Hellwig <hch@lst.de> | 2014-04-23 07:11:51 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-04-23 07:11:51 +1000 |
commit | 1919adda0732e661c6163a6505dddb0bc423b8d8 (patch) | |
tree | 401679adbf7a8bbc883771d32b36ff9ea91c396d /fs/xfs/xfs_filestream.c | |
parent | 2cd2ef6a300b1ac912bb515b75451585c3d33ea9 (diff) |
xfs: don't create a slab cache for filestream items
We only have very few of these around, and allocation isn't that
much of a hot path. Remove the slab cache to simplify the code,
and to not waste any resources for the usual case of not having
any inodes that use the filestream allocator.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_filestream.c')
-rw-r--r-- | fs/xfs/xfs_filestream.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c index ff6f90215c8a..7b9403690013 100644 --- a/fs/xfs/xfs_filestream.c +++ b/fs/xfs/xfs_filestream.c @@ -39,8 +39,6 @@ #define TRACE_FREE(mp, ip, pip, ag, cnt) #define TRACE_LOOKUP(mp, ip, pip, ag, cnt) -static kmem_zone_t *item_zone; - struct xfs_fstrm_item { struct xfs_mru_cache_elem mru; struct xfs_inode *ip; @@ -141,7 +139,7 @@ xfs_fstrm_free_func( TRACE_FREE(mp, ip, NULL, item->ag, xfs_filestream_peek_ag(mp, item->ag)); - kmem_zone_free(item_zone, item); + kmem_free(item); } /* @@ -272,7 +270,7 @@ next_ag: return 0; err = ENOMEM; - item = kmem_zone_zalloc(item_zone, KM_MAYFAIL); + item = kmem_alloc(sizeof(*item), KM_MAYFAIL); if (!item) goto out_put_ag; @@ -289,7 +287,7 @@ next_ag: return 0; out_free_item: - kmem_zone_free(item_zone, item); + kmem_free(item); out_put_ag: xfs_filestream_put_ag(mp, *agp); return err; @@ -474,20 +472,3 @@ xfs_filestream_unmount( { xfs_mru_cache_destroy(mp->m_filestream); } - - -/* needs to return a positive errno for the init path */ -int -xfs_filestream_init(void) -{ - item_zone = kmem_zone_init(sizeof(struct xfs_fstrm_item), "fstrm_item"); - if (!item_zone) - return -ENOMEM; - return 0; -} - -void -xfs_filestream_uninit(void) -{ - kmem_zone_destroy(item_zone); -} |