Commit b1173e31 authored by Roger Pau Monne's avatar Roger Pau Monne Committed by Konrad Rzeszutek Wilk

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: default avatarRoger Pau Monné <roger.pau@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xen.org
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 9c1e050c
...@@ -74,7 +74,6 @@ struct grant { ...@@ -74,7 +74,6 @@ struct grant {
struct blk_shadow { struct blk_shadow {
struct blkif_request req; struct blkif_request req;
struct request *request; struct request *request;
unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST];
struct grant *grants_used[BLKIF_MAX_SEGMENTS_PER_REQUEST]; struct grant *grants_used[BLKIF_MAX_SEGMENTS_PER_REQUEST];
}; };
...@@ -356,7 +355,6 @@ static int blkif_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -356,7 +355,6 @@ static int blkif_ioctl(struct block_device *bdev, fmode_t mode,
static int blkif_queue_request(struct request *req) static int blkif_queue_request(struct request *req)
{ {
struct blkfront_info *info = req->rq_disk->private_data; struct blkfront_info *info = req->rq_disk->private_data;
unsigned long buffer_mfn;
struct blkif_request *ring_req; struct blkif_request *ring_req;
unsigned long id; unsigned long id;
unsigned int fsect, lsect; unsigned int fsect, lsect;
...@@ -434,7 +432,6 @@ static int blkif_queue_request(struct request *req) ...@@ -434,7 +432,6 @@ static int blkif_queue_request(struct request *req)
gnt_list_entry = get_grant(&gref_head, info); gnt_list_entry = get_grant(&gref_head, info);
ref = gnt_list_entry->gref; ref = gnt_list_entry->gref;
buffer_mfn = pfn_to_mfn(gnt_list_entry->pfn);
info->shadow[id].grants_used[i] = gnt_list_entry; info->shadow[id].grants_used[i] = gnt_list_entry;
...@@ -465,7 +462,6 @@ static int blkif_queue_request(struct request *req) ...@@ -465,7 +462,6 @@ static int blkif_queue_request(struct request *req)
kunmap_atomic(shared_data); kunmap_atomic(shared_data);
} }
info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn);
ring_req->u.rw.seg[i] = ring_req->u.rw.seg[i] =
(struct blkif_request_segment) { (struct blkif_request_segment) {
.gref = ref, .gref = ref,
...@@ -1268,7 +1264,7 @@ static int blkif_recover(struct blkfront_info *info) ...@@ -1268,7 +1264,7 @@ static int blkif_recover(struct blkfront_info *info)
gnttab_grant_foreign_access_ref( gnttab_grant_foreign_access_ref(
req->u.rw.seg[j].gref, req->u.rw.seg[j].gref,
info->xbdev->otherend_id, info->xbdev->otherend_id,
pfn_to_mfn(info->shadow[req->u.rw.id].frame[j]), pfn_to_mfn(copy[i].grants_used[j]->pfn),
0); 0);
} }
info->shadow[req->u.rw.id].req = *req; info->shadow[req->u.rw.id].req = *req;
......
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