diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-10-10 00:42:22 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-10-13 09:48:36 -0400 |
commit | 29bde093787f3bdf7b9b4270ada6be7c8076e36b (patch) | |
tree | 4fff697e0acb2471b1bd575cbd006fa4efc3937d /drivers/block/xen-blkback/common.h | |
parent | 469738e675524b6aa029ecd46bdda3f878b12eff (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.h | 5 |
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); | |||
229 | int xen_blkbk_flush_diskcache(struct xenbus_transaction xbt, | 232 | int xen_blkbk_flush_diskcache(struct xenbus_transaction xbt, |
230 | struct backend_info *be, int state); | 233 | struct backend_info *be, int state); |
231 | 234 | ||
235 | int xen_blkbk_barrier(struct xenbus_transaction xbt, | ||
236 | struct backend_info *be, int state); | ||
232 | struct xenbus_device *xen_blkbk_xenbus(struct backend_info *be); | 237 | struct xenbus_device *xen_blkbk_xenbus(struct backend_info *be); |
233 | 238 | ||
234 | static inline void blkif_get_x86_32_req(struct blkif_request *dst, | 239 | static inline void blkif_get_x86_32_req(struct blkif_request *dst, |