Skip to content
Snippets Groups Projects
Commit 74a9fe09 authored by Filippos Giannakos's avatar Filippos Giannakos
Browse files

Make xsegbd use xseg_reply_info struct

parent 2d818823
No related branches found
No related tags found
No related merge requests found
...@@ -515,7 +515,8 @@ int update_dev_sectors_from_request( struct xsegbd_device *xsegbd_dev, ...@@ -515,7 +515,8 @@ int update_dev_sectors_from_request( struct xsegbd_device *xsegbd_dev,
XSEGLOG("Invalid xsegbd_dev"); XSEGLOG("Invalid xsegbd_dev");
return -ENOENT; return -ENOENT;
} }
xsegbd_dev->sectors = *((uint64_t *) data) / 512ULL; struct xseg_reply_info *xreply = (struct xseg_reply_info *)data;
xsegbd_dev->sectors = xreply->size / 512ULL;
return 0; return 0;
} }
......
...@@ -454,9 +454,10 @@ static int mapping_info(struct peerd *peer, struct peer_req *pr) ...@@ -454,9 +454,10 @@ static int mapping_info(struct peerd *peer, struct peer_req *pr)
vio->err = 1; vio->err = 1;
} }
else { else {
struct xseg_reply_info *xinfo = (struct xseg_reply_info *) xseg_get_data(peer->xseg, vio->mreq); struct xseg_reply_info *xinfo = (struct xseg_reply_info *)xseg_get_data(peer->xseg, vio->mreq);
char *data = xseg_get_data(peer->xseg, pr->req); char *data = xseg_get_data(peer->xseg, pr->req);
*(uint64_t *)data = xinfo->size; struct xseg_reply_info *xreply = (struct xseg_reply_info *)data;
xreply->size = xinfo->size;
} }
xseg_put_request(peer->xseg, vio->mreq, pr->portno); xseg_put_request(peer->xseg, vio->mreq, pr->portno);
vio->mreq = NULL; vio->mreq = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment