summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTom Goetz <tom.goetz@virtualcomputer.com>2011-03-17 17:14:29 +0100
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-04-15 00:26:27 +0200
commit314146e515710f8a7d7eaf7a58b7ed590c9c14c3 (patch)
tree944fe533c4d84bdd2179df86a77071fd95170e7d /drivers
parentxen/blkback: Use kzalloc's, and GFP_KERNEL for data structures. (diff)
downloadlinux-314146e515710f8a7d7eaf7a58b7ed590c9c14c3.tar.xz
linux-314146e515710f8a7d7eaf7a58b7ed590c9c14c3.zip
xen/blkback: Fix the WRITE_BARRIER
The WRITE_BARRIER was missing the REQ_WRITE option. This was causing the blktap to die. Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/blkback/blkback.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/xen/blkback/blkback.c b/drivers/xen/blkback/blkback.c
index a6f8f1338118..4cd5b49de0c1 100644
--- a/drivers/xen/blkback/blkback.c
+++ b/drivers/xen/blkback/blkback.c
@@ -47,6 +47,8 @@
#include <asm/xen/hypercall.h>
#include "common.h"
+#define WRITE_BARRIER (REQ_WRITE | REQ_FLUSH | REQ_FUA)
+
/*
* These are rather arbitrary. They are fairly large because adjacent requests
* pulled from a communication ring are quite likely to end up being part of
@@ -420,7 +422,7 @@ static void dispatch_rw_block_io(blkif_t *blkif,
operation = WRITE;
break;
case BLKIF_OP_WRITE_BARRIER:
- operation = REQ_FLUSH | REQ_FUA;
+ operation = WRITE_BARRIER;
break;
default:
operation = 0; /* make gcc happy */
@@ -429,7 +431,7 @@ static void dispatch_rw_block_io(blkif_t *blkif,
/* Check that number of segments is sane. */
nseg = req->nr_segments;
- if (unlikely(nseg == 0 && operation != (REQ_FLUSH | REQ_FUA)) ||
+ if (unlikely(nseg == 0 && operation != WRITE_BARRIER) ||
unlikely(nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) {
DPRINTK("Bad number of segments in request (%d)\n", nseg);
goto fail_response;
@@ -537,7 +539,7 @@ static void dispatch_rw_block_io(blkif_t *blkif,
}
if (!bio) {
- BUG_ON(operation != (REQ_FLUSH | REQ_FUA));
+ BUG_ON(operation != WRITE_BARRIER);
bio = bio_alloc(GFP_KERNEL, 0);
if (unlikely(bio == NULL))
goto fail_put_bio;
@@ -552,7 +554,7 @@ static void dispatch_rw_block_io(blkif_t *blkif,
if (operation == READ)
blkif->st_rd_sect += preq.nr_sects;
- else if (operation == WRITE || operation == (REQ_FLUSH | REQ_FUA))
+ else if (operation == WRITE || operation == WRITE_BARRIER)
blkif->st_wr_sect += preq.nr_sects;
return;