lib/ftl: ftl_submit_read parameter cleanup

Removed unused 'context' parameter. Removed 'lbk' parameter from
next_ppa function signature, as it could be easily deduced from ftl_io
passed as the first argument.

Change-Id: I2b2b699ffc1b282086adcc2d4dc6c4691a87a7c5
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454228
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Konrad Sztyber 2019-05-13 09:35:56 +02:00 committed by Darek Stojaczyk
parent ac63db1981
commit e12f7014b4

View File

@ -90,7 +90,7 @@ struct ftl_flush {
LIST_ENTRY(ftl_flush) list_entry; LIST_ENTRY(ftl_flush) list_entry;
}; };
typedef int (*ftl_next_ppa_fn)(struct ftl_io *, struct ftl_ppa *, size_t); typedef int (*ftl_next_ppa_fn)(struct ftl_io *, struct ftl_ppa *);
static void _ftl_read(void *); static void _ftl_read(void *);
static void _ftl_write(void *); static void _ftl_write(void *);
@ -214,7 +214,7 @@ ftl_md_write_cb(void *arg, int status)
} }
static int static int
ftl_ppa_read_next_ppa(struct ftl_io *io, struct ftl_ppa *ppa, size_t lbk) ftl_ppa_read_next_ppa(struct ftl_io *io, struct ftl_ppa *ppa)
{ {
struct spdk_ftl_dev *dev = io->dev; struct spdk_ftl_dev *dev = io->dev;
size_t lbk_cnt, max_lbks; size_t lbk_cnt, max_lbks;
@ -222,10 +222,10 @@ ftl_ppa_read_next_ppa(struct ftl_io *io, struct ftl_ppa *ppa, size_t lbk)
assert(ftl_io_mode_ppa(io)); assert(ftl_io_mode_ppa(io));
assert(io->iov_pos < io->iov_cnt); assert(io->iov_pos < io->iov_cnt);
if (lbk == 0) { if (io->pos == 0) {
*ppa = io->ppa; *ppa = io->ppa;
} else { } else {
*ppa = ftl_band_next_xfer_ppa(io->band, io->ppa, lbk); *ppa = ftl_band_next_xfer_ppa(io->band, io->ppa, io->pos);
} }
assert(!ftl_ppa_invalid(*ppa)); assert(!ftl_ppa_invalid(*ppa));
@ -704,8 +704,7 @@ ftl_add_to_retry_queue(struct ftl_io *io)
} }
static int static int
ftl_submit_read(struct ftl_io *io, ftl_next_ppa_fn next_ppa, ftl_submit_read(struct ftl_io *io, ftl_next_ppa_fn next_ppa)
void *ctx)
{ {
struct spdk_ftl_dev *dev = io->dev; struct spdk_ftl_dev *dev = io->dev;
struct ftl_ppa ppa; struct ftl_ppa ppa;
@ -713,7 +712,7 @@ ftl_submit_read(struct ftl_io *io, ftl_next_ppa_fn next_ppa,
while (io->pos < io->lbk_cnt) { while (io->pos < io->lbk_cnt) {
/* We might hit the cache here, if so, skip the read */ /* We might hit the cache here, if so, skip the read */
lbk_cnt = rc = next_ppa(io, &ppa, io->pos); lbk_cnt = rc = next_ppa(io, &ppa);
/* We might need to retry the read from scratch (e.g. */ /* We might need to retry the read from scratch (e.g. */
/* because write was under way and completed before */ /* because write was under way and completed before */
@ -784,7 +783,7 @@ out:
} }
static int static int
ftl_lba_read_next_ppa(struct ftl_io *io, struct ftl_ppa *ppa, size_t lbk) ftl_lba_read_next_ppa(struct ftl_io *io, struct ftl_ppa *ppa)
{ {
struct spdk_ftl_dev *dev = io->dev; struct spdk_ftl_dev *dev = io->dev;
struct ftl_ppa next_ppa; struct ftl_ppa next_ppa;
@ -1500,7 +1499,7 @@ ftl_io_read(struct ftl_io *io)
next_ppa = ftl_lba_read_next_ppa; next_ppa = ftl_lba_read_next_ppa;
} }
return ftl_submit_read(io, next_ppa, NULL); return ftl_submit_read(io, next_ppa);
} }
spdk_thread_send_msg(ftl_get_read_thread(dev), _ftl_read, io); spdk_thread_send_msg(ftl_get_read_thread(dev), _ftl_read, io);