aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-12-29 17:37:08 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-12-29 17:37:08 +0100
commit9647c68ca200c65979542f779095b8542b180ef2 (patch)
tree1e1bae34bf6256db53df22d1ee05f186d58c8d8d
parentb33ac9e43315d6e9864e2d324f8f5a620d5ec421 (diff)
downloadxen-9647c68ca200c65979542f779095b8542b180ef2.tar.gz
xen-9647c68ca200c65979542f779095b8542b180ef2.tar.bz2
xen-9647c68ca200c65979542f779095b8542b180ef2.zip
Initialise grant tables via core_initcall so that it happens
suitably early during the boot process. Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
index 446e5d359d..632ab1fafd 100644
--- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
@@ -389,6 +389,30 @@ grant_write(struct file *file, const char __user *buffer, unsigned long count,
return -ENOSYS;
}
+static int __init
+gnttab_proc_init(void)
+{
+ /*
+ * /proc/xen/grant : used by libxc to access grant tables
+ */
+ if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) {
+ WPRINTK("Unable to create grant xen proc entry\n");
+ return -1;
+ }
+
+ grant_file_ops.read = grant_pde->proc_fops->read;
+ grant_file_ops.write = grant_pde->proc_fops->write;
+
+ grant_pde->proc_fops = &grant_file_ops;
+
+ grant_pde->read_proc = &grant_read;
+ grant_pde->write_proc = &grant_write;
+
+ return 0;
+}
+
+device_initcall(gnttab_proc_init);
+
#endif /* CONFIG_PROC_FS */
int
@@ -446,29 +470,11 @@ gnttab_init(void)
gnttab_free_count = NR_GRANT_ENTRIES - NR_RESERVED_ENTRIES;
gnttab_free_head = NR_RESERVED_ENTRIES;
-#ifdef CONFIG_PROC_FS
- /*
- * /proc/xen/grant : used by libxc to access grant tables
- */
- if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) {
- WPRINTK("Unable to create grant xen proc entry\n");
- return -1;
- }
-
- grant_file_ops.read = grant_pde->proc_fops->read;
- grant_file_ops.write = grant_pde->proc_fops->write;
-
- grant_pde->proc_fops = &grant_file_ops;
-
- grant_pde->read_proc = &grant_read;
- grant_pde->write_proc = &grant_write;
-#endif
-
printk("Grant table initialized\n");
return 0;
}
-__initcall(gnttab_init);
+core_initcall(gnttab_init);
/*
* Local variables: