direct-io.hg

changeset 8450:4dbca1428acd

Initialise grant tables via core_initcall so that it happens
suitably early during the boot process.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Dec 29 17:37:08 2005 +0100 (2005-12-29)
parents b54e981957eb
children fe039c5fd127
files linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Dec 29 16:59:12 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Dec 29 17:37:08 2005 +0100
     1.3 @@ -389,6 +389,30 @@ grant_write(struct file *file, const cha
     1.4  	return -ENOSYS;
     1.5  }
     1.6  
     1.7 +static int __init
     1.8 +gnttab_proc_init(void)
     1.9 +{
    1.10 +	/*
    1.11 +	 *  /proc/xen/grant : used by libxc to access grant tables
    1.12 +	 */
    1.13 +	if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) {
    1.14 +		WPRINTK("Unable to create grant xen proc entry\n");
    1.15 +		return -1;
    1.16 +	}
    1.17 +
    1.18 +	grant_file_ops.read   = grant_pde->proc_fops->read;
    1.19 +	grant_file_ops.write  = grant_pde->proc_fops->write;
    1.20 +
    1.21 +	grant_pde->proc_fops  = &grant_file_ops;
    1.22 +
    1.23 +	grant_pde->read_proc  = &grant_read;
    1.24 +	grant_pde->write_proc = &grant_write;
    1.25 +
    1.26 +	return 0;
    1.27 +}
    1.28 +
    1.29 +device_initcall(gnttab_proc_init);
    1.30 +
    1.31  #endif /* CONFIG_PROC_FS */
    1.32  
    1.33  int
    1.34 @@ -446,29 +470,11 @@ gnttab_init(void)
    1.35  	gnttab_free_count = NR_GRANT_ENTRIES - NR_RESERVED_ENTRIES;
    1.36  	gnttab_free_head  = NR_RESERVED_ENTRIES;
    1.37  
    1.38 -#ifdef CONFIG_PROC_FS
    1.39 -	/*
    1.40 -	 *  /proc/xen/grant : used by libxc to access grant tables
    1.41 -	 */
    1.42 -	if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) {
    1.43 -		WPRINTK("Unable to create grant xen proc entry\n");
    1.44 -		return -1;
    1.45 -	}
    1.46 -
    1.47 -	grant_file_ops.read   = grant_pde->proc_fops->read;
    1.48 -	grant_file_ops.write  = grant_pde->proc_fops->write;
    1.49 -
    1.50 -	grant_pde->proc_fops  = &grant_file_ops;
    1.51 -
    1.52 -	grant_pde->read_proc  = &grant_read;
    1.53 -	grant_pde->write_proc = &grant_write;
    1.54 -#endif
    1.55 -
    1.56  	printk("Grant table initialized\n");
    1.57  	return 0;
    1.58  }
    1.59  
    1.60 -__initcall(gnttab_init);
    1.61 +core_initcall(gnttab_init);
    1.62  
    1.63  /*
    1.64   * Local variables: