scatterlist: allow chaining to preallocated chunks
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Jun 2014 16:51:59 +0000 (18:51 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 2 Apr 2015 18:12:28 +0000 (12:12 -0600)
commitaf6327526bb6979037f072fa265acb477601ae77
treef4f58c50607011174b1e0936c9a864ee44c1648e
parentbeb8be6788c9a85cd42857ec1aece91e1d4e41e2
scatterlist: allow chaining to preallocated chunks

Blk-mq drivers usually preallocate their S/G list as part of the request,
but if we want to support the very large S/G lists currently supported by
the SCSI code that would tie up a lot of memory in the preallocated request
pool.  Add support to the scatterlist code so that it can initialize a
S/G list that uses a preallocated first chunks and dynamically allocated
additional chunks.  That way the scsi-mq code can preallocate a first
page worth of S/G entries as part of the request, and dynamically extent
the S/G list when needed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/scsi/scsi_lib.c
include/linux/scatterlist.h
lib/scatterlist.c