Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251242
b: refs/heads/master
c: 8b6bf74
h: refs/heads/master
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed Apr 20, 2011
1 parent 9481f6b commit 59cb996
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 67 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42c7841d171a2fe32005738dfebd724a90921496
refs/heads/master: 8b6bf747d70e5bac1a34c8fd773230e1cfdd7546
36 changes: 18 additions & 18 deletions trunk/drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
* pulled from a communication ring are quite likely to end up being part of
* the same scatter/gather request at the disc.
*
* ** TRY INCREASING 'blkif_reqs' IF WRITE SPEEDS SEEM TOO LOW **
* ** TRY INCREASING 'xen_blkif_reqs' IF WRITE SPEEDS SEEM TOO LOW **
*
* This will increase the chances of being able to write whole tracks.
* 64 should be enough to keep us competitive with Linux.
*/
static int blkif_reqs = 64;
module_param_named(reqs, blkif_reqs, int, 0);
static int xen_blkif_reqs = 64;
module_param_named(reqs, xen_blkif_reqs, int, 0);
MODULE_PARM_DESC(reqs, "Number of blkback requests to allocate");

/* Run-time switchable: /sys/module/blkback/parameters/ */
Expand Down Expand Up @@ -196,7 +196,7 @@ static void vbd_resize(struct blkif_st *blkif)
struct vbd *vbd = &blkif->vbd;
struct xenbus_transaction xbt;
int err;
struct xenbus_device *dev = blkback_xenbus(blkif->be);
struct xenbus_device *dev = xen_blkbk_xenbus(blkif->be);
unsigned long long new_size = vbd_sz(vbd);

printk(KERN_INFO "VBD Resize: Domid: %d, Device: (%d, %d)\n",
Expand Down Expand Up @@ -244,7 +244,7 @@ static void blkif_notify_work(struct blkif_st *blkif)
wake_up(&blkif->wq);
}

irqreturn_t blkif_be_int(int irq, void *dev_id)
irqreturn_t xen_blkif_be_int(int irq, void *dev_id)
{
blkif_notify_work(dev_id);
return IRQ_HANDLED;
Expand All @@ -265,12 +265,12 @@ static void print_stats(struct blkif_st *blkif)
blkif->st_oo_req = 0;
}

int blkif_schedule(void *arg)
int xen_blkif_schedule(void *arg)
{
struct blkif_st *blkif = arg;
struct vbd *vbd = &blkif->vbd;

blkif_get(blkif);
xen_blkif_get(blkif);

if (debug_lvl)
printk(KERN_DEBUG "%s: started\n", current->comm);
Expand Down Expand Up @@ -305,7 +305,7 @@ int blkif_schedule(void *arg)
printk(KERN_DEBUG "%s: exiting\n", current->comm);

blkif->xenblkd = NULL;
blkif_put(blkif);
xen_blkif_put(blkif);

return 0;
}
Expand Down Expand Up @@ -417,7 +417,7 @@ static void __end_block_io_op(struct pending_req *pending_req, int error)
if ((pending_req->operation == BLKIF_OP_WRITE_BARRIER) &&
(error == -EOPNOTSUPP)) {
DPRINTK("blkback: write barrier op failed, not supported\n");
blkback_barrier(XBT_NIL, pending_req->blkif->be, 0);
xen_blkbk_barrier(XBT_NIL, pending_req->blkif->be, 0);
pending_req->status = BLKIF_RSP_EOPNOTSUPP;
} else if (error) {
DPRINTK("Buffer not up-to-date at end of operation, "
Expand All @@ -433,7 +433,7 @@ static void __end_block_io_op(struct pending_req *pending_req, int error)
xen_blkbk_unmap(pending_req);
make_response(pending_req->blkif, pending_req->id,
pending_req->operation, pending_req->status);
blkif_put(pending_req->blkif);
xen_blkif_put(pending_req->blkif);
free_req(pending_req);
}
}
Expand Down Expand Up @@ -619,7 +619,7 @@ static void dispatch_rw_block_io(struct blkif_st *blkif,
goto fail_flush;

/* This corresponding blkif_put is done in __end_block_io_op */
blkif_get(blkif);
xen_blkif_get(blkif);

for (i = 0; i < nseg; i++) {
while ((bio == NULL) ||
Expand Down Expand Up @@ -751,7 +751,7 @@ static void make_response(struct blkif_st *blkif, u64 id,
notify_remote_via_irq(blkif->irq);
}

static int __init blkif_init(void)
static int __init xen_blkif_init(void)
{
int i, mmap_pages;
int rc = 0;
Expand All @@ -765,10 +765,10 @@ static int __init blkif_init(void)
return -ENOMEM;
}

mmap_pages = blkif_reqs * BLKIF_MAX_SEGMENTS_PER_REQUEST;
mmap_pages = xen_blkif_reqs * BLKIF_MAX_SEGMENTS_PER_REQUEST;

blkbk->pending_reqs = kmalloc(sizeof(blkbk->pending_reqs[0]) *
blkif_reqs, GFP_KERNEL);
xen_blkif_reqs, GFP_KERNEL);
blkbk->pending_grant_handles = kzalloc(sizeof(blkbk->pending_grant_handles[0]) *
mmap_pages, GFP_KERNEL);
blkbk->pending_pages = kzalloc(sizeof(blkbk->pending_pages[0]) *
Expand All @@ -788,7 +788,7 @@ static int __init blkif_init(void)
goto out_of_memory;
}
}
rc = blkif_interface_init();
rc = xen_blkif_interface_init();
if (rc)
goto failed_init;

Expand All @@ -798,11 +798,11 @@ static int __init blkif_init(void)
spin_lock_init(&blkbk->pending_free_lock);
init_waitqueue_head(&blkbk->pending_free_wq);

for (i = 0; i < blkif_reqs; i++)
for (i = 0; i < xen_blkif_reqs; i++)
list_add_tail(&blkbk->pending_reqs[i].free_list,
&blkbk->pending_free);

rc = blkif_xenbus_init();
rc = xen_blkif_xenbus_init();
if (rc)
goto failed_init;

Expand All @@ -823,6 +823,6 @@ static int __init blkif_init(void)
return rc;
}

module_init(blkif_init);
module_init(xen_blkif_init);

MODULE_LICENSE("Dual BSD/GPL");
18 changes: 9 additions & 9 deletions trunk/drivers/block/xen-blkback/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ struct blkif_st {
(_v)->bdev->bd_part->nr_sects : \
get_capacity((_v)->bdev->bd_disk))

#define blkif_get(_b) (atomic_inc(&(_b)->refcnt))
#define blkif_put(_b) \
#define xen_blkif_get(_b) (atomic_inc(&(_b)->refcnt))
#define xen_blkif_put(_b) \
do { \
if (atomic_dec_and_test(&(_b)->refcnt)) \
wake_up(&(_b)->waiting_to_free);\
Expand All @@ -113,16 +113,16 @@ struct phys_req {
struct block_device *bdev;
blkif_sector_t sector_number;
};
int blkif_interface_init(void);
int xen_blkif_interface_init(void);

int blkif_xenbus_init(void);
int xen_blkif_xenbus_init(void);

irqreturn_t blkif_be_int(int irq, void *dev_id);
int blkif_schedule(void *arg);
irqreturn_t xen_blkif_be_int(int irq, void *dev_id);
int xen_blkif_schedule(void *arg);

int blkback_barrier(struct xenbus_transaction xbt,
struct backend_info *be, int state);
int xen_blkbk_barrier(struct xenbus_transaction xbt,
struct backend_info *be, int state);

struct xenbus_device *blkback_xenbus(struct backend_info *be);
struct xenbus_device *xen_blkbk_xenbus(struct backend_info *be);

#endif /* __BLKIF__BACKEND__COMMON_H__ */
Loading

0 comments on commit 59cb996

Please sign in to comment.