aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-05-12 16:53:56 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-05-12 17:55:52 -0400
commit3d814731ba67f9514bdf380c1b95dd852ac82a2f (patch)
treea7d0a5681b431524171b41cba86854f547c0a5eb /drivers/block
parent30fd150202fb2d08a62f9c2966a4b1fcf2e861e7 (diff)
xen/blkback: Prefix 'vbd' with 'xen' in structs and functions.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xen-blkback/blkback.c20
-rw-r--r--drivers/block/xen-blkback/common.h4
-rw-r--r--drivers/block/xen-blkback/xenbus.c34
3 files changed, 29 insertions, 29 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index d438781ecc7c..1e454a30e4e1 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -166,10 +166,10 @@ static void free_req(struct pending_req *req)
166/* 166/*
167 * Routines for managing virtual block devices (vbds). 167 * Routines for managing virtual block devices (vbds).
168 */ 168 */
169static int vbd_translate(struct phys_req *req, struct xen_blkif *blkif, 169static int xen_vbd_translate(struct phys_req *req, struct xen_blkif *blkif,
170 int operation) 170 int operation)
171{ 171{
172 struct vbd *vbd = &blkif->vbd; 172 struct xen_vbd *vbd = &blkif->vbd;
173 int rc = -EACCES; 173 int rc = -EACCES;
174 174
175 if ((operation != READ) && vbd->readonly) 175 if ((operation != READ) && vbd->readonly)
@@ -186,9 +186,9 @@ static int vbd_translate(struct phys_req *req, struct xen_blkif *blkif,
186 return rc; 186 return rc;
187} 187}
188 188
189static void vbd_resize(struct xen_blkif *blkif) 189static void xen_vbd_resize(struct xen_blkif *blkif)
190{ 190{
191 struct vbd *vbd = &blkif->vbd; 191 struct xen_vbd *vbd = &blkif->vbd;
192 struct xenbus_transaction xbt; 192 struct xenbus_transaction xbt;
193 int err; 193 int err;
194 struct xenbus_device *dev = xen_blkbk_xenbus(blkif->be); 194 struct xenbus_device *dev = xen_blkbk_xenbus(blkif->be);
@@ -263,7 +263,7 @@ static void print_stats(struct xen_blkif *blkif)
263int xen_blkif_schedule(void *arg) 263int xen_blkif_schedule(void *arg)
264{ 264{
265 struct xen_blkif *blkif = arg; 265 struct xen_blkif *blkif = arg;
266 struct vbd *vbd = &blkif->vbd; 266 struct xen_vbd *vbd = &blkif->vbd;
267 267
268 xen_blkif_get(blkif); 268 xen_blkif_get(blkif);
269 269
@@ -271,7 +271,7 @@ int xen_blkif_schedule(void *arg)
271 if (try_to_freeze()) 271 if (try_to_freeze())
272 continue; 272 continue;
273 if (unlikely(vbd->size != vbd_sz(vbd))) 273 if (unlikely(vbd->size != vbd_sz(vbd)))
274 vbd_resize(blkif); 274 xen_vbd_resize(blkif);
275 275
276 wait_event_interruptible( 276 wait_event_interruptible(
277 blkif->wq, 277 blkif->wq,
@@ -538,7 +538,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
538 blkif->st_f_req++; 538 blkif->st_f_req++;
539 operation = WRITE_FLUSH; 539 operation = WRITE_FLUSH;
540 /* 540 /*
541 * The frontend likes to set this to -1, which vbd_translate 541 * The frontend likes to set this to -1, which xen_vbd_translate
542 * is alergic too. 542 * is alergic too.
543 */ 543 */
544 req->u.rw.sector_number = 0; 544 req->u.rw.sector_number = 0;
@@ -580,7 +580,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
580 580
581 } 581 }
582 582
583 if (vbd_translate(&preq, blkif, operation) != 0) { 583 if (xen_vbd_translate(&preq, blkif, operation) != 0) {
584 pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n", 584 pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n",
585 operation == READ ? "read" : "write", 585 operation == READ ? "read" : "write",
586 preq.sector_number, 586 preq.sector_number,
@@ -589,7 +589,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
589 } 589 }
590 590
591 /* 591 /*
592 * This check _MUST_ be done after vbd_translate as the preq.bdev 592 * This check _MUST_ be done after xen_vbd_translate as the preq.bdev
593 * is set there. 593 * is set there.
594 */ 594 */
595 for (i = 0; i < nseg; i++) { 595 for (i = 0; i < nseg; i++) {
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 722c048663d6..1e4ccdeadef3 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -113,7 +113,7 @@ enum blkif_protocol {
113 BLKIF_PROTOCOL_X86_64 = 3, 113 BLKIF_PROTOCOL_X86_64 = 3,
114}; 114};
115 115
116struct vbd { 116struct xen_vbd {
117 /* What the domain refers to this vbd as. */ 117 /* What the domain refers to this vbd as. */
118 blkif_vdev_t handle; 118 blkif_vdev_t handle;
119 /* Non-zero -> read-only */ 119 /* Non-zero -> read-only */
@@ -141,7 +141,7 @@ struct xen_blkif {
141 union blkif_back_rings blk_rings; 141 union blkif_back_rings blk_rings;
142 struct vm_struct *blk_ring_area; 142 struct vm_struct *blk_ring_area;
143 /* The VBD attached to this interface. */ 143 /* The VBD attached to this interface. */
144 struct vbd vbd; 144 struct xen_vbd vbd;
145 /* Back pointer to the backend_info. */ 145 /* Back pointer to the backend_info. */
146 struct backend_info *be; 146 struct backend_info *be;
147 /* Private fields. */ 147 /* Private fields. */
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f355f7a5d52d..e470d8869053 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -275,7 +275,7 @@ VBD_SHOW(f_req, "%d\n", be->blkif->st_f_req);
275VBD_SHOW(rd_sect, "%d\n", be->blkif->st_rd_sect); 275VBD_SHOW(rd_sect, "%d\n", be->blkif->st_rd_sect);
276VBD_SHOW(wr_sect, "%d\n", be->blkif->st_wr_sect); 276VBD_SHOW(wr_sect, "%d\n", be->blkif->st_wr_sect);
277 277
278static struct attribute *vbdstat_attrs[] = { 278static struct attribute *xen_vbdstat_attrs[] = {
279 &dev_attr_oo_req.attr, 279 &dev_attr_oo_req.attr,
280 &dev_attr_rd_req.attr, 280 &dev_attr_rd_req.attr,
281 &dev_attr_wr_req.attr, 281 &dev_attr_wr_req.attr,
@@ -285,9 +285,9 @@ static struct attribute *vbdstat_attrs[] = {
285 NULL 285 NULL
286}; 286};
287 287
288static struct attribute_group vbdstat_group = { 288static struct attribute_group xen_vbdstat_group = {
289 .name = "statistics", 289 .name = "statistics",
290 .attrs = vbdstat_attrs, 290 .attrs = xen_vbdstat_attrs,
291}; 291};
292 292
293VBD_SHOW(physical_device, "%x:%x\n", be->major, be->minor); 293VBD_SHOW(physical_device, "%x:%x\n", be->major, be->minor);
@@ -305,13 +305,13 @@ int xenvbd_sysfs_addif(struct xenbus_device *dev)
305 if (error) 305 if (error)
306 goto fail2; 306 goto fail2;
307 307
308 error = sysfs_create_group(&dev->dev.kobj, &vbdstat_group); 308 error = sysfs_create_group(&dev->dev.kobj, &xen_vbdstat_group);
309 if (error) 309 if (error)
310 goto fail3; 310 goto fail3;
311 311
312 return 0; 312 return 0;
313 313
314fail3: sysfs_remove_group(&dev->dev.kobj, &vbdstat_group); 314fail3: sysfs_remove_group(&dev->dev.kobj, &xen_vbdstat_group);
315fail2: device_remove_file(&dev->dev, &dev_attr_mode); 315fail2: device_remove_file(&dev->dev, &dev_attr_mode);
316fail1: device_remove_file(&dev->dev, &dev_attr_physical_device); 316fail1: device_remove_file(&dev->dev, &dev_attr_physical_device);
317 return error; 317 return error;
@@ -319,24 +319,24 @@ fail1: device_remove_file(&dev->dev, &dev_attr_physical_device);
319 319
320void xenvbd_sysfs_delif(struct xenbus_device *dev) 320void xenvbd_sysfs_delif(struct xenbus_device *dev)
321{ 321{
322 sysfs_remove_group(&dev->dev.kobj, &vbdstat_group); 322 sysfs_remove_group(&dev->dev.kobj, &xen_vbdstat_group);
323 device_remove_file(&dev->dev, &dev_attr_mode); 323 device_remove_file(&dev->dev, &dev_attr_mode);
324 device_remove_file(&dev->dev, &dev_attr_physical_device); 324 device_remove_file(&dev->dev, &dev_attr_physical_device);
325} 325}
326 326
327 327
328static void vbd_free(struct vbd *vbd) 328static void xen_vbd_free(struct xen_vbd *vbd)
329{ 329{
330 if (vbd->bdev) 330 if (vbd->bdev)
331 blkdev_put(vbd->bdev, vbd->readonly ? FMODE_READ : FMODE_WRITE); 331 blkdev_put(vbd->bdev, vbd->readonly ? FMODE_READ : FMODE_WRITE);
332 vbd->bdev = NULL; 332 vbd->bdev = NULL;
333} 333}
334 334
335static int vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle, 335static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
336 unsigned major, unsigned minor, int readonly, 336 unsigned major, unsigned minor, int readonly,
337 int cdrom) 337 int cdrom)
338{ 338{
339 struct vbd *vbd; 339 struct xen_vbd *vbd;
340 struct block_device *bdev; 340 struct block_device *bdev;
341 struct request_queue *q; 341 struct request_queue *q;
342 342
@@ -351,7 +351,7 @@ static int vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
351 FMODE_READ : FMODE_WRITE, NULL); 351 FMODE_READ : FMODE_WRITE, NULL);
352 352
353 if (IS_ERR(bdev)) { 353 if (IS_ERR(bdev)) {
354 DPRINTK("vbd_create: device %08x could not be opened.\n", 354 DPRINTK("xen_vbd_create: device %08x could not be opened.\n",
355 vbd->pdevice); 355 vbd->pdevice);
356 return -ENOENT; 356 return -ENOENT;
357 } 357 }
@@ -360,9 +360,9 @@ static int vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
360 vbd->size = vbd_sz(vbd); 360 vbd->size = vbd_sz(vbd);
361 361
362 if (vbd->bdev->bd_disk == NULL) { 362 if (vbd->bdev->bd_disk == NULL) {
363 DPRINTK("vbd_create: device %08x doesn't exist.\n", 363 DPRINTK("xen_vbd_create: device %08x doesn't exist.\n",
364 vbd->pdevice); 364 vbd->pdevice);
365 vbd_free(vbd); 365 xen_vbd_free(vbd);
366 return -ENOENT; 366 return -ENOENT;
367 } 367 }
368 368
@@ -396,7 +396,7 @@ static int xen_blkbk_remove(struct xenbus_device *dev)
396 396
397 if (be->blkif) { 397 if (be->blkif) {
398 xen_blkif_disconnect(be->blkif); 398 xen_blkif_disconnect(be->blkif);
399 vbd_free(&be->blkif->vbd); 399 xen_vbd_free(&be->blkif->vbd);
400 xen_blkif_free(be->blkif); 400 xen_blkif_free(be->blkif);
401 be->blkif = NULL; 401 be->blkif = NULL;
402 } 402 }
@@ -535,7 +535,7 @@ static void backend_changed(struct xenbus_watch *watch,
535 be->major = major; 535 be->major = major;
536 be->minor = minor; 536 be->minor = minor;
537 537
538 err = vbd_create(be->blkif, handle, major, minor, 538 err = xen_vbd_create(be->blkif, handle, major, minor,
539 (NULL == strchr(be->mode, 'w')), cdrom); 539 (NULL == strchr(be->mode, 'w')), cdrom);
540 if (err) { 540 if (err) {
541 be->major = 0; 541 be->major = 0;
@@ -546,7 +546,7 @@ static void backend_changed(struct xenbus_watch *watch,
546 546
547 err = xenvbd_sysfs_addif(dev); 547 err = xenvbd_sysfs_addif(dev);
548 if (err) { 548 if (err) {
549 vbd_free(&be->blkif->vbd); 549 xen_vbd_free(&be->blkif->vbd);
550 be->major = 0; 550 be->major = 0;
551 be->minor = 0; 551 be->minor = 0;
552 xenbus_dev_fatal(dev, err, "creating sysfs entries"); 552 xenbus_dev_fatal(dev, err, "creating sysfs entries");