diff options
author | Roger Pau Monne <roger.pau@citrix.com> | 2013-03-18 12:49:36 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-03-19 12:50:07 -0400 |
commit | b1173e316bf2ff3c11f46247417f0f5789a4ea0c (patch) | |
tree | a64663ed04ea816306d28559e2d9c496ad746915 | |
parent | 9c1e050caeb4d1250f8ceef1180a8b3d0db6c624 (diff) |
xen-blkfront: remove frame list from blk_shadow
We already have the frame (pfn of the grant page) stored inside struct
grant, so there's no need to keep an aditional list of mapped frames
for a specific request. This reduces memory usage in blkfront.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xen.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r-- | drivers/block/xen-blkfront.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c64043323399..a894f88762d8 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -74,7 +74,6 @@ struct grant { | |||
74 | struct blk_shadow { | 74 | struct blk_shadow { |
75 | struct blkif_request req; | 75 | struct blkif_request req; |
76 | struct request *request; | 76 | struct request *request; |
77 | unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | ||
78 | struct grant *grants_used[BLKIF_MAX_SEGMENTS_PER_REQUEST]; | 77 | struct grant *grants_used[BLKIF_MAX_SEGMENTS_PER_REQUEST]; |
79 | }; | 78 | }; |
80 | 79 | ||
@@ -356,7 +355,6 @@ static int blkif_ioctl(struct block_device *bdev, fmode_t mode, | |||
356 | static int blkif_queue_request(struct request *req) | 355 | static int blkif_queue_request(struct request *req) |
357 | { | 356 | { |
358 | struct blkfront_info *info = req->rq_disk->private_data; | 357 | struct blkfront_info *info = req->rq_disk->private_data; |
359 | unsigned long buffer_mfn; | ||
360 | struct blkif_request *ring_req; | 358 | struct blkif_request *ring_req; |
361 | unsigned long id; | 359 | unsigned long id; |
362 | unsigned int fsect, lsect; | 360 | unsigned int fsect, lsect; |
@@ -434,7 +432,6 @@ static int blkif_queue_request(struct request *req) | |||
434 | 432 | ||
435 | gnt_list_entry = get_grant(&gref_head, info); | 433 | gnt_list_entry = get_grant(&gref_head, info); |
436 | ref = gnt_list_entry->gref; | 434 | ref = gnt_list_entry->gref; |
437 | buffer_mfn = pfn_to_mfn(gnt_list_entry->pfn); | ||
438 | 435 | ||
439 | info->shadow[id].grants_used[i] = gnt_list_entry; | 436 | info->shadow[id].grants_used[i] = gnt_list_entry; |
440 | 437 | ||
@@ -465,7 +462,6 @@ static int blkif_queue_request(struct request *req) | |||
465 | kunmap_atomic(shared_data); | 462 | kunmap_atomic(shared_data); |
466 | } | 463 | } |
467 | 464 | ||
468 | info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn); | ||
469 | ring_req->u.rw.seg[i] = | 465 | ring_req->u.rw.seg[i] = |
470 | (struct blkif_request_segment) { | 466 | (struct blkif_request_segment) { |
471 | .gref = ref, | 467 | .gref = ref, |
@@ -1268,7 +1264,7 @@ static int blkif_recover(struct blkfront_info *info) | |||
1268 | gnttab_grant_foreign_access_ref( | 1264 | gnttab_grant_foreign_access_ref( |
1269 | req->u.rw.seg[j].gref, | 1265 | req->u.rw.seg[j].gref, |
1270 | info->xbdev->otherend_id, | 1266 | info->xbdev->otherend_id, |
1271 | pfn_to_mfn(info->shadow[req->u.rw.id].frame[j]), | 1267 | pfn_to_mfn(copy[i].grants_used[j]->pfn), |
1272 | 0); | 1268 | 0); |
1273 | } | 1269 | } |
1274 | info->shadow[req->u.rw.id].req = *req; | 1270 | info->shadow[req->u.rw.id].req = *req; |