break;
case BLKIF_OP_FLUSH_DISKCACHE:
blkif->st_f_req++;
- operation = WRITE_FLUSH;
+ operation = WRITE_FLUSH_FUA;
break;
case BLKIF_OP_WRITE_BARRIER:
default:
/* Check that the number of segments is sane. */
nseg = req->nr_segments;
- if (unlikely(nseg == 0 && operation != WRITE_FLUSH) ||
+ if (unlikely(nseg == 0 && operation != WRITE_FLUSH_FUA) ||
unlikely(nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) {
pr_debug(DRV_PFX "Bad number of segments in request (%d)\n",
nseg);
/* This will be hit if the operation was a flush. */
if (!bio) {
- BUG_ON(operation != WRITE_FLUSH);
+ BUG_ON(operation != WRITE_FLUSH_FUA);
bio = bio_alloc(GFP_KERNEL, 0);
if (unlikely(bio == NULL))
if (operation == READ)
blkif->st_rd_sect += preq.nr_sects;
- else if (operation == WRITE || operation == WRITE_FLUSH)
+ else if (operation == WRITE || operation == WRITE_FLUSH_FUA)
blkif->st_wr_sect += preq.nr_sects;
return 0;
return;
}
- info->feature_flush = 0;
+ info->feature_flush = REQ_FLUSH | REQ_FUA;
info->flush_op = 0;
err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
* If there are barriers, then we use flush.
*/
if (!err && barrier) {
- info->feature_flush = REQ_FLUSH | REQ_FUA;
info->flush_op = BLKIF_OP_WRITE_BARRIER;
}
/*
NULL);
if (!err && flush) {
- info->feature_flush = REQ_FLUSH;
info->flush_op = BLKIF_OP_FLUSH_DISKCACHE;
}
-
+
+ if (!flush && !barrier)
+ info->feature_flush = 0;
+
err = xlvbd_alloc_gendisk(sectors, info, binfo, sector_size);
if (err) {
xenbus_dev_fatal(info->xbdev, err, "xlvbd_add at %s",