diff options
author | Javier González <javier@cnexlabs.com> | 2017-10-13 14:46:18 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-10-13 08:34:57 -0600 |
commit | 875d94f3a4838f2243334e5ce55ac8153f9bbf5b (patch) | |
tree | 93577e6000070396c0c3b6e42e51fe4dd9d593df /drivers/lightnvm/pblk-rb.c | |
parent | 6ca2f71f3e3d94d188000b420ce0529b07f3ce95 (diff) | |
download | op-kernel-dev-875d94f3a4838f2243334e5ce55ac8153f9bbf5b.zip op-kernel-dev-875d94f3a4838f2243334e5ce55ac8153f9bbf5b.tar.gz |
lightnvm: pblk: allocate bio size more accurately
Wait until we know the exact number of ppas to be sent to the device,
before allocating the bio.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-rb.c')
-rw-r--r-- | drivers/lightnvm/pblk-rb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c index 05e6b2e..1173e23 100644 --- a/drivers/lightnvm/pblk-rb.c +++ b/drivers/lightnvm/pblk-rb.c @@ -552,12 +552,13 @@ out: * persist data on the write buffer to the media. */ unsigned int pblk_rb_read_to_bio(struct pblk_rb *rb, struct nvm_rq *rqd, - struct bio *bio, unsigned int pos, - unsigned int nr_entries, unsigned int count) + unsigned int pos, unsigned int nr_entries, + unsigned int count) { struct pblk *pblk = container_of(rb, struct pblk, rwb); struct request_queue *q = pblk->dev->q; struct pblk_c_ctx *c_ctx = nvm_rq_to_pdu(rqd); + struct bio *bio = rqd->bio; struct pblk_rb_entry *entry; struct page *page; unsigned int pad = 0, to_read = nr_entries; |