xen/blkback: blkif->struct blkif_st
checkpatch.pl suggested that we don't use the typdef in common.h and this triggered this avalanche of patches. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
parent
a1397fa309
commit
5489377ce4
@ -75,7 +75,7 @@ module_param(debug_lvl, int, 0644);
|
||||
* 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;
|
||||
@ -123,11 +123,11 @@ static inline unsigned long vaddr(pending_req_t *req, int seg)
|
||||
(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);
|
||||
|
||||
/*
|
||||
@ -169,7 +169,7 @@ static void free_req(pending_req_t *req)
|
||||
* 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;
|
||||
@ -185,7 +185,7 @@ static void unplug_queue(blkif_t *blkif)
|
||||
* 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);
|
||||
|
||||
@ -237,7 +237,7 @@ static void fast_flush_area(pending_req_t *req)
|
||||
* 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,
|
||||
@ -250,7 +250,7 @@ static void print_stats(blkif_t *blkif)
|
||||
|
||||
int blkif_schedule(void *arg)
|
||||
{
|
||||
blkif_t *blkif = arg;
|
||||
struct blkif_st *blkif = arg;
|
||||
struct vbd *vbd = &blkif->vbd;
|
||||
|
||||
blkif_get(blkif);
|
||||
@ -337,7 +337,7 @@ static void end_block_io_op(struct bio *bio, int error)
|
||||
* 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);
|
||||
@ -356,7 +356,7 @@ irqreturn_t blkif_be_int(int irq, void *dev_id)
|
||||
* (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;
|
||||
@ -438,7 +438,7 @@ static int do_block_io_op(blkif_t *blkif)
|
||||
* 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)
|
||||
{
|
||||
@ -633,7 +633,7 @@ static void dispatch_rw_block_io(blkif_t *blkif,
|
||||
/*
|
||||
* 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;
|
||||
|
@ -34,7 +34,7 @@
|
||||
#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>
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
#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 */
|
||||
@ -57,7 +57,7 @@ struct vbd {
|
||||
|
||||
struct backend_info;
|
||||
|
||||
typedef struct blkif_st {
|
||||
struct blkif_st {
|
||||
/* Unique identifier for this interface. */
|
||||
domid_t domid;
|
||||
unsigned int handle;
|
||||
@ -94,13 +94,14 @@ typedef struct blkif_st {
|
||||
|
||||
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) \
|
||||
@ -110,7 +111,7 @@ void vbd_resize(blkif_t *blkif);
|
||||
} 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);
|
||||
|
||||
@ -125,7 +126,7 @@ struct phys_req {
|
||||
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);
|
||||
|
||||
|
@ -35,9 +35,9 @@
|
||||
|
||||
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)
|
||||
@ -54,7 +54,7 @@ blkif_t *blkif_alloc(domid_t domid)
|
||||
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;
|
||||
|
||||
@ -75,7 +75,7 @@ static int map_frontend_page(blkif_t *blkif, unsigned long shared_page)
|
||||
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;
|
||||
|
||||
@ -86,7 +86,7 @@ static void unmap_frontend_page(blkif_t *blkif)
|
||||
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;
|
||||
|
||||
@ -143,7 +143,7 @@ int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void blkif_disconnect(blkif_t *blkif)
|
||||
void blkif_disconnect(struct blkif_st *blkif)
|
||||
{
|
||||
if (blkif->xenblkd) {
|
||||
kthread_stop(blkif->xenblkd);
|
||||
@ -166,7 +166,7 @@ void blkif_disconnect(blkif_t *blkif)
|
||||
}
|
||||
}
|
||||
|
||||
void blkif_free(blkif_t *blkif)
|
||||
void blkif_free(struct blkif_st *blkif)
|
||||
{
|
||||
if (!atomic_dec_and_test(&blkif->refcnt))
|
||||
BUG();
|
||||
@ -175,7 +175,7 @@ void blkif_free(blkif_t *blkif)
|
||||
|
||||
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;
|
||||
|
@ -48,7 +48,7 @@ unsigned long vbd_secsize(struct vbd *vbd)
|
||||
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;
|
||||
@ -97,7 +97,7 @@ void vbd_free(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;
|
||||
@ -116,7 +116,7 @@ int vbd_translate(struct phys_req *req, blkif_t *blkif, int operation)
|
||||
return rc;
|
||||
}
|
||||
|
||||
void vbd_resize(blkif_t *blkif)
|
||||
void vbd_resize(struct blkif_st *blkif)
|
||||
{
|
||||
struct vbd *vbd = &blkif->vbd;
|
||||
struct xenbus_transaction xbt;
|
||||
|
@ -30,7 +30,7 @@
|
||||
struct backend_info
|
||||
{
|
||||
struct xenbus_device *dev;
|
||||
blkif_t *blkif;
|
||||
struct blkif_st *blkif;
|
||||
struct xenbus_watch backend_watch;
|
||||
unsigned major;
|
||||
unsigned minor;
|
||||
@ -47,7 +47,7 @@ struct xenbus_device *blkback_xenbus(struct backend_info *be)
|
||||
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;
|
||||
@ -67,7 +67,7 @@ static int blkback_name(blkif_t *blkif, char *buf)
|
||||
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];
|
||||
|
Loading…
Reference in New Issue
Block a user