aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkback/common.h
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-10-10 00:42:22 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-10-13 09:48:36 -0400
commit29bde093787f3bdf7b9b4270ada6be7c8076e36b (patch)
tree4fff697e0acb2471b1bd575cbd006fa4efc3937d /drivers/block/xen-blkback/common.h
parent469738e675524b6aa029ecd46bdda3f878b12eff (diff)
xen/blkback: Support 'feature-barrier' aka old-style BARRIER requests.
We emulate the barrier requests by draining the outstanding bio's and then sending the WRITE_FLUSH command. To drain the I/Os we use the refcnt that is used during disconnect to wait for all the I/Os before disconnecting from the frontend. We latch on its value and if it reaches either the threshold for disconnect or when there are no more outstanding I/Os, then we have drained all I/Os. Suggested-by: Christopher Hellwig <hch@infradead.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block/xen-blkback/common.h')
-rw-r--r--drivers/block/xen-blkback/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index 1b1bc4458685..e638457d9de4 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -181,6 +181,9 @@ struct xen_blkif {
181 atomic_t refcnt; 181 atomic_t refcnt;
182 182
183 wait_queue_head_t wq; 183 wait_queue_head_t wq;
184 /* for barrier (drain) requests */
185 struct completion drain_complete;
186 atomic_t drain;
184 /* One thread per one blkif. */ 187 /* One thread per one blkif. */
185 struct task_struct *xenblkd; 188 struct task_struct *xenblkd;
186 unsigned int waiting_reqs; 189 unsigned int waiting_reqs;
@@ -229,6 +232,8 @@ int xen_blkif_schedule(void *arg);
229int xen_blkbk_flush_diskcache(struct xenbus_transaction xbt, 232int xen_blkbk_flush_diskcache(struct xenbus_transaction xbt,
230 struct backend_info *be, int state); 233 struct backend_info *be, int state);
231 234
235int xen_blkbk_barrier(struct xenbus_transaction xbt,
236 struct backend_info *be, int state);
232struct xenbus_device *xen_blkbk_xenbus(struct backend_info *be); 237struct xenbus_device *xen_blkbk_xenbus(struct backend_info *be);
233 238
234static inline void blkif_get_x86_32_req(struct blkif_request *dst, 239static inline void blkif_get_x86_32_req(struct blkif_request *dst,