]>
Commit | Line | Data |
---|---|---|
cc90b958 BS |
1 | From: plc@novell.com |
2 | Subject: add support for new operation type BLKIF_OP_PACKET | |
3 | Patch-mainline: obsolete | |
4 | References: fate#300964 | |
5 | ||
6 | Index: head-2008-11-10/drivers/xen/blkback/blkback.c | |
7 | =================================================================== | |
8 | --- head-2008-11-10.orig/drivers/xen/blkback/blkback.c 2008-11-10 12:07:53.000000000 +0100 | |
9 | +++ head-2008-11-10/drivers/xen/blkback/blkback.c 2008-11-10 12:15:51.000000000 +0100 | |
10 | @@ -192,13 +192,15 @@ static void fast_flush_area(pending_req_ | |
11 | ||
12 | static void print_stats(blkif_t *blkif) | |
13 | { | |
14 | - printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | br %4d\n", | |
15 | + printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | br %4d | pk %4d\n", | |
16 | current->comm, blkif->st_oo_req, | |
17 | - blkif->st_rd_req, blkif->st_wr_req, blkif->st_br_req); | |
18 | + blkif->st_rd_req, blkif->st_wr_req, blkif->st_br_req, | |
19 | + blkif->st_pk_req); | |
20 | blkif->st_print = jiffies + msecs_to_jiffies(10 * 1000); | |
21 | blkif->st_rd_req = 0; | |
22 | blkif->st_wr_req = 0; | |
23 | blkif->st_oo_req = 0; | |
24 | + blkif->st_pk_req = 0; | |
25 | } | |
26 | ||
27 | int blkif_schedule(void *arg) | |
28 | @@ -358,6 +360,13 @@ static int do_block_io_op(blkif_t *blkif | |
29 | blkif->st_wr_req++; | |
30 | dispatch_rw_block_io(blkif, &req, pending_req); | |
31 | break; | |
32 | + case BLKIF_OP_PACKET: | |
33 | + DPRINTK("error: block operation BLKIF_OP_PACKET not implemented\n"); | |
34 | + blkif->st_pk_req++; | |
35 | + make_response(blkif, req.id, req.operation, | |
36 | + BLKIF_RSP_ERROR); | |
37 | + free_req(pending_req); | |
38 | + break; | |
39 | default: | |
40 | /* A good sign something is wrong: sleep for a while to | |
41 | * avoid excessive CPU consumption by a bad guest. */ | |
42 | Index: head-2008-11-10/drivers/xen/blkback/common.h | |
43 | =================================================================== | |
44 | --- head-2008-11-10.orig/drivers/xen/blkback/common.h 2008-11-10 12:14:31.000000000 +0100 | |
45 | +++ head-2008-11-10/drivers/xen/blkback/common.h 2008-11-10 12:15:51.000000000 +0100 | |
46 | @@ -87,6 +87,7 @@ typedef struct blkif_st { | |
47 | int st_wr_req; | |
48 | int st_oo_req; | |
49 | int st_br_req; | |
50 | + int st_pk_req; | |
51 | int st_rd_sect; | |
52 | int st_wr_sect; | |
53 | ||
54 | Index: head-2008-11-10/drivers/xen/blkfront/blkfront.c | |
55 | =================================================================== | |
56 | --- head-2008-11-10.orig/drivers/xen/blkfront/blkfront.c 2008-11-10 12:10:12.000000000 +0100 | |
57 | +++ head-2008-11-10/drivers/xen/blkfront/blkfront.c 2008-11-10 12:15:51.000000000 +0100 | |
58 | @@ -622,6 +622,8 @@ static int blkif_queue_request(struct re | |
59 | BLKIF_OP_WRITE : BLKIF_OP_READ; | |
60 | if (blk_barrier_rq(req)) | |
61 | ring_req->operation = BLKIF_OP_WRITE_BARRIER; | |
62 | + if (blk_pc_request(req)) | |
63 | + ring_req->operation = BLKIF_OP_PACKET; | |
64 | ||
65 | ring_req->nr_segments = 0; | |
66 | rq_for_each_segment(bvec, req, iter) { | |
67 | @@ -678,7 +680,7 @@ void do_blkif_request(struct request_que | |
68 | ||
69 | while ((req = elv_next_request(rq)) != NULL) { | |
70 | info = req->rq_disk->private_data; | |
71 | - if (!blk_fs_request(req)) { | |
72 | + if (!blk_fs_request(req) && !blk_pc_request(req)) { | |
73 | end_request(req, 0); | |
74 | continue; | |
75 | } | |
76 | @@ -755,6 +757,7 @@ static irqreturn_t blkif_int(int irq, vo | |
77 | /* fall through */ | |
78 | case BLKIF_OP_READ: | |
79 | case BLKIF_OP_WRITE: | |
80 | + case BLKIF_OP_PACKET: | |
81 | if (unlikely(bret->status != BLKIF_RSP_OKAY)) | |
82 | DPRINTK("Bad return from blkdev data " | |
83 | "request: %x\n", bret->status); | |
84 | Index: head-2008-11-10/drivers/xen/blktap/blktap.c | |
85 | =================================================================== | |
86 | --- head-2008-11-10.orig/drivers/xen/blktap/blktap.c 2008-11-10 12:14:32.000000000 +0100 | |
87 | +++ head-2008-11-10/drivers/xen/blktap/blktap.c 2008-11-10 12:15:51.000000000 +0100 | |
88 | @@ -1090,13 +1090,14 @@ static void fast_flush_area(pending_req_ | |
89 | ||
90 | static void print_stats(blkif_t *blkif) | |
91 | { | |
92 | - printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d\n", | |
93 | + printk(KERN_DEBUG "%s: oo %3d | rd %4d | wr %4d | pk %4d\n", | |
94 | current->comm, blkif->st_oo_req, | |
95 | - blkif->st_rd_req, blkif->st_wr_req); | |
96 | + blkif->st_rd_req, blkif->st_wr_req, blkif->st_pk_req); | |
97 | blkif->st_print = jiffies + msecs_to_jiffies(10 * 1000); | |
98 | blkif->st_rd_req = 0; | |
99 | blkif->st_wr_req = 0; | |
100 | blkif->st_oo_req = 0; | |
101 | + blkif->st_pk_req = 0; | |
102 | } | |
103 | ||
104 | int tap_blkif_schedule(void *arg) | |
105 | @@ -1332,6 +1333,11 @@ static int do_block_io_op(blkif_t *blkif | |
106 | dispatch_rw_block_io(blkif, &req, pending_req); | |
107 | break; | |
108 | ||
109 | + case BLKIF_OP_PACKET: | |
110 | + blkif->st_pk_req++; | |
111 | + dispatch_rw_block_io(blkif, &req, pending_req); | |
112 | + break; | |
113 | + | |
114 | default: | |
115 | /* A good sign something is wrong: sleep for a while to | |
116 | * avoid excessive CPU consumption by a bad guest. */ | |
117 | @@ -1370,6 +1376,8 @@ static void dispatch_rw_block_io(blkif_t | |
118 | struct mm_struct *mm; | |
119 | ||
120 | switch (req->operation) { | |
121 | + case BLKIF_OP_PACKET: | |
122 | + /* Fall through */ | |
123 | case BLKIF_OP_READ: | |
124 | operation = READ; | |
125 | break; | |
126 | Index: head-2008-11-10/drivers/xen/blktap/common.h | |
127 | =================================================================== | |
128 | --- head-2008-11-10.orig/drivers/xen/blktap/common.h 2008-11-10 12:06:12.000000000 +0100 | |
129 | +++ head-2008-11-10/drivers/xen/blktap/common.h 2008-11-10 12:15:51.000000000 +0100 | |
130 | @@ -75,6 +75,7 @@ typedef struct blkif_st { | |
131 | int st_rd_req; | |
132 | int st_wr_req; | |
133 | int st_oo_req; | |
134 | + int st_pk_req; | |
135 | int st_rd_sect; | |
136 | int st_wr_sect; | |
137 | ||
138 | Index: head-2008-11-10/include/xen/interface/io/blkif.h | |
139 | =================================================================== | |
140 | --- head-2008-11-10.orig/include/xen/interface/io/blkif.h 2008-11-10 11:49:25.000000000 +0100 | |
141 | +++ head-2008-11-10/include/xen/interface/io/blkif.h 2008-11-10 12:15:51.000000000 +0100 | |
142 | @@ -76,6 +76,10 @@ | |
143 | * "feature-flush-cache" node! | |
144 | */ | |
145 | #define BLKIF_OP_FLUSH_DISKCACHE 3 | |
146 | +/* | |
147 | + * Device specific command packet contained within the request | |
148 | + */ | |
149 | +#define BLKIF_OP_PACKET 4 | |
150 | ||
151 | /* | |
152 | * Maximum scatter/gather segments per request. |