lib/ftl: Use single iovec during metadata read
Change-Id: Iaf89dcd67e9cfc23fb75a4f227a0095c94398806 Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450741 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
f42f853cd0
commit
9d4152ff11
@ -722,7 +722,7 @@ ftl_read_md_cb(void *arg, int status)
|
||||
|
||||
static struct ftl_md_io *
|
||||
ftl_io_init_md_read(struct spdk_ftl_dev *dev, struct ftl_md *md, void *data, struct ftl_ppa ppa,
|
||||
struct ftl_band *band, size_t lbk_cnt, size_t req_size, ftl_md_pack_fn fn,
|
||||
struct ftl_band *band, size_t lbk_cnt, ftl_md_pack_fn fn,
|
||||
const struct ftl_cb *cb)
|
||||
{
|
||||
struct ftl_md_io *io;
|
||||
@ -734,8 +734,8 @@ ftl_io_init_md_read(struct spdk_ftl_dev *dev, struct ftl_md *md, void *data, str
|
||||
.size = sizeof(*io),
|
||||
.flags = FTL_IO_MD | FTL_IO_PPA_MODE,
|
||||
.type = FTL_IO_READ,
|
||||
.iov_cnt = spdk_divide_round_up(lbk_cnt, req_size),
|
||||
.req_size = req_size,
|
||||
.iov_cnt = 1,
|
||||
.req_size = lbk_cnt,
|
||||
.fn = ftl_read_md_cb,
|
||||
.data = data,
|
||||
};
|
||||
@ -833,8 +833,7 @@ ftl_band_lba_map_ppa(struct ftl_band *band)
|
||||
|
||||
static int
|
||||
ftl_band_read_md(struct ftl_band *band, struct ftl_md *md, void *data, size_t lbk_cnt,
|
||||
size_t req_size, struct ftl_ppa start_ppa, ftl_md_pack_fn unpack_fn,
|
||||
const struct ftl_cb *cb)
|
||||
struct ftl_ppa start_ppa, ftl_md_pack_fn unpack_fn, const struct ftl_cb *cb)
|
||||
{
|
||||
struct spdk_ftl_dev *dev = band->dev;
|
||||
struct ftl_md_io *io;
|
||||
@ -844,7 +843,7 @@ ftl_band_read_md(struct ftl_band *band, struct ftl_md *md, void *data, size_t lb
|
||||
}
|
||||
|
||||
io = ftl_io_init_md_read(dev, md, data, start_ppa, band, lbk_cnt,
|
||||
req_size, unpack_fn, cb);
|
||||
unpack_fn, cb);
|
||||
if (!io) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
@ -859,7 +858,6 @@ ftl_band_read_tail_md(struct ftl_band *band, struct ftl_md *md,
|
||||
{
|
||||
return ftl_band_read_md(band, md, data,
|
||||
ftl_tail_md_num_lbks(band->dev),
|
||||
band->dev->xfer_size,
|
||||
ppa,
|
||||
ftl_unpack_tail_md,
|
||||
cb);
|
||||
@ -873,7 +871,6 @@ ftl_band_read_lba_map(struct ftl_band *band, struct ftl_md *md,
|
||||
/* reading whole metadata */
|
||||
return ftl_band_read_md(band, md, data,
|
||||
ftl_lba_map_num_lbks(band->dev),
|
||||
band->dev->xfer_size,
|
||||
ftl_band_lba_map_ppa(band),
|
||||
ftl_unpack_lba_map,
|
||||
cb);
|
||||
@ -885,7 +882,6 @@ ftl_band_read_head_md(struct ftl_band *band, struct ftl_md *md,
|
||||
{
|
||||
return ftl_band_read_md(band, md, data,
|
||||
ftl_head_md_num_lbks(band->dev),
|
||||
band->dev->xfer_size,
|
||||
ftl_band_head_md_ppa(band),
|
||||
ftl_unpack_head_md,
|
||||
cb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user