ia64/xen-unstable

changeset 9070:ead0b7fcad3a

Allow blkback to be built as a module.

From: Jan Beulich

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Feb 28 18:56:00 2006 +0100 (2006-02-28)
parents 8ac43508b33b
children 271cb04a4f2b
files linux-2.6-xen-sparse/drivers/xen/Kconfig linux-2.6-xen-sparse/drivers/xen/blkback/Makefile linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/Kconfig	Tue Feb 28 18:15:18 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig	Tue Feb 28 18:56:00 2006 +0100
     1.3 @@ -68,7 +68,7 @@ config XEN_PCIDEV_BE_DEBUG
     1.4  	default n
     1.5  
     1.6  config XEN_BLKDEV_BACKEND
     1.7 -	bool "Block-device backend driver"
     1.8 +	tristate "Block-device backend driver"
     1.9  	default y
    1.10  	help
    1.11  	  The block-device backend driver allows the kernel to export its
    1.12 @@ -76,7 +76,7 @@ config XEN_BLKDEV_BACKEND
    1.13  	  interface.
    1.14  
    1.15  config XEN_BLKDEV_TAP_BE
    1.16 -        bool "Block Tap support for backend driver (DANGEROUS)"
    1.17 +        tristate "Block Tap support for backend driver (DANGEROUS)"
    1.18          depends on XEN_BLKDEV_BACKEND
    1.19          default n
    1.20          help
    1.21 @@ -145,7 +145,7 @@ config XEN_NETDEV_FRONTEND
    1.22  	  (domain 0), then you almost certainly want to say Y here.
    1.23  
    1.24  config XEN_BLKDEV_TAP
    1.25 -	bool "Block device tap driver"
    1.26 +	tristate "Block device tap driver"
    1.27  	default n
    1.28  	help
    1.29  	  This driver allows a VM to interact on block device channels
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/Makefile	Tue Feb 28 18:15:18 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/Makefile	Tue Feb 28 18:56:00 2006 +0100
     2.3 @@ -1,2 +1,3 @@
     2.4 +obj-$(CONFIG_XEN_BLKDEV_BACKEND) := blkbk.o
     2.5  
     2.6 -obj-y	:= blkback.o xenbus.o interface.o vbd.o
     2.7 +blkbk-y	:= blkback.o xenbus.o interface.o vbd.o
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Tue Feb 28 18:15:18 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Tue Feb 28 18:56:00 2006 +0100
     3.3 @@ -29,14 +29,10 @@
     3.4   * 64 should be enough to keep us competitive with Linux.
     3.5   */
     3.6  static int blkif_reqs = 64;
     3.7 -static int mmap_pages;
     3.8 +module_param_named(reqs, blkif_reqs, int, 0);
     3.9 +MODULE_PARM_DESC(reqs, "Number of blkback requests to allocate");
    3.10  
    3.11 -static int __init set_blkif_reqs(char *str)
    3.12 -{
    3.13 -	get_option(&str, &blkif_reqs);
    3.14 -	return 1;
    3.15 -}
    3.16 -__setup("blkif_reqs=", set_blkif_reqs);
    3.17 +static int mmap_pages;
    3.18  
    3.19  /* Run-time switchable: /sys/module/blkback/parameters/ */
    3.20  static unsigned int log_stats = 0;
    3.21 @@ -574,10 +570,20 @@ static int __init blkif_init(void)
    3.22  		list_add_tail(&pending_reqs[i].free_list, &pending_free);
    3.23      
    3.24  	blkif_xenbus_init();
    3.25 +	__unsafe(THIS_MODULE);
    3.26  	return 0;
    3.27  }
    3.28  
    3.29 -__initcall(blkif_init);
    3.30 +module_init(blkif_init);
    3.31 +
    3.32 +static void blkif_exit(void)
    3.33 +{
    3.34 +	BUG();
    3.35 +}
    3.36 +
    3.37 +module_exit(blkif_exit);
    3.38 +
    3.39 +MODULE_LICENSE("Dual BSD/GPL");
    3.40  
    3.41  /*
    3.42   * Local variables: