Просмотр исходного кода

make sure that nsproxy_cache is initialized early enough

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 14 лет назад
Родитель
Сommit
6657719390
3 измененных файлов с 3 добавлено и 3 удалено
  1. 1 0
      include/linux/nsproxy.h
  2. 1 0
      kernel/fork.c
  3. 1 3
      kernel/nsproxy.c

+ 1 - 0
include/linux/nsproxy.h

@@ -68,6 +68,7 @@ void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
 void free_nsproxy(struct nsproxy *ns);
 void free_nsproxy(struct nsproxy *ns);
 int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
 int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
 	struct fs_struct *);
 	struct fs_struct *);
+int __init nsproxy_cache_init(void);
 
 
 static inline void put_nsproxy(struct nsproxy *ns)
 static inline void put_nsproxy(struct nsproxy *ns)
 {
 {

+ 1 - 0
kernel/fork.c

@@ -1574,6 +1574,7 @@ void __init proc_caches_init(void)
 			SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
 			SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
 	vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC);
 	vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC);
 	mmap_init();
 	mmap_init();
+	nsproxy_cache_init();
 }
 }
 
 
 /*
 /*

+ 1 - 3
kernel/nsproxy.c

@@ -271,10 +271,8 @@ out:
 	return err;
 	return err;
 }
 }
 
 
-static int __init nsproxy_cache_init(void)
+int __init nsproxy_cache_init(void)
 {
 {
 	nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC);
 	nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC);
 	return 0;
 	return 0;
 }
 }
-
-module_init(nsproxy_cache_init);