Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block/xen-blkback: s/nr_pages/nr_segs/

Make the code less confusing to read now that Linux may not have the
same page size as Xen.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>

authored by

Julien Grall and committed by
David Vrabel
6684fa1c ee4b7179

+6 -6
+5 -5
drivers/block/xen-blkback/blkback.c
··· 729 729 struct grant_page **pages = req->segments; 730 730 unsigned int invcount; 731 731 732 - invcount = xen_blkbk_unmap_prepare(blkif, pages, req->nr_pages, 732 + invcount = xen_blkbk_unmap_prepare(blkif, pages, req->nr_segs, 733 733 req->unmap, req->unmap_pages); 734 734 735 735 work->data = req; ··· 915 915 int rc; 916 916 917 917 rc = xen_blkbk_map(pending_req->blkif, pending_req->segments, 918 - pending_req->nr_pages, 918 + pending_req->nr_segs, 919 919 (pending_req->operation != BLKIF_OP_READ)); 920 920 921 921 return rc; ··· 931 931 int indirect_grefs, rc, n, nseg, i; 932 932 struct blkif_request_segment *segments = NULL; 933 933 934 - nseg = pending_req->nr_pages; 934 + nseg = pending_req->nr_segs; 935 935 indirect_grefs = INDIRECT_PAGES(nseg); 936 936 BUG_ON(indirect_grefs > BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST); 937 937 ··· 1251 1251 pending_req->id = req->u.rw.id; 1252 1252 pending_req->operation = req_operation; 1253 1253 pending_req->status = BLKIF_RSP_OKAY; 1254 - pending_req->nr_pages = nseg; 1254 + pending_req->nr_segs = nseg; 1255 1255 1256 1256 if (req->operation != BLKIF_OP_INDIRECT) { 1257 1257 preq.dev = req->u.rw.handle; ··· 1372 1372 1373 1373 fail_flush: 1374 1374 xen_blkbk_unmap(blkif, pending_req->segments, 1375 - pending_req->nr_pages); 1375 + pending_req->nr_segs); 1376 1376 fail_response: 1377 1377 /* Haven't submitted any bio's yet. */ 1378 1378 make_response(blkif, req->u.rw.id, req_operation, BLKIF_RSP_ERROR);
+1 -1
drivers/block/xen-blkback/common.h
··· 343 343 struct pending_req { 344 344 struct xen_blkif *blkif; 345 345 u64 id; 346 - int nr_pages; 346 + int nr_segs; 347 347 atomic_t pendcnt; 348 348 unsigned short operation; 349 349 int status;