-
Notifications
You must be signed in to change notification settings - Fork 2
/
blkback-be-nodename.diff
79 lines (67 loc) · 1.91 KB
/
blkback-be-nodename.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
diff -r b0ef21dd2943 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c Thu Jun 24 17:01:41 2010 -0700
+++ b/drivers/xen/blkback/xenbus.c Thu Jun 24 17:06:38 2010 -0700
@@ -37,7 +37,6 @@
unsigned major;
unsigned minor;
int group_added;
- char *nodename;
atomic_t refcnt;
pid_t kthread_pid;
int shutdown_signalled;
@@ -275,6 +274,7 @@
static void signal_shutdown(struct backend_info *be)
{
+ struct xenbus_device *xbdev = be->dev;
int err;
down(&blkback_dev_sem);
@@ -282,10 +282,10 @@
if (be->shutdown_signalled)
goto out;
- err = xenbus_write(XBT_NIL, be->nodename, "shutdown-done", "");
+ err = xenbus_write(XBT_NIL, xbdev->nodename, "shutdown-done", "");
if (err)
WPRINTK("Error writing shutdown-done for %s: %d\n",
- be->nodename, err);
+ xbdev->nodename, err);
if (be->dev)
xenbus_switch_state(be->dev, XenbusStateClosed);
@@ -315,13 +315,12 @@
be->blkif = NULL;
}
- kfree(be->nodename);
kfree(be);
}
-static int blkback_remove(struct xenbus_device *dev)
+static int blkback_remove(struct xenbus_device *xbdev)
{
- struct backend_info *be = dev->dev.driver_data;
+ struct backend_info *be = xbdev->dev.driver_data;
down(&blkback_dev_sem);
be->dev = NULL;
@@ -346,12 +345,12 @@
}
if (kthread_remove(be))
- WPRINTK("BAD REMOVE REQUEST for %s\n", be->nodename);
+ WPRINTK("BAD REMOVE REQUEST for %s\n", xbdev->nodename);
- xenvbd_sysfs_delif(dev);
+ xenvbd_sysfs_delif(xbdev);
backend_release(be);
- dev->dev.driver_data = NULL;
+ xbdev->dev.driver_data = NULL;
return 0;
}
@@ -523,14 +522,6 @@
dev->dev.driver_data = be;
atomic_set(&be->refcnt, 1);
- be->nodename = kasprintf(GFP_KERNEL, "%s", dev->nodename);
- if (!be->nodename) {
- xenbus_dev_fatal(dev, -ENOMEM,
- "allocating backend structure");
- kfree(be);
- return -ENOMEM;
- }
-
be->blkif = blkif_alloc(dev->otherend_id);
if (IS_ERR(be->blkif)) {
err = PTR_ERR(be->blkif);