Commit c14024db authored by Jens Axboe's avatar Jens Axboe

Merge branch 'stable/for-jens-4.10' of...

Merge branch 'stable/for-jens-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-linus

Konrad writes:

Please pull in your 'for-linus' branch two little fixes for Xen
block front:

One fix is for handling the XEN_PAGE_SIZE != PAGE_SIZE (4KB vs 64KB
on ARM for example) mishandling while the other is fixing
the accounting for the configuration changes.
parents 08965c2e 3b4f1884
...@@ -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;
...@@ -2223,7 +2223,7 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo) ...@@ -2223,7 +2223,7 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo)
} }
else else
grants = info->max_indirect_segments; grants = info->max_indirect_segments;
psegs = grants / GRANTS_PER_PSEG; psegs = DIV_ROUND_UP(grants, GRANTS_PER_PSEG);
err = fill_grant_buffer(rinfo, err = fill_grant_buffer(rinfo,
(grants + INDIRECT_GREFS(grants)) * BLK_RING_SIZE(info)); (grants + INDIRECT_GREFS(grants)) * BLK_RING_SIZE(info));
...@@ -2323,13 +2323,16 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) ...@@ -2323,13 +2323,16 @@ 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,
"feature-max-indirect-segments", 0); "feature-max-indirect-segments", 0);
info->max_indirect_segments = min(indirect_segments, if (indirect_segments > xen_blkif_max_segments)
xen_blkif_max_segments); indirect_segments = xen_blkif_max_segments;
if (indirect_segments <= BLKIF_MAX_SEGMENTS_PER_REQUEST)
indirect_segments = 0;
info->max_indirect_segments = indirect_segments;
} }
/* /*
...@@ -2652,6 +2655,9 @@ static int __init xlblk_init(void) ...@@ -2652,6 +2655,9 @@ static int __init xlblk_init(void)
if (!xen_domain()) if (!xen_domain())
return -ENODEV; return -ENODEV;
if (xen_blkif_max_segments < BLKIF_MAX_SEGMENTS_PER_REQUEST)
xen_blkif_max_segments = BLKIF_MAX_SEGMENTS_PER_REQUEST;
if (xen_blkif_max_ring_order > XENBUS_MAX_RING_GRANT_ORDER) { if (xen_blkif_max_ring_order > XENBUS_MAX_RING_GRANT_ORDER) {
pr_info("Invalid max_ring_order (%d), will use default max: %d.\n", pr_info("Invalid max_ring_order (%d), will use default max: %d.\n",
xen_blkif_max_ring_order, XENBUS_MAX_RING_GRANT_ORDER); xen_blkif_max_ring_order, XENBUS_MAX_RING_GRANT_ORDER);
......
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