* response queued for it, with the saved 'id' passed back.
*/
typedef struct {
- blkif_t *blkif;
+ struct blkif_st *blkif;
u64 id;
int nr_pages;
atomic_t pendcnt;
(blkbk->pending_grant_handles[vaddr_pagenr(_req, _seg)])
-static int do_block_io_op(blkif_t *blkif);
-static void dispatch_rw_block_io(blkif_t *blkif,
+static int do_block_io_op(struct blkif_st *blkif);
+static void dispatch_rw_block_io(struct blkif_st *blkif,
struct blkif_request *req,
pending_req_t *pending_req);
-static void make_response(blkif_t *blkif, u64 id,
+static void make_response(struct blkif_st *blkif, u64 id,
unsigned short op, int st);
/*
* It is OK to make multiple calls in this function as it
* resets the plug to NULL when it is done on the first call.
*/
-static void unplug_queue(blkif_t *blkif)
+static void unplug_queue(struct blkif_st *blkif)
{
if (blkif->plug == NULL)
return;
* not to double reference. We also give back a reference count
* if it corresponds to another queue.
*/
-static void plug_queue(blkif_t *blkif, struct block_device *bdev)
+static void plug_queue(struct blkif_st *blkif, struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
* SCHEDULER FUNCTIONS
*/
-static void print_stats(blkif_t *blkif)
+static void print_stats(struct blkif_st *blkif)
{
printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | br %4d\n",
current->comm, blkif->st_oo_req,
int blkif_schedule(void *arg)
{
- blkif_t *blkif = arg;
+ struct blkif_st *blkif = arg;
struct vbd *vbd = &blkif->vbd;
blkif_get(blkif);
* Notification from the guest OS.
*/
-static void blkif_notify_work(blkif_t *blkif)
+static void blkif_notify_work(struct blkif_st *blkif)
{
blkif->waiting_reqs = 1;
wake_up(&blkif->wq);
* (which has the sectors we want, number of them, grant references, etc),
* and transmute it to the block API to hand it over to the proper block disk.
*/
-static int do_block_io_op(blkif_t *blkif)
+static int do_block_io_op(struct blkif_st *blkif)
{
union blkif_back_rings *blk_rings = &blkif->blk_rings;
struct blkif_request req;
* Transumation of the 'struct blkif_request' to a proper 'struct bio'
* and call the 'submit_bio' to pass it to the underlaying storage.
*/
-static void dispatch_rw_block_io(blkif_t *blkif,
+static void dispatch_rw_block_io(struct blkif_st *blkif,
struct blkif_request *req,
pending_req_t *pending_req)
{
/*
* Put a response on the ring on how the operation fared.
*/
-static void make_response(blkif_t *blkif, u64 id,
+static void make_response(struct blkif_st *blkif, u64 id,
unsigned short op, int st)
{
struct blkif_response resp;
#include <linux/blkdev.h>
#include <linux/vmalloc.h>
#include <linux/wait.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/setup.h>
#include <asm/pgalloc.h>
#include <asm/hypervisor.h>
#define DPRINTK(_f, _a...) \
pr_debug("(file=%s, line=%d) " _f, \
- __FILE__ , __LINE__ , ## _a )
+ __FILE__ , __LINE__ , ## _a)
struct vbd {
blkif_vdev_t handle; /* what the domain refers to this vbd as */
struct backend_info;
-typedef struct blkif_st {
+struct blkif_st {
/* Unique identifier for this interface. */
domid_t domid;
unsigned int handle;
grant_handle_t shmem_handle;
grant_ref_t shmem_ref;
-} blkif_t;
+};
-blkif_t *blkif_alloc(domid_t domid);
-void blkif_disconnect(blkif_t *blkif);
-void blkif_free(blkif_t *blkif);
-int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn);
-void vbd_resize(blkif_t *blkif);
+struct blkif_st *blkif_alloc(domid_t domid);
+void blkif_disconnect(struct blkif_st *blkif);
+void blkif_free(struct blkif_st *blkif);
+int blkif_map(struct blkif_st *blkif, unsigned long shared_page,
+ unsigned int evtchn);
+void vbd_resize(struct blkif_st *blkif);
#define blkif_get(_b) (atomic_inc(&(_b)->refcnt))
#define blkif_put(_b) \
} while (0)
/* Create a vbd. */
-int vbd_create(blkif_t *blkif, blkif_vdev_t vdevice, unsigned major,
+int vbd_create(struct blkif_st *blkif, blkif_vdev_t vdevice, unsigned major,
unsigned minor, int readonly, int cdrom);
void vbd_free(struct vbd *vbd);
blkif_sector_t sector_number;
};
-int vbd_translate(struct phys_req *req, blkif_t *blkif, int operation);
+int vbd_translate(struct phys_req *req, struct blkif_st *blkif, int operation);
int blkif_interface_init(void);
static struct kmem_cache *blkif_cachep;
-blkif_t *blkif_alloc(domid_t domid)
+struct blkif_st *blkif_alloc(domid_t domid)
{
- blkif_t *blkif;
+ struct blkif_st *blkif;
blkif = kmem_cache_alloc(blkif_cachep, GFP_KERNEL);
if (!blkif)
return blkif;
}
-static int map_frontend_page(blkif_t *blkif, unsigned long shared_page)
+static int map_frontend_page(struct blkif_st *blkif, unsigned long shared_page)
{
struct gnttab_map_grant_ref op;
return 0;
}
-static void unmap_frontend_page(blkif_t *blkif)
+static void unmap_frontend_page(struct blkif_st *blkif)
{
struct gnttab_unmap_grant_ref op;
BUG();
}
-int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn)
+int blkif_map(struct blkif_st *blkif, unsigned long shared_page, unsigned int evtchn)
{
int err;
return 0;
}
-void blkif_disconnect(blkif_t *blkif)
+void blkif_disconnect(struct blkif_st *blkif)
{
if (blkif->xenblkd) {
kthread_stop(blkif->xenblkd);
}
}
-void blkif_free(blkif_t *blkif)
+void blkif_free(struct blkif_st *blkif)
{
if (!atomic_dec_and_test(&blkif->refcnt))
BUG();
int __init blkif_interface_init(void)
{
- blkif_cachep = kmem_cache_create("blkif_cache", sizeof(blkif_t),
+ blkif_cachep = kmem_cache_create("blkif_cache", sizeof(struct blkif_st),
0, 0, NULL);
if (!blkif_cachep)
return -ENOMEM;
return bdev_logical_block_size(vbd->bdev);
}
-int vbd_create(blkif_t *blkif, blkif_vdev_t handle, unsigned major,
+int vbd_create(struct blkif_st *blkif, blkif_vdev_t handle, unsigned major,
unsigned minor, int readonly, int cdrom)
{
struct vbd *vbd;
vbd->bdev = NULL;
}
-int vbd_translate(struct phys_req *req, blkif_t *blkif, int operation)
+int vbd_translate(struct phys_req *req, struct blkif_st *blkif, int operation)
{
struct vbd *vbd = &blkif->vbd;
int rc = -EACCES;
return rc;
}
-void vbd_resize(blkif_t *blkif)
+void vbd_resize(struct blkif_st *blkif)
{
struct vbd *vbd = &blkif->vbd;
struct xenbus_transaction xbt;
struct backend_info
{
struct xenbus_device *dev;
- blkif_t *blkif;
+ struct blkif_st *blkif;
struct xenbus_watch backend_watch;
unsigned major;
unsigned minor;
return be->dev;
}
-static int blkback_name(blkif_t *blkif, char *buf)
+static int blkback_name(struct blkif_st *blkif, char *buf)
{
char *devpath, *devname;
struct xenbus_device *dev = blkif->be->dev;
return 0;
}
-static void update_blkif_status(blkif_t *blkif)
+static void update_blkif_status(struct blkif_st *blkif)
{
int err;
char name[TASK_COMM_LEN];