ia64/xen-unstable

changeset 10346:49f65e2b0f1c

[LINUX][XENBUS] replace xenbus_transaction_t with an opaque transaction ID.
xenbus_transaction_t -> struct xenbus_transaction, which just contains
a single u32. Also renamed XBT_NULL to XBT_NIL to emphasize that it
isn't a NULL pointer, but a NIL transaction ID. Compile and boot tested.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
[chrisw: updated for xen-unstable from patchqueue]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jun 09 14:25:46 2006 +0100 (2006-06-09)
parents 7cf4cbe7a3be
children 5a0ed6c47673
files linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c linux-2.6-xen-sparse/drivers/xen/core/reboot.c linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/xen/xenbus.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c	Fri Jun 09 14:23:50 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c	Fri Jun 09 14:25:46 2006 +0100
     1.3 @@ -274,7 +274,7 @@ static int talk_to_backend(struct xenbus
     1.4  {
     1.5  	const char *message = NULL;
     1.6  	int err;
     1.7 -	xenbus_transaction_t xbt;
     1.8 +	struct xenbus_transaction xbt;
     1.9  
    1.10  	err = setup_tpmring(dev, tp);
    1.11  	if (err) {
    1.12 @@ -369,7 +369,7 @@ static int tpmfront_probe(struct xenbus_
    1.13  	if (!tp)
    1.14  		return -ENOMEM;
    1.15  
    1.16 -	err = xenbus_scanf(XBT_NULL, dev->nodename,
    1.17 +	err = xenbus_scanf(XBT_NIL, dev->nodename,
    1.18  	                   "handle", "%i", &handle);
    1.19  	if (XENBUS_EXIST_ERR(err))
    1.20  		return err;
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Fri Jun 09 14:23:50 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Fri Jun 09 14:25:46 2006 +0100
     2.3 @@ -378,7 +378,7 @@ static void watch_target(struct xenbus_w
     2.4  	unsigned long long new_target;
     2.5  	int err;
     2.6  
     2.7 -	err = xenbus_scanf(XBT_NULL, "memory", "target", "%llu", &new_target);
     2.8 +	err = xenbus_scanf(XBT_NIL, "memory", "target", "%llu", &new_target);
     2.9  	if (err != 1) {
    2.10  		/* This is ok (for domain0 at least) - so just return */
    2.11  		return;
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Fri Jun 09 14:23:50 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Fri Jun 09 14:25:46 2006 +0100
     3.3 @@ -186,7 +186,7 @@ static void backend_changed(struct xenbu
     3.4  
     3.5  	DPRINTK("");
     3.6  
     3.7 -	err = xenbus_scanf(XBT_NULL, dev->nodename, "physical-device", "%x:%x",
     3.8 +	err = xenbus_scanf(XBT_NIL, dev->nodename, "physical-device", "%x:%x",
     3.9  			   &major, &minor);
    3.10  	if (XENBUS_EXIST_ERR(err)) {
    3.11  		/* Since this watch will fire once immediately after it is
    3.12 @@ -208,7 +208,7 @@ static void backend_changed(struct xenbu
    3.13  		return;
    3.14  	}
    3.15  
    3.16 -	be->mode = xenbus_read(XBT_NULL, dev->nodename, "mode", NULL);
    3.17 +	be->mode = xenbus_read(XBT_NIL, dev->nodename, "mode", NULL);
    3.18  	if (IS_ERR(be->mode)) {
    3.19  		err = PTR_ERR(be->mode);
    3.20  		be->mode = NULL;
    3.21 @@ -299,7 +299,7 @@ static void frontend_changed(struct xenb
    3.22   */
    3.23  static void connect(struct backend_info *be)
    3.24  {
    3.25 -	xenbus_transaction_t xbt;
    3.26 +	struct xenbus_transaction xbt;
    3.27  	int err;
    3.28  	struct xenbus_device *dev = be->dev;
    3.29  
    3.30 @@ -364,7 +364,7 @@ static int connect_ring(struct backend_i
    3.31  
    3.32  	DPRINTK("%s", dev->otherend);
    3.33  
    3.34 -	err = xenbus_gather(XBT_NULL, dev->otherend, "ring-ref", "%lu", &ring_ref,
    3.35 +	err = xenbus_gather(XBT_NIL, dev->otherend, "ring-ref", "%lu", &ring_ref,
    3.36  			    "event-channel", "%u", &evtchn, NULL);
    3.37  	if (err) {
    3.38  		xenbus_dev_fatal(dev, err,
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Jun 09 14:23:50 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Jun 09 14:25:46 2006 +0100
     4.3 @@ -83,7 +83,7 @@ static int blkfront_probe(struct xenbus_
     4.4  	struct blkfront_info *info;
     4.5  
     4.6  	/* FIXME: Use dynamic device id if this is not set. */
     4.7 -	err = xenbus_scanf(XBT_NULL, dev->nodename,
     4.8 +	err = xenbus_scanf(XBT_NIL, dev->nodename,
     4.9  			   "virtual-device", "%i", &vdevice);
    4.10  	if (err != 1) {
    4.11  		xenbus_dev_fatal(dev, err, "reading virtual-device");
    4.12 @@ -148,7 +148,7 @@ static int talk_to_backend(struct xenbus
    4.13  			   struct blkfront_info *info)
    4.14  {
    4.15  	const char *message = NULL;
    4.16 -	xenbus_transaction_t xbt;
    4.17 +	struct xenbus_transaction xbt;
    4.18  	int err;
    4.19  
    4.20  	/* Create shared ring, alloc event channel. */
    4.21 @@ -303,7 +303,7 @@ static void connect(struct blkfront_info
    4.22  
    4.23  	DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
    4.24  
    4.25 -	err = xenbus_gather(XBT_NULL, info->xbdev->otherend,
    4.26 +	err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
    4.27  			    "sectors", "%lu", &sectors,
    4.28  			    "info", "%u", &binfo,
    4.29  			    "sector-size", "%lu", &sector_size,
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c	Fri Jun 09 14:23:50 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c	Fri Jun 09 14:25:46 2006 +0100
     5.3 @@ -34,7 +34,7 @@ static void vcpu_hotplug(unsigned int cp
     5.4  		return;
     5.5  
     5.6  	sprintf(dir, "cpu/%d", cpu);
     5.7 -	err = xenbus_scanf(XBT_NULL, dir, "availability", "%s", state);
     5.8 +	err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
     5.9  	if (err != 1) {
    5.10  		printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
    5.11  		return;
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c	Fri Jun 09 14:23:50 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c	Fri Jun 09 14:25:46 2006 +0100
     6.3 @@ -250,7 +250,7 @@ static void shutdown_handler(struct xenb
     6.4  			     const char **vec, unsigned int len)
     6.5  {
     6.6  	char *str;
     6.7 -	xenbus_transaction_t xbt;
     6.8 +	struct xenbus_transaction xbt;
     6.9  	int err;
    6.10  
    6.11  	if (shutting_down != SHUTDOWN_INVALID)
    6.12 @@ -298,7 +298,7 @@ static void sysrq_handler(struct xenbus_
    6.13  			  unsigned int len)
    6.14  {
    6.15  	char sysrq_key = '\0';
    6.16 -	xenbus_transaction_t xbt;
    6.17 +	struct xenbus_transaction xbt;
    6.18  	int err;
    6.19  
    6.20   again:
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Fri Jun 09 14:23:50 2006 +0100
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Fri Jun 09 14:25:46 2006 +0100
     7.3 @@ -70,7 +70,7 @@ static int netback_probe(struct xenbus_d
     7.4  			 const struct xenbus_device_id *id)
     7.5  {
     7.6  	const char *message;
     7.7 -	xenbus_transaction_t xbt;
     7.8 +	struct xenbus_transaction xbt;
     7.9  	int err;
    7.10  	struct backend_info *be = kzalloc(sizeof(struct backend_info),
    7.11  					  GFP_KERNEL);
    7.12 @@ -141,7 +141,7 @@ static int netback_uevent(struct xenbus_
    7.13  
    7.14  	DPRINTK("netback_uevent");
    7.15  
    7.16 -	val = xenbus_read(XBT_NULL, xdev->nodename, "script", NULL);
    7.17 +	val = xenbus_read(XBT_NIL, xdev->nodename, "script", NULL);
    7.18  	if (IS_ERR(val)) {
    7.19  		int err = PTR_ERR(val);
    7.20  		xenbus_dev_fatal(xdev, err, "reading script");
    7.21 @@ -177,7 +177,7 @@ static void backend_changed(struct xenbu
    7.22  
    7.23  	DPRINTK("");
    7.24  
    7.25 -	err = xenbus_scanf(XBT_NULL, dev->nodename, "handle", "%li", &handle);
    7.26 +	err = xenbus_scanf(XBT_NIL, dev->nodename, "handle", "%li", &handle);
    7.27  	if (XENBUS_EXIST_ERR(err)) {
    7.28  		/* Since this watch will fire once immediately after it is
    7.29  		   registered, we expect this.  Ignore it, and wait for the
    7.30 @@ -268,7 +268,7 @@ static void xen_net_read_rate(struct xen
    7.31  	*bytes = ~0UL;
    7.32  	*usec = 0;
    7.33  
    7.34 -	ratestr = xenbus_read(XBT_NULL, dev->nodename, "rate", NULL);
    7.35 +	ratestr = xenbus_read(XBT_NIL, dev->nodename, "rate", NULL);
    7.36  	if (IS_ERR(ratestr))
    7.37  		return;
    7.38  
    7.39 @@ -298,7 +298,7 @@ static int xen_net_read_mac(struct xenbu
    7.40  	char *s, *e, *macstr;
    7.41  	int i;
    7.42  
    7.43 -	macstr = s = xenbus_read(XBT_NULL, dev->nodename, "mac", NULL);
    7.44 +	macstr = s = xenbus_read(XBT_NIL, dev->nodename, "mac", NULL);
    7.45  	if (IS_ERR(macstr))
    7.46  		return PTR_ERR(macstr);
    7.47  
    7.48 @@ -347,7 +347,7 @@ static int connect_rings(struct backend_
    7.49  
    7.50  	DPRINTK("");
    7.51  
    7.52 -	err = xenbus_gather(XBT_NULL, dev->otherend,
    7.53 +	err = xenbus_gather(XBT_NIL, dev->otherend,
    7.54  			    "tx-ring-ref", "%lu", &tx_ring_ref,
    7.55  			    "rx-ring-ref", "%lu", &rx_ring_ref,
    7.56  			    "event-channel", "%u", &evtchn, NULL);
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Jun 09 14:23:50 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Jun 09 14:25:46 2006 +0100
     8.3 @@ -193,7 +193,7 @@ static int __devinit netfront_probe(stru
     8.4  	struct netfront_info *info;
     8.5  	unsigned int handle;
     8.6  
     8.7 -	err = xenbus_scanf(XBT_NULL, dev->nodename, "handle", "%u", &handle);
     8.8 +	err = xenbus_scanf(XBT_NIL, dev->nodename, "handle", "%u", &handle);
     8.9  	if (err != 1) {
    8.10  		xenbus_dev_fatal(dev, err, "reading handle");
    8.11  		return err;
    8.12 @@ -243,7 +243,7 @@ static int xen_net_read_mac(struct xenbu
    8.13  	char *s, *e, *macstr;
    8.14  	int i;
    8.15  
    8.16 -	macstr = s = xenbus_read(XBT_NULL, dev->nodename, "mac", NULL);
    8.17 +	macstr = s = xenbus_read(XBT_NIL, dev->nodename, "mac", NULL);
    8.18  	if (IS_ERR(macstr))
    8.19  		return PTR_ERR(macstr);
    8.20  
    8.21 @@ -265,7 +265,7 @@ static int talk_to_backend(struct xenbus
    8.22  			   struct netfront_info *info)
    8.23  {
    8.24  	const char *message;
    8.25 -	xenbus_transaction_t xbt;
    8.26 +	struct xenbus_transaction xbt;
    8.27  	int err;
    8.28  
    8.29  	err = xen_net_read_mac(dev, info->mac);
    8.30 @@ -1057,7 +1057,7 @@ static int xennet_set_sg(struct net_devi
    8.31  		struct netfront_info *np = netdev_priv(dev);
    8.32  		int val;
    8.33  
    8.34 -		if (xenbus_scanf(XBT_NULL, np->xbdev->otherend, "feature-sg",
    8.35 +		if (xenbus_scanf(XBT_NIL, np->xbdev->otherend, "feature-sg",
    8.36  				 "%d", &val) < 0)
    8.37  			val = 0;
    8.38  		if (!val)
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c	Fri Jun 09 14:23:50 2006 +0100
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c	Fri Jun 09 14:25:46 2006 +0100
     9.3 @@ -125,7 +125,7 @@ static int pciback_attach(struct pciback
     9.4  
     9.5  	dev_dbg(&pdev->xdev->dev, "Reading frontend config\n");
     9.6  
     9.7 -	err = xenbus_gather(XBT_NULL, pdev->xdev->otherend,
     9.8 +	err = xenbus_gather(XBT_NIL, pdev->xdev->otherend,
     9.9  			    "pci-op-ref", "%u", &gnt_ref,
    9.10  			    "event-channel", "%u", &remote_evtchn,
    9.11  			    "magic", NULL, &magic, NULL);
    9.12 @@ -200,7 +200,7 @@ static int pciback_publish_pci_root(stru
    9.13  
    9.14  	dev_dbg(&pdev->xdev->dev, "Publishing pci roots\n");
    9.15  
    9.16 -	err = xenbus_scanf(XBT_NULL, pdev->xdev->nodename,
    9.17 +	err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename,
    9.18  			   "root_num", "%d", &root_num);
    9.19  	if (err == 0 || err == -ENOENT)
    9.20  		root_num = 0;
    9.21 @@ -215,7 +215,7 @@ static int pciback_publish_pci_root(stru
    9.22  			goto out;
    9.23  		}
    9.24  
    9.25 -		err = xenbus_scanf(XBT_NULL, pdev->xdev->nodename,
    9.26 +		err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename,
    9.27  				   str, "%x:%x", &d, &b);
    9.28  		if (err < 0)
    9.29  			goto out;
    9.30 @@ -239,12 +239,12 @@ static int pciback_publish_pci_root(stru
    9.31  	dev_dbg(&pdev->xdev->dev, "writing root %d at %04x:%02x\n",
    9.32  		root_num, domain, bus);
    9.33  
    9.34 -	err = xenbus_printf(XBT_NULL, pdev->xdev->nodename, str,
    9.35 +	err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str,
    9.36  			    "%04x:%02x", domain, bus);
    9.37  	if (err)
    9.38  		goto out;
    9.39  
    9.40 -	err = xenbus_printf(XBT_NULL, pdev->xdev->nodename,
    9.41 +	err = xenbus_printf(XBT_NIL, pdev->xdev->nodename,
    9.42  			    "root_num", "%d", (root_num + 1));
    9.43  
    9.44        out:
    9.45 @@ -306,7 +306,7 @@ static int pciback_setup_backend(struct 
    9.46  
    9.47  	dev_dbg(&pdev->xdev->dev, "getting be setup\n");
    9.48  
    9.49 -	err = xenbus_scanf(XBT_NULL, pdev->xdev->nodename, "num_devs", "%d",
    9.50 +	err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, "num_devs", "%d",
    9.51  			   &num_devs);
    9.52  	if (err != 1) {
    9.53  		if (err >= 0)
    9.54 @@ -326,7 +326,7 @@ static int pciback_setup_backend(struct 
    9.55  			goto out;
    9.56  		}
    9.57  
    9.58 -		err = xenbus_scanf(XBT_NULL, pdev->xdev->nodename, dev_str,
    9.59 +		err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, dev_str,
    9.60  				   "%x:%x:%x.%x", &domain, &bus, &slot, &func);
    9.61  		if (err < 0) {
    9.62  			xenbus_dev_fatal(pdev->xdev, err,
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c	Fri Jun 09 14:23:50 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c	Fri Jun 09 14:25:46 2006 +0100
    10.3 @@ -67,7 +67,7 @@ static void free_pdev(struct pcifront_de
    10.4  static int pcifront_publish_info(struct pcifront_device *pdev)
    10.5  {
    10.6  	int err = 0;
    10.7 -	xenbus_transaction_t trans;
    10.8 +	struct xenbus_transaction trans;
    10.9  
   10.10  	err = xenbus_grant_ring(pdev->xdev, virt_to_mfn(pdev->sh_info));
   10.11  	if (err < 0)
   10.12 @@ -143,7 +143,7 @@ static int pcifront_try_connect(struct p
   10.13  		goto out;
   10.14  	}
   10.15  
   10.16 -	err = xenbus_scanf(XBT_NULL, pdev->xdev->otherend,
   10.17 +	err = xenbus_scanf(XBT_NIL, pdev->xdev->otherend,
   10.18  			   "root_num", "%d", &num_roots);
   10.19  	if (err == -ENOENT) {
   10.20  		xenbus_dev_error(pdev->xdev, err,
   10.21 @@ -165,7 +165,7 @@ static int pcifront_try_connect(struct p
   10.22  			goto out;
   10.23  		}
   10.24  
   10.25 -		err = xenbus_scanf(XBT_NULL, pdev->xdev->otherend, str,
   10.26 +		err = xenbus_scanf(XBT_NIL, pdev->xdev->otherend, str,
   10.27  				   "%x:%x", &domain, &bus);
   10.28  		if (err != 2) {
   10.29  			if (err >= 0)
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c	Fri Jun 09 14:23:50 2006 +0100
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c	Fri Jun 09 14:25:46 2006 +0100
    11.3 @@ -110,7 +110,7 @@ static void backend_changed(struct xenbu
    11.4  		= container_of(watch, struct backend_info, backend_watch);
    11.5  	struct xenbus_device *dev = be->dev;
    11.6  
    11.7 -	err = xenbus_scanf(XBT_NULL, dev->nodename,
    11.8 +	err = xenbus_scanf(XBT_NIL, dev->nodename,
    11.9  	                   "instance","%li", &instance);
   11.10  	if (XENBUS_EXIST_ERR(err)) {
   11.11  		return;
   11.12 @@ -204,7 +204,7 @@ static void maybe_connect(struct backend
   11.13  
   11.14  static void connect(struct backend_info *be)
   11.15  {
   11.16 -	xenbus_transaction_t xbt;
   11.17 +	struct xenbus_transaction xbt;
   11.18  	int err;
   11.19  	struct xenbus_device *dev = be->dev;
   11.20  	unsigned long ready = 1;
   11.21 @@ -245,7 +245,7 @@ static int connect_ring(struct backend_i
   11.22  	unsigned int evtchn;
   11.23  	int err;
   11.24  
   11.25 -	err = xenbus_gather(XBT_NULL, dev->otherend,
   11.26 +	err = xenbus_gather(XBT_NIL, dev->otherend,
   11.27  	                    "ring-ref", "%lu", &ring_ref,
   11.28  			    "event-channel", "%u", &evtchn, NULL);
   11.29  	if (err) {
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Fri Jun 09 14:23:50 2006 +0100
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Fri Jun 09 14:25:46 2006 +0100
    12.3 @@ -106,12 +106,12 @@ int xenbus_switch_state(struct xenbus_de
    12.4  	if (state == dev->state)
    12.5  		return 0;
    12.6  
    12.7 -	err = xenbus_scanf(XBT_NULL, dev->nodename, "state", "%d",
    12.8 +	err = xenbus_scanf(XBT_NIL, dev->nodename, "state", "%d",
    12.9  			   &current_state);
   12.10  	if (err != 1)
   12.11  		return 0;
   12.12  
   12.13 -	err = xenbus_printf(XBT_NULL, dev->nodename, "state", "%d", state);
   12.14 +	err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%d", state);
   12.15  	if (err) {
   12.16  		if (state != XenbusStateClosing) /* Avoid looping */
   12.17  			xenbus_dev_fatal(dev, err, "writing new state");
   12.18 @@ -162,7 +162,7 @@ void _dev_error(struct xenbus_device *de
   12.19  		goto fail;
   12.20  	}
   12.21  
   12.22 -	if (xenbus_write(XBT_NULL, path_buffer, "error", printf_buffer) != 0) {
   12.23 +	if (xenbus_write(XBT_NIL, path_buffer, "error", printf_buffer) != 0) {
   12.24  		printk("xenbus: failed to write error node for %s (%s)\n",
   12.25  		       dev->nodename, printf_buffer);
   12.26  		goto fail;
   12.27 @@ -272,7 +272,7 @@ int xenbus_free_evtchn(struct xenbus_dev
   12.28  enum xenbus_state xenbus_read_driver_state(const char *path)
   12.29  {
   12.30  	enum xenbus_state result;
   12.31 -	int err = xenbus_gather(XBT_NULL, path, "state", "%d", &result, NULL);
   12.32 +	int err = xenbus_gather(XBT_NIL, path, "state", "%d", &result, NULL);
   12.33  	if (err)
   12.34  		result = XenbusStateClosed;
   12.35  
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Fri Jun 09 14:23:50 2006 +0100
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Fri Jun 09 14:25:46 2006 +0100
    13.3 @@ -51,7 +51,7 @@
    13.4  
    13.5  struct xenbus_dev_transaction {
    13.6  	struct list_head list;
    13.7 -	xenbus_transaction_t handle;
    13.8 +	struct xenbus_transaction handle;
    13.9  };
   13.10  
   13.11  struct xenbus_dev_data {
   13.12 @@ -154,11 +154,11 @@ static ssize_t xenbus_dev_write(struct f
   13.13  		}
   13.14  
   13.15  		if (msg_type == XS_TRANSACTION_START) {
   13.16 -			trans->handle = simple_strtoul(reply, NULL, 0);
   13.17 +			trans->handle.id = simple_strtoul(reply, NULL, 0);
   13.18  			list_add(&trans->list, &u->transactions);
   13.19  		} else if (msg_type == XS_TRANSACTION_END) {
   13.20  			list_for_each_entry(trans, &u->transactions, list)
   13.21 -				if (trans->handle == u->u.msg.tx_id)
   13.22 +				if (trans->handle.id == u->u.msg.tx_id)
   13.23  					break;
   13.24  			BUG_ON(&trans->list == &u->transactions);
   13.25  			list_del(&trans->list);
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Jun 09 14:23:50 2006 +0100
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Jun 09 14:25:46 2006 +0100
    14.3 @@ -128,7 +128,7 @@ static void free_otherend_watch(struct x
    14.4  static int read_otherend_details(struct xenbus_device *xendev,
    14.5  				 char *id_node, char *path_node)
    14.6  {
    14.7 -	int err = xenbus_gather(XBT_NULL, xendev->nodename,
    14.8 +	int err = xenbus_gather(XBT_NIL, xendev->nodename,
    14.9  				id_node, "%i", &xendev->otherend_id,
   14.10  				path_node, NULL, &xendev->otherend,
   14.11  				NULL);
   14.12 @@ -139,7 +139,7 @@ static int read_otherend_details(struct 
   14.13  		return err;
   14.14  	}
   14.15  	if (strlen(xendev->otherend) == 0 ||
   14.16 -	    !xenbus_exists(XBT_NULL, xendev->otherend, "")) {
   14.17 +	    !xenbus_exists(XBT_NIL, xendev->otherend, "")) {
   14.18  		xenbus_dev_fatal(xendev, -ENOENT, "missing other end from %s",
   14.19  				 xendev->nodename);
   14.20  		free_otherend_details(xendev);
   14.21 @@ -195,14 +195,14 @@ static int backend_bus_id(char bus_id[BU
   14.22  
   14.23  	devid = strrchr(nodename, '/') + 1;
   14.24  
   14.25 -	err = xenbus_gather(XBT_NULL, nodename, "frontend-id", "%i", &domid,
   14.26 +	err = xenbus_gather(XBT_NIL, nodename, "frontend-id", "%i", &domid,
   14.27  			    "frontend", NULL, &frontend,
   14.28  			    NULL);
   14.29  	if (err)
   14.30  		return err;
   14.31  	if (strlen(frontend) == 0)
   14.32  		err = -ERANGE;
   14.33 -	if (!err && !xenbus_exists(XBT_NULL, frontend, ""))
   14.34 +	if (!err && !xenbus_exists(XBT_NIL, frontend, ""))
   14.35  		err = -ENOENT;
   14.36  
   14.37  	kfree(frontend);
   14.38 @@ -634,7 +634,7 @@ static int xenbus_probe_backend(const ch
   14.39  	if (!nodename)
   14.40  		return -ENOMEM;
   14.41  
   14.42 -	dir = xenbus_directory(XBT_NULL, nodename, "", &dir_n);
   14.43 +	dir = xenbus_directory(XBT_NIL, nodename, "", &dir_n);
   14.44  	if (IS_ERR(dir)) {
   14.45  		kfree(nodename);
   14.46  		return PTR_ERR(dir);
   14.47 @@ -657,7 +657,7 @@ static int xenbus_probe_device_type(stru
   14.48  	unsigned int dir_n = 0;
   14.49  	int i;
   14.50  
   14.51 -	dir = xenbus_directory(XBT_NULL, bus->root, type, &dir_n);
   14.52 +	dir = xenbus_directory(XBT_NIL, bus->root, type, &dir_n);
   14.53  	if (IS_ERR(dir))
   14.54  		return PTR_ERR(dir);
   14.55  
   14.56 @@ -676,7 +676,7 @@ static int xenbus_probe_devices(struct x
   14.57  	char **dir;
   14.58  	unsigned int i, dir_n;
   14.59  
   14.60 -	dir = xenbus_directory(XBT_NULL, bus->root, "", &dir_n);
   14.61 +	dir = xenbus_directory(XBT_NIL, bus->root, "", &dir_n);
   14.62  	if (IS_ERR(dir))
   14.63  		return PTR_ERR(dir);
   14.64  
   14.65 @@ -722,7 +722,7 @@ static void dev_changed(const char *node
   14.66  	if (char_count(node, '/') < 2)
   14.67   		return;
   14.68  
   14.69 -	exists = xenbus_exists(XBT_NULL, node, "");
   14.70 +	exists = xenbus_exists(XBT_NIL, node, "");
   14.71  	if (!exists) {
   14.72  		xenbus_cleanup_devices(node, &bus->bus);
   14.73  		return;
    15.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Fri Jun 09 14:23:50 2006 +0100
    15.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Fri Jun 09 14:25:46 2006 +0100
    15.3 @@ -192,7 +192,7 @@ void *xenbus_dev_request_and_reply(struc
    15.4  }
    15.5  
    15.6  /* Send message to xs, get kmalloc'ed reply.  ERR_PTR() on error. */
    15.7 -static void *xs_talkv(xenbus_transaction_t t,
    15.8 +static void *xs_talkv(struct xenbus_transaction t,
    15.9  		      enum xsd_sockmsg_type type,
   15.10  		      const struct kvec *iovec,
   15.11  		      unsigned int num_vecs,
   15.12 @@ -203,7 +203,7 @@ static void *xs_talkv(xenbus_transaction
   15.13  	unsigned int i;
   15.14  	int err;
   15.15  
   15.16 -	msg.tx_id = t;
   15.17 +	msg.tx_id = t.id;
   15.18  	msg.req_id = 0;
   15.19  	msg.type = type;
   15.20  	msg.len = 0;
   15.21 @@ -251,7 +251,7 @@ static void *xs_talkv(xenbus_transaction
   15.22  }
   15.23  
   15.24  /* Simplified version of xs_talkv: single message. */
   15.25 -static void *xs_single(xenbus_transaction_t t,
   15.26 +static void *xs_single(struct xenbus_transaction t,
   15.27  		       enum xsd_sockmsg_type type,
   15.28  		       const char *string,
   15.29  		       unsigned int *len)
   15.30 @@ -318,7 +318,7 @@ static char **split(char *strings, unsig
   15.31  	return ret;
   15.32  }
   15.33  
   15.34 -char **xenbus_directory(xenbus_transaction_t t,
   15.35 +char **xenbus_directory(struct xenbus_transaction t,
   15.36  			const char *dir, const char *node, unsigned int *num)
   15.37  {
   15.38  	char *strings, *path;
   15.39 @@ -338,7 +338,7 @@ char **xenbus_directory(xenbus_transacti
   15.40  EXPORT_SYMBOL_GPL(xenbus_directory);
   15.41  
   15.42  /* Check if a path exists. Return 1 if it does. */
   15.43 -int xenbus_exists(xenbus_transaction_t t,
   15.44 +int xenbus_exists(struct xenbus_transaction t,
   15.45  		  const char *dir, const char *node)
   15.46  {
   15.47  	char **d;
   15.48 @@ -356,7 +356,7 @@ EXPORT_SYMBOL_GPL(xenbus_exists);
   15.49   * Returns a kmalloced value: call free() on it after use.
   15.50   * len indicates length in bytes.
   15.51   */
   15.52 -void *xenbus_read(xenbus_transaction_t t,
   15.53 +void *xenbus_read(struct xenbus_transaction t,
   15.54  		  const char *dir, const char *node, unsigned int *len)
   15.55  {
   15.56  	char *path;
   15.57 @@ -375,7 +375,7 @@ EXPORT_SYMBOL_GPL(xenbus_read);
   15.58  /* Write the value of a single file.
   15.59   * Returns -err on failure.
   15.60   */
   15.61 -int xenbus_write(xenbus_transaction_t t,
   15.62 +int xenbus_write(struct xenbus_transaction t,
   15.63  		 const char *dir, const char *node, const char *string)
   15.64  {
   15.65  	const char *path;
   15.66 @@ -398,7 +398,7 @@ int xenbus_write(xenbus_transaction_t t,
   15.67  EXPORT_SYMBOL_GPL(xenbus_write);
   15.68  
   15.69  /* Create a new directory. */
   15.70 -int xenbus_mkdir(xenbus_transaction_t t,
   15.71 +int xenbus_mkdir(struct xenbus_transaction t,
   15.72  		 const char *dir, const char *node)
   15.73  {
   15.74  	char *path;
   15.75 @@ -415,7 +415,7 @@ int xenbus_mkdir(xenbus_transaction_t t,
   15.76  EXPORT_SYMBOL_GPL(xenbus_mkdir);
   15.77  
   15.78  /* Destroy a file or directory (directories must be empty). */
   15.79 -int xenbus_rm(xenbus_transaction_t t, const char *dir, const char *node)
   15.80 +int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node)
   15.81  {
   15.82  	char *path;
   15.83  	int ret;
   15.84 @@ -433,19 +433,19 @@ EXPORT_SYMBOL_GPL(xenbus_rm);
   15.85  /* Start a transaction: changes by others will not be seen during this
   15.86   * transaction, and changes will not be visible to others until end.
   15.87   */
   15.88 -int xenbus_transaction_start(xenbus_transaction_t *t)
   15.89 +int xenbus_transaction_start(struct xenbus_transaction *t)
   15.90  {
   15.91  	char *id_str;
   15.92  
   15.93  	down_read(&xs_state.suspend_mutex);
   15.94  
   15.95 -	id_str = xs_single(XBT_NULL, XS_TRANSACTION_START, "", NULL);
   15.96 +	id_str = xs_single(XBT_NIL, XS_TRANSACTION_START, "", NULL);
   15.97  	if (IS_ERR(id_str)) {
   15.98  		up_read(&xs_state.suspend_mutex);
   15.99  		return PTR_ERR(id_str);
  15.100  	}
  15.101  
  15.102 -	*t = simple_strtoul(id_str, NULL, 0);
  15.103 +	t->id = simple_strtoul(id_str, NULL, 0);
  15.104  	kfree(id_str);
  15.105  	return 0;
  15.106  }
  15.107 @@ -454,7 +454,7 @@ EXPORT_SYMBOL_GPL(xenbus_transaction_sta
  15.108  /* End a transaction.
  15.109   * If abandon is true, transaction is discarded instead of committed.
  15.110   */
  15.111 -int xenbus_transaction_end(xenbus_transaction_t t, int abort)
  15.112 +int xenbus_transaction_end(struct xenbus_transaction t, int abort)
  15.113  {
  15.114  	char abortstr[2];
  15.115  	int err;
  15.116 @@ -473,7 +473,7 @@ int xenbus_transaction_end(xenbus_transa
  15.117  EXPORT_SYMBOL_GPL(xenbus_transaction_end);
  15.118  
  15.119  /* Single read and scanf: returns -errno or num scanned. */
  15.120 -int xenbus_scanf(xenbus_transaction_t t,
  15.121 +int xenbus_scanf(struct xenbus_transaction t,
  15.122  		 const char *dir, const char *node, const char *fmt, ...)
  15.123  {
  15.124  	va_list ap;
  15.125 @@ -496,7 +496,7 @@ int xenbus_scanf(xenbus_transaction_t t,
  15.126  EXPORT_SYMBOL_GPL(xenbus_scanf);
  15.127  
  15.128  /* Single printf and write: returns -errno or 0. */
  15.129 -int xenbus_printf(xenbus_transaction_t t,
  15.130 +int xenbus_printf(struct xenbus_transaction t,
  15.131  		  const char *dir, const char *node, const char *fmt, ...)
  15.132  {
  15.133  	va_list ap;
  15.134 @@ -522,7 +522,7 @@ int xenbus_printf(xenbus_transaction_t t
  15.135  EXPORT_SYMBOL_GPL(xenbus_printf);
  15.136  
  15.137  /* Takes tuples of names, scanf-style args, and void **, NULL terminated. */
  15.138 -int xenbus_gather(xenbus_transaction_t t, const char *dir, ...)
  15.139 +int xenbus_gather(struct xenbus_transaction t, const char *dir, ...)
  15.140  {
  15.141  	va_list ap;
  15.142  	const char *name;
  15.143 @@ -560,7 +560,7 @@ static int xs_watch(const char *path, co
  15.144  	iov[1].iov_base = (void *)token;
  15.145  	iov[1].iov_len = strlen(token) + 1;
  15.146  
  15.147 -	return xs_error(xs_talkv(XBT_NULL, XS_WATCH, iov,
  15.148 +	return xs_error(xs_talkv(XBT_NIL, XS_WATCH, iov,
  15.149  				 ARRAY_SIZE(iov), NULL));
  15.150  }
  15.151  
  15.152 @@ -573,7 +573,7 @@ static int xs_unwatch(const char *path, 
  15.153  	iov[1].iov_base = (char *)token;
  15.154  	iov[1].iov_len = strlen(token) + 1;
  15.155  
  15.156 -	return xs_error(xs_talkv(XBT_NULL, XS_UNWATCH, iov,
  15.157 +	return xs_error(xs_talkv(XBT_NIL, XS_UNWATCH, iov,
  15.158  				 ARRAY_SIZE(iov), NULL));
  15.159  }
  15.160  
    16.1 --- a/linux-2.6-xen-sparse/include/xen/xenbus.h	Fri Jun 09 14:23:50 2006 +0100
    16.2 +++ b/linux-2.6-xen-sparse/include/xen/xenbus.h	Fri Jun 09 14:25:46 2006 +0100
    16.3 @@ -42,8 +42,6 @@
    16.4  #include <xen/interface/io/xenbus.h>
    16.5  #include <xen/interface/io/xs_wire.h>
    16.6  
    16.7 -#define XBT_NULL 0
    16.8 -
    16.9  /* Register callback to watch this node. */
   16.10  struct xenbus_watch
   16.11  {
   16.12 @@ -115,35 +113,41 @@ int xenbus_register_frontend(struct xenb
   16.13  int xenbus_register_backend(struct xenbus_driver *drv);
   16.14  void xenbus_unregister_driver(struct xenbus_driver *drv);
   16.15  
   16.16 -typedef u32 xenbus_transaction_t;
   16.17 +struct xenbus_transaction
   16.18 +{
   16.19 +	u32 id;
   16.20 +};
   16.21  
   16.22 -char **xenbus_directory(xenbus_transaction_t t,
   16.23 +/* Nil transaction ID. */
   16.24 +#define XBT_NIL ((struct xenbus_transaction) { 0 })
   16.25 +
   16.26 +char **xenbus_directory(struct xenbus_transaction t,
   16.27  			const char *dir, const char *node, unsigned int *num);
   16.28 -void *xenbus_read(xenbus_transaction_t t,
   16.29 +void *xenbus_read(struct xenbus_transaction t,
   16.30  		  const char *dir, const char *node, unsigned int *len);
   16.31 -int xenbus_write(xenbus_transaction_t t,
   16.32 +int xenbus_write(struct xenbus_transaction t,
   16.33  		 const char *dir, const char *node, const char *string);
   16.34 -int xenbus_mkdir(xenbus_transaction_t t,
   16.35 +int xenbus_mkdir(struct xenbus_transaction t,
   16.36  		 const char *dir, const char *node);
   16.37 -int xenbus_exists(xenbus_transaction_t t,
   16.38 +int xenbus_exists(struct xenbus_transaction t,
   16.39  		  const char *dir, const char *node);
   16.40 -int xenbus_rm(xenbus_transaction_t t, const char *dir, const char *node);
   16.41 -int xenbus_transaction_start(xenbus_transaction_t *t);
   16.42 -int xenbus_transaction_end(xenbus_transaction_t t, int abort);
   16.43 +int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node);
   16.44 +int xenbus_transaction_start(struct xenbus_transaction *t);
   16.45 +int xenbus_transaction_end(struct xenbus_transaction t, int abort);
   16.46  
   16.47  /* Single read and scanf: returns -errno or num scanned if > 0. */
   16.48 -int xenbus_scanf(xenbus_transaction_t t,
   16.49 +int xenbus_scanf(struct xenbus_transaction t,
   16.50  		 const char *dir, const char *node, const char *fmt, ...)
   16.51  	__attribute__((format(scanf, 4, 5)));
   16.52  
   16.53  /* Single printf and write: returns -errno or 0. */
   16.54 -int xenbus_printf(xenbus_transaction_t t,
   16.55 +int xenbus_printf(struct xenbus_transaction t,
   16.56  		  const char *dir, const char *node, const char *fmt, ...)
   16.57  	__attribute__((format(printf, 4, 5)));
   16.58  
   16.59  /* Generic read function: NULL-terminated triples of name,
   16.60   * sprintf-style type string, and pointer. Returns 0 or errno.*/
   16.61 -int xenbus_gather(xenbus_transaction_t t, const char *dir, ...);
   16.62 +int xenbus_gather(struct xenbus_transaction t, const char *dir, ...);
   16.63  
   16.64  /* notifer routines for when the xenstore comes up */
   16.65  int register_xenstore_notifier(struct notifier_block *nb);