Commit b32728ff authored by Jan Beulich's avatar Jan Beulich Committed by Konrad Rzeszutek Wilk

xen-blkfront: feature flags handling adjustments

Don't truncate the "feature-persistent" value read from xenstore: Any
non-zero value is supposed to enable the feature, just like is already
being done for feature_secdiscard.

Just like the other feature_* fields, feature_flush and feature_fua are
boolean flags, and hence fit well into a single bit.

Keep all bit fields together to limit gaps.
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent d61b7f97
...@@ -197,13 +197,13 @@ struct blkfront_info ...@@ -197,13 +197,13 @@ struct blkfront_info
/* Number of pages per ring buffer. */ /* Number of pages per ring buffer. */
unsigned int nr_ring_pages; unsigned int nr_ring_pages;
struct request_queue *rq; struct request_queue *rq;
unsigned int feature_flush; unsigned int feature_flush:1;
unsigned int feature_fua; unsigned int feature_fua:1;
unsigned int feature_discard:1; unsigned int feature_discard:1;
unsigned int feature_secdiscard:1; unsigned int feature_secdiscard:1;
unsigned int feature_persistent:1;
unsigned int discard_granularity; unsigned int discard_granularity;
unsigned int discard_alignment; unsigned int discard_alignment;
unsigned int feature_persistent:1;
/* Number of 4KB segments handled */ /* Number of 4KB segments handled */
unsigned int max_indirect_segments; unsigned int max_indirect_segments;
int is_ready; int is_ready;
...@@ -2323,7 +2323,7 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) ...@@ -2323,7 +2323,7 @@ static void blkfront_gather_backend_features(struct blkfront_info *info)
blkfront_setup_discard(info); blkfront_setup_discard(info);
info->feature_persistent = info->feature_persistent =
xenbus_read_unsigned(info->xbdev->otherend, !!xenbus_read_unsigned(info->xbdev->otherend,
"feature-persistent", 0); "feature-persistent", 0);
indirect_segments = xenbus_read_unsigned(info->xbdev->otherend, indirect_segments = xenbus_read_unsigned(info->xbdev->otherend,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment