aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 5d425d7116e8..03d26f7142c7 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1704,23 +1704,6 @@ static int calculate_sizes(struct kmem_cache *s)
1704 1704
1705} 1705}
1706 1706
1707static int __init finish_bootstrap(void)
1708{
1709 struct list_head *h;
1710 int err;
1711
1712 slab_state = SYSFS;
1713
1714 list_for_each(h, &slab_caches) {
1715 struct kmem_cache *s =
1716 container_of(h, struct kmem_cache, list);
1717
1718 err = sysfs_slab_add(s);
1719 BUG_ON(err);
1720 }
1721 return 0;
1722}
1723
1724static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags, 1707static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags,
1725 const char *name, size_t size, 1708 const char *name, size_t size,
1726 size_t align, unsigned long flags, 1709 size_t align, unsigned long flags,
@@ -3482,6 +3465,7 @@ static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
3482 3465
3483static int __init slab_sysfs_init(void) 3466static int __init slab_sysfs_init(void)
3484{ 3467{
3468 struct list_head *h;
3485 int err; 3469 int err;
3486 3470
3487 err = subsystem_register(&slab_subsys); 3471 err = subsystem_register(&slab_subsys);
@@ -3490,7 +3474,15 @@ static int __init slab_sysfs_init(void)
3490 return -ENOSYS; 3474 return -ENOSYS;
3491 } 3475 }
3492 3476
3493 finish_bootstrap(); 3477 slab_state = SYSFS;
3478
3479 list_for_each(h, &slab_caches) {
3480 struct kmem_cache *s =
3481 container_of(h, struct kmem_cache, list);
3482
3483 err = sysfs_slab_add(s);
3484 BUG_ON(err);
3485 }
3494 3486
3495 while (alias_list) { 3487 while (alias_list) {
3496 struct saved_alias *al = alias_list; 3488 struct saved_alias *al = alias_list;
@@ -3506,6 +3498,4 @@ static int __init slab_sysfs_init(void)
3506} 3498}
3507 3499
3508__initcall(slab_sysfs_init); 3500__initcall(slab_sysfs_init);
3509#else
3510__initcall(finish_bootstrap);
3511#endif 3501#endif