diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/xen/blkback/blkback.c | 24 | ||||
-rw-r--r-- | drivers/xen/blkback/common.h | 23 | ||||
-rw-r--r-- | drivers/xen/blkback/interface.c | 16 | ||||
-rw-r--r-- | drivers/xen/blkback/vbd.c | 6 | ||||
-rw-r--r-- | drivers/xen/blkback/xenbus.c | 6 |
5 files changed, 38 insertions, 37 deletions
diff --git a/drivers/xen/blkback/blkback.c b/drivers/xen/blkback/blkback.c index 8a4b1e8eeb62..d07ad5318a85 100644 --- a/drivers/xen/blkback/blkback.c +++ b/drivers/xen/blkback/blkback.c | |||
@@ -75,7 +75,7 @@ module_param(debug_lvl, int, 0644); | |||
75 | * response queued for it, with the saved 'id' passed back. | 75 | * response queued for it, with the saved 'id' passed back. |
76 | */ | 76 | */ |
77 | typedef struct { | 77 | typedef struct { |
78 | blkif_t *blkif; | 78 | struct blkif_st *blkif; |
79 | u64 id; | 79 | u64 id; |
80 | int nr_pages; | 80 | int nr_pages; |
81 | atomic_t pendcnt; | 81 | atomic_t pendcnt; |
@@ -123,11 +123,11 @@ static inline unsigned long vaddr(pending_req_t *req, int seg) | |||
123 | (blkbk->pending_grant_handles[vaddr_pagenr(_req, _seg)]) | 123 | (blkbk->pending_grant_handles[vaddr_pagenr(_req, _seg)]) |
124 | 124 | ||
125 | 125 | ||
126 | static int do_block_io_op(blkif_t *blkif); | 126 | static int do_block_io_op(struct blkif_st *blkif); |
127 | static void dispatch_rw_block_io(blkif_t *blkif, | 127 | static void dispatch_rw_block_io(struct blkif_st *blkif, |
128 | struct blkif_request *req, | 128 | struct blkif_request *req, |
129 | pending_req_t *pending_req); | 129 | pending_req_t *pending_req); |
130 | static void make_response(blkif_t *blkif, u64 id, | 130 | static void make_response(struct blkif_st *blkif, u64 id, |
131 | unsigned short op, int st); | 131 | unsigned short op, int st); |
132 | 132 | ||
133 | /* | 133 | /* |
@@ -169,7 +169,7 @@ static void free_req(pending_req_t *req) | |||
169 | * It is OK to make multiple calls in this function as it | 169 | * It is OK to make multiple calls in this function as it |
170 | * resets the plug to NULL when it is done on the first call. | 170 | * resets the plug to NULL when it is done on the first call. |
171 | */ | 171 | */ |
172 | static void unplug_queue(blkif_t *blkif) | 172 | static void unplug_queue(struct blkif_st *blkif) |
173 | { | 173 | { |
174 | if (blkif->plug == NULL) | 174 | if (blkif->plug == NULL) |
175 | return; | 175 | return; |
@@ -185,7 +185,7 @@ static void unplug_queue(blkif_t *blkif) | |||
185 | * not to double reference. We also give back a reference count | 185 | * not to double reference. We also give back a reference count |
186 | * if it corresponds to another queue. | 186 | * if it corresponds to another queue. |
187 | */ | 187 | */ |
188 | static void plug_queue(blkif_t *blkif, struct block_device *bdev) | 188 | static void plug_queue(struct blkif_st *blkif, struct block_device *bdev) |
189 | { | 189 | { |
190 | struct request_queue *q = bdev_get_queue(bdev); | 190 | struct request_queue *q = bdev_get_queue(bdev); |
191 | 191 | ||
@@ -237,7 +237,7 @@ static void fast_flush_area(pending_req_t *req) | |||
237 | * SCHEDULER FUNCTIONS | 237 | * SCHEDULER FUNCTIONS |
238 | */ | 238 | */ |
239 | 239 | ||
240 | static void print_stats(blkif_t *blkif) | 240 | static void print_stats(struct blkif_st *blkif) |
241 | { | 241 | { |
242 | printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | br %4d\n", | 242 | printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | br %4d\n", |
243 | current->comm, blkif->st_oo_req, | 243 | current->comm, blkif->st_oo_req, |
@@ -250,7 +250,7 @@ static void print_stats(blkif_t *blkif) | |||
250 | 250 | ||
251 | int blkif_schedule(void *arg) | 251 | int blkif_schedule(void *arg) |
252 | { | 252 | { |
253 | blkif_t *blkif = arg; | 253 | struct blkif_st *blkif = arg; |
254 | struct vbd *vbd = &blkif->vbd; | 254 | struct vbd *vbd = &blkif->vbd; |
255 | 255 | ||
256 | blkif_get(blkif); | 256 | blkif_get(blkif); |
@@ -337,7 +337,7 @@ static void end_block_io_op(struct bio *bio, int error) | |||
337 | * Notification from the guest OS. | 337 | * Notification from the guest OS. |
338 | */ | 338 | */ |
339 | 339 | ||
340 | static void blkif_notify_work(blkif_t *blkif) | 340 | static void blkif_notify_work(struct blkif_st *blkif) |
341 | { | 341 | { |
342 | blkif->waiting_reqs = 1; | 342 | blkif->waiting_reqs = 1; |
343 | wake_up(&blkif->wq); | 343 | wake_up(&blkif->wq); |
@@ -356,7 +356,7 @@ irqreturn_t blkif_be_int(int irq, void *dev_id) | |||
356 | * (which has the sectors we want, number of them, grant references, etc), | 356 | * (which has the sectors we want, number of them, grant references, etc), |
357 | * and transmute it to the block API to hand it over to the proper block disk. | 357 | * and transmute it to the block API to hand it over to the proper block disk. |
358 | */ | 358 | */ |
359 | static int do_block_io_op(blkif_t *blkif) | 359 | static int do_block_io_op(struct blkif_st *blkif) |
360 | { | 360 | { |
361 | union blkif_back_rings *blk_rings = &blkif->blk_rings; | 361 | union blkif_back_rings *blk_rings = &blkif->blk_rings; |
362 | struct blkif_request req; | 362 | struct blkif_request req; |
@@ -438,7 +438,7 @@ static int do_block_io_op(blkif_t *blkif) | |||
438 | * Transumation of the 'struct blkif_request' to a proper 'struct bio' | 438 | * Transumation of the 'struct blkif_request' to a proper 'struct bio' |
439 | * and call the 'submit_bio' to pass it to the underlaying storage. | 439 | * and call the 'submit_bio' to pass it to the underlaying storage. |
440 | */ | 440 | */ |
441 | static void dispatch_rw_block_io(blkif_t *blkif, | 441 | static void dispatch_rw_block_io(struct blkif_st *blkif, |
442 | struct blkif_request *req, | 442 | struct blkif_request *req, |
443 | pending_req_t *pending_req) | 443 | pending_req_t *pending_req) |
444 | { | 444 | { |
@@ -633,7 +633,7 @@ static void dispatch_rw_block_io(blkif_t *blkif, | |||
633 | /* | 633 | /* |
634 | * Put a response on the ring on how the operation fared. | 634 | * Put a response on the ring on how the operation fared. |
635 | */ | 635 | */ |
636 | static void make_response(blkif_t *blkif, u64 id, | 636 | static void make_response(struct blkif_st *blkif, u64 id, |
637 | unsigned short op, int st) | 637 | unsigned short op, int st) |
638 | { | 638 | { |
639 | struct blkif_response resp; | 639 | struct blkif_response resp; |
diff --git a/drivers/xen/blkback/common.h b/drivers/xen/blkback/common.h index 4c140c8e75bd..be3fc93d8a31 100644 --- a/drivers/xen/blkback/common.h +++ b/drivers/xen/blkback/common.h | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <linux/blkdev.h> | 34 | #include <linux/blkdev.h> |
35 | #include <linux/vmalloc.h> | 35 | #include <linux/vmalloc.h> |
36 | #include <linux/wait.h> | 36 | #include <linux/wait.h> |
37 | #include <asm/io.h> | 37 | #include <linux/io.h> |
38 | #include <asm/setup.h> | 38 | #include <asm/setup.h> |
39 | #include <asm/pgalloc.h> | 39 | #include <asm/pgalloc.h> |
40 | #include <asm/hypervisor.h> | 40 | #include <asm/hypervisor.h> |
@@ -44,7 +44,7 @@ | |||
44 | 44 | ||
45 | #define DPRINTK(_f, _a...) \ | 45 | #define DPRINTK(_f, _a...) \ |
46 | pr_debug("(file=%s, line=%d) " _f, \ | 46 | pr_debug("(file=%s, line=%d) " _f, \ |
47 | __FILE__ , __LINE__ , ## _a ) | 47 | __FILE__ , __LINE__ , ## _a) |
48 | 48 | ||
49 | struct vbd { | 49 | struct vbd { |
50 | blkif_vdev_t handle; /* what the domain refers to this vbd as */ | 50 | blkif_vdev_t handle; /* what the domain refers to this vbd as */ |
@@ -57,7 +57,7 @@ struct vbd { | |||
57 | 57 | ||
58 | struct backend_info; | 58 | struct backend_info; |
59 | 59 | ||
60 | typedef struct blkif_st { | 60 | struct blkif_st { |
61 | /* Unique identifier for this interface. */ | 61 | /* Unique identifier for this interface. */ |
62 | domid_t domid; | 62 | domid_t domid; |
63 | unsigned int handle; | 63 | unsigned int handle; |
@@ -94,13 +94,14 @@ typedef struct blkif_st { | |||
94 | 94 | ||
95 | grant_handle_t shmem_handle; | 95 | grant_handle_t shmem_handle; |
96 | grant_ref_t shmem_ref; | 96 | grant_ref_t shmem_ref; |
97 | } blkif_t; | 97 | }; |
98 | 98 | ||
99 | blkif_t *blkif_alloc(domid_t domid); | 99 | struct blkif_st *blkif_alloc(domid_t domid); |
100 | void blkif_disconnect(blkif_t *blkif); | 100 | void blkif_disconnect(struct blkif_st *blkif); |
101 | void blkif_free(blkif_t *blkif); | 101 | void blkif_free(struct blkif_st *blkif); |
102 | int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn); | 102 | int blkif_map(struct blkif_st *blkif, unsigned long shared_page, |
103 | void vbd_resize(blkif_t *blkif); | 103 | unsigned int evtchn); |
104 | void vbd_resize(struct blkif_st *blkif); | ||
104 | 105 | ||
105 | #define blkif_get(_b) (atomic_inc(&(_b)->refcnt)) | 106 | #define blkif_get(_b) (atomic_inc(&(_b)->refcnt)) |
106 | #define blkif_put(_b) \ | 107 | #define blkif_put(_b) \ |
@@ -110,7 +111,7 @@ void vbd_resize(blkif_t *blkif); | |||
110 | } while (0) | 111 | } while (0) |
111 | 112 | ||
112 | /* Create a vbd. */ | 113 | /* Create a vbd. */ |
113 | int vbd_create(blkif_t *blkif, blkif_vdev_t vdevice, unsigned major, | 114 | int vbd_create(struct blkif_st *blkif, blkif_vdev_t vdevice, unsigned major, |
114 | unsigned minor, int readonly, int cdrom); | 115 | unsigned minor, int readonly, int cdrom); |
115 | void vbd_free(struct vbd *vbd); | 116 | void vbd_free(struct vbd *vbd); |
116 | 117 | ||
@@ -125,7 +126,7 @@ struct phys_req { | |||
125 | blkif_sector_t sector_number; | 126 | blkif_sector_t sector_number; |
126 | }; | 127 | }; |
127 | 128 | ||
128 | int vbd_translate(struct phys_req *req, blkif_t *blkif, int operation); | 129 | int vbd_translate(struct phys_req *req, struct blkif_st *blkif, int operation); |
129 | 130 | ||
130 | int blkif_interface_init(void); | 131 | int blkif_interface_init(void); |
131 | 132 | ||
diff --git a/drivers/xen/blkback/interface.c b/drivers/xen/blkback/interface.c index a4a15350737f..7d59f13115cf 100644 --- a/drivers/xen/blkback/interface.c +++ b/drivers/xen/blkback/interface.c | |||
@@ -35,9 +35,9 @@ | |||
35 | 35 | ||
36 | static struct kmem_cache *blkif_cachep; | 36 | static struct kmem_cache *blkif_cachep; |
37 | 37 | ||
38 | blkif_t *blkif_alloc(domid_t domid) | 38 | struct blkif_st *blkif_alloc(domid_t domid) |
39 | { | 39 | { |
40 | blkif_t *blkif; | 40 | struct blkif_st *blkif; |
41 | 41 | ||
42 | blkif = kmem_cache_alloc(blkif_cachep, GFP_KERNEL); | 42 | blkif = kmem_cache_alloc(blkif_cachep, GFP_KERNEL); |
43 | if (!blkif) | 43 | if (!blkif) |
@@ -54,7 +54,7 @@ blkif_t *blkif_alloc(domid_t domid) | |||
54 | return blkif; | 54 | return blkif; |
55 | } | 55 | } |
56 | 56 | ||
57 | static int map_frontend_page(blkif_t *blkif, unsigned long shared_page) | 57 | static int map_frontend_page(struct blkif_st *blkif, unsigned long shared_page) |
58 | { | 58 | { |
59 | struct gnttab_map_grant_ref op; | 59 | struct gnttab_map_grant_ref op; |
60 | 60 | ||
@@ -75,7 +75,7 @@ static int map_frontend_page(blkif_t *blkif, unsigned long shared_page) | |||
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | static void unmap_frontend_page(blkif_t *blkif) | 78 | static void unmap_frontend_page(struct blkif_st *blkif) |
79 | { | 79 | { |
80 | struct gnttab_unmap_grant_ref op; | 80 | struct gnttab_unmap_grant_ref op; |
81 | 81 | ||
@@ -86,7 +86,7 @@ static void unmap_frontend_page(blkif_t *blkif) | |||
86 | BUG(); | 86 | BUG(); |
87 | } | 87 | } |
88 | 88 | ||
89 | int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn) | 89 | int blkif_map(struct blkif_st *blkif, unsigned long shared_page, unsigned int evtchn) |
90 | { | 90 | { |
91 | int err; | 91 | int err; |
92 | 92 | ||
@@ -143,7 +143,7 @@ int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn) | |||
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | 145 | ||
146 | void blkif_disconnect(blkif_t *blkif) | 146 | void blkif_disconnect(struct blkif_st *blkif) |
147 | { | 147 | { |
148 | if (blkif->xenblkd) { | 148 | if (blkif->xenblkd) { |
149 | kthread_stop(blkif->xenblkd); | 149 | kthread_stop(blkif->xenblkd); |
@@ -166,7 +166,7 @@ void blkif_disconnect(blkif_t *blkif) | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | void blkif_free(blkif_t *blkif) | 169 | void blkif_free(struct blkif_st *blkif) |
170 | { | 170 | { |
171 | if (!atomic_dec_and_test(&blkif->refcnt)) | 171 | if (!atomic_dec_and_test(&blkif->refcnt)) |
172 | BUG(); | 172 | BUG(); |
@@ -175,7 +175,7 @@ void blkif_free(blkif_t *blkif) | |||
175 | 175 | ||
176 | int __init blkif_interface_init(void) | 176 | int __init blkif_interface_init(void) |
177 | { | 177 | { |
178 | blkif_cachep = kmem_cache_create("blkif_cache", sizeof(blkif_t), | 178 | blkif_cachep = kmem_cache_create("blkif_cache", sizeof(struct blkif_st), |
179 | 0, 0, NULL); | 179 | 0, 0, NULL); |
180 | if (!blkif_cachep) | 180 | if (!blkif_cachep) |
181 | return -ENOMEM; | 181 | return -ENOMEM; |
diff --git a/drivers/xen/blkback/vbd.c b/drivers/xen/blkback/vbd.c index 95156c95ab2f..26a37df8173a 100644 --- a/drivers/xen/blkback/vbd.c +++ b/drivers/xen/blkback/vbd.c | |||
@@ -48,7 +48,7 @@ unsigned long vbd_secsize(struct vbd *vbd) | |||
48 | return bdev_logical_block_size(vbd->bdev); | 48 | return bdev_logical_block_size(vbd->bdev); |
49 | } | 49 | } |
50 | 50 | ||
51 | int vbd_create(blkif_t *blkif, blkif_vdev_t handle, unsigned major, | 51 | int vbd_create(struct blkif_st *blkif, blkif_vdev_t handle, unsigned major, |
52 | unsigned minor, int readonly, int cdrom) | 52 | unsigned minor, int readonly, int cdrom) |
53 | { | 53 | { |
54 | struct vbd *vbd; | 54 | struct vbd *vbd; |
@@ -97,7 +97,7 @@ void vbd_free(struct vbd *vbd) | |||
97 | vbd->bdev = NULL; | 97 | vbd->bdev = NULL; |
98 | } | 98 | } |
99 | 99 | ||
100 | int vbd_translate(struct phys_req *req, blkif_t *blkif, int operation) | 100 | int vbd_translate(struct phys_req *req, struct blkif_st *blkif, int operation) |
101 | { | 101 | { |
102 | struct vbd *vbd = &blkif->vbd; | 102 | struct vbd *vbd = &blkif->vbd; |
103 | int rc = -EACCES; | 103 | int rc = -EACCES; |
@@ -116,7 +116,7 @@ int vbd_translate(struct phys_req *req, blkif_t *blkif, int operation) | |||
116 | return rc; | 116 | return rc; |
117 | } | 117 | } |
118 | 118 | ||
119 | void vbd_resize(blkif_t *blkif) | 119 | void vbd_resize(struct blkif_st *blkif) |
120 | { | 120 | { |
121 | struct vbd *vbd = &blkif->vbd; | 121 | struct vbd *vbd = &blkif->vbd; |
122 | struct xenbus_transaction xbt; | 122 | struct xenbus_transaction xbt; |
diff --git a/drivers/xen/blkback/xenbus.c b/drivers/xen/blkback/xenbus.c index e9c4f80ef1c8..67462c4e9ab4 100644 --- a/drivers/xen/blkback/xenbus.c +++ b/drivers/xen/blkback/xenbus.c | |||
@@ -30,7 +30,7 @@ | |||
30 | struct backend_info | 30 | struct backend_info |
31 | { | 31 | { |
32 | struct xenbus_device *dev; | 32 | struct xenbus_device *dev; |
33 | blkif_t *blkif; | 33 | struct blkif_st *blkif; |
34 | struct xenbus_watch backend_watch; | 34 | struct xenbus_watch backend_watch; |
35 | unsigned major; | 35 | unsigned major; |
36 | unsigned minor; | 36 | unsigned minor; |
@@ -47,7 +47,7 @@ struct xenbus_device *blkback_xenbus(struct backend_info *be) | |||
47 | return be->dev; | 47 | return be->dev; |
48 | } | 48 | } |
49 | 49 | ||
50 | static int blkback_name(blkif_t *blkif, char *buf) | 50 | static int blkback_name(struct blkif_st *blkif, char *buf) |
51 | { | 51 | { |
52 | char *devpath, *devname; | 52 | char *devpath, *devname; |
53 | struct xenbus_device *dev = blkif->be->dev; | 53 | struct xenbus_device *dev = blkif->be->dev; |
@@ -67,7 +67,7 @@ static int blkback_name(blkif_t *blkif, char *buf) | |||
67 | return 0; | 67 | return 0; |
68 | } | 68 | } |
69 | 69 | ||
70 | static void update_blkif_status(blkif_t *blkif) | 70 | static void update_blkif_status(struct blkif_st *blkif) |
71 | { | 71 | { |
72 | int err; | 72 | int err; |
73 | char name[TASK_COMM_LEN]; | 73 | char name[TASK_COMM_LEN]; |