blob: add spdk_bs_batch/sequence_read/readv_bs_dev functions
This prepares for some future blobstore.c code that will use these bs_dev functions directly making possible to read from different device than the one in the current context. Signed-off-by: Maciej Szwed <maciej.szwed@intel.com> Change-Id: I55b15544ea4b53475c4b72ee5c92ff1c0a2b8c88 Reviewed-on: https://review.gerrithub.io/393781 Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
bf2d02b6ef
commit
0e91725631
@ -126,9 +126,9 @@ spdk_bs_sequence_start(struct spdk_io_channel *_channel,
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bs_sequence_read(spdk_bs_sequence_t *seq, void *payload,
|
||||
uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg)
|
||||
spdk_bs_sequence_read_bs_dev(spdk_bs_sequence_t *seq, struct spdk_bs_dev *bs_dev,
|
||||
void *payload, uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg)
|
||||
{
|
||||
struct spdk_bs_request_set *set = (struct spdk_bs_request_set *)seq;
|
||||
struct spdk_bs_channel *channel = set->channel;
|
||||
@ -138,8 +138,18 @@ spdk_bs_sequence_read(spdk_bs_sequence_t *seq, void *payload,
|
||||
set->u.sequence.cb_fn = cb_fn;
|
||||
set->u.sequence.cb_arg = cb_arg;
|
||||
|
||||
channel->dev->read(channel->dev, channel->dev_channel, payload, lba, lba_count,
|
||||
&set->cb_args);
|
||||
bs_dev->read(bs_dev, channel->dev_channel, payload, lba, lba_count, &set->cb_args);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bs_sequence_read(spdk_bs_sequence_t *seq, void *payload,
|
||||
uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg)
|
||||
{
|
||||
struct spdk_bs_request_set *set = (struct spdk_bs_request_set *)seq;
|
||||
struct spdk_bs_channel *channel = set->channel;
|
||||
|
||||
spdk_bs_sequence_read_bs_dev(seq, channel->dev, payload, lba, lba_count, cb_fn, cb_arg);
|
||||
}
|
||||
|
||||
void
|
||||
@ -160,9 +170,9 @@ spdk_bs_sequence_write(spdk_bs_sequence_t *seq, void *payload,
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bs_sequence_readv(spdk_bs_sequence_t *seq, struct iovec *iov, int iovcnt,
|
||||
uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg)
|
||||
spdk_bs_sequence_readv_bs_dev(spdk_bs_sequence_t *seq, struct spdk_bs_dev *bs_dev,
|
||||
struct iovec *iov, int iovcnt, uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg)
|
||||
{
|
||||
struct spdk_bs_request_set *set = (struct spdk_bs_request_set *)seq;
|
||||
struct spdk_bs_channel *channel = set->channel;
|
||||
@ -172,8 +182,18 @@ spdk_bs_sequence_readv(spdk_bs_sequence_t *seq, struct iovec *iov, int iovcnt,
|
||||
set->u.sequence.cb_fn = cb_fn;
|
||||
set->u.sequence.cb_arg = cb_arg;
|
||||
|
||||
channel->dev->readv(channel->dev, channel->dev_channel, iov, iovcnt, lba, lba_count,
|
||||
&set->cb_args);
|
||||
bs_dev->readv(bs_dev, channel->dev_channel, iov, iovcnt, lba, lba_count,
|
||||
&set->cb_args);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bs_sequence_readv(spdk_bs_sequence_t *seq, struct iovec *iov, int iovcnt,
|
||||
uint64_t lba, uint32_t lba_count, spdk_bs_sequence_cpl cb_fn, void *cb_arg)
|
||||
{
|
||||
struct spdk_bs_request_set *set = (struct spdk_bs_request_set *)seq;
|
||||
struct spdk_bs_channel *channel = set->channel;
|
||||
|
||||
spdk_bs_sequence_readv_bs_dev(seq, channel->dev, iov, iovcnt, lba, lba_count, cb_fn, cb_arg);
|
||||
}
|
||||
|
||||
void
|
||||
@ -305,8 +325,8 @@ spdk_bs_batch_open(struct spdk_io_channel *_channel,
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bs_batch_read(spdk_bs_batch_t *batch, void *payload,
|
||||
uint64_t lba, uint32_t lba_count)
|
||||
spdk_bs_batch_read_bs_dev(spdk_bs_batch_t *batch, struct spdk_bs_dev *bs_dev,
|
||||
void *payload, uint64_t lba, uint32_t lba_count)
|
||||
{
|
||||
struct spdk_bs_request_set *set = (struct spdk_bs_request_set *)batch;
|
||||
struct spdk_bs_channel *channel = set->channel;
|
||||
@ -314,8 +334,17 @@ spdk_bs_batch_read(spdk_bs_batch_t *batch, void *payload,
|
||||
SPDK_DEBUGLOG(SPDK_LOG_BLOB_RW, "Reading %u blocks from LBA %lu\n", lba_count, lba);
|
||||
|
||||
set->u.batch.outstanding_ops++;
|
||||
channel->dev->read(channel->dev, channel->dev_channel, payload, lba, lba_count,
|
||||
&set->cb_args);
|
||||
bs_dev->read(bs_dev, channel->dev_channel, payload, lba, lba_count, &set->cb_args);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bs_batch_read(spdk_bs_batch_t *batch, void *payload,
|
||||
uint64_t lba, uint32_t lba_count)
|
||||
{
|
||||
struct spdk_bs_request_set *set = (struct spdk_bs_request_set *)batch;
|
||||
struct spdk_bs_channel *channel = set->channel;
|
||||
|
||||
spdk_bs_batch_read_bs_dev(batch, channel->dev, payload, lba, lba_count);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -132,6 +132,10 @@ void spdk_bs_call_cpl(struct spdk_bs_cpl *cpl, int bserrno);
|
||||
spdk_bs_sequence_t *spdk_bs_sequence_start(struct spdk_io_channel *channel,
|
||||
struct spdk_bs_cpl *cpl);
|
||||
|
||||
void spdk_bs_sequence_read_bs_dev(spdk_bs_sequence_t *seq, struct spdk_bs_dev *bs_dev,
|
||||
void *payload, uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg);
|
||||
|
||||
void spdk_bs_sequence_read(spdk_bs_sequence_t *seq, void *payload,
|
||||
uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg);
|
||||
@ -140,9 +144,12 @@ void spdk_bs_sequence_write(spdk_bs_sequence_t *seq, void *payload,
|
||||
uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg);
|
||||
|
||||
void spdk_bs_sequence_readv_bs_dev(spdk_bs_batch_t *batch, struct spdk_bs_dev *bs_dev,
|
||||
struct iovec *iov, int iovcnt, uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg);
|
||||
|
||||
void spdk_bs_sequence_readv(spdk_bs_batch_t *batch, struct iovec *iov, int iovcnt,
|
||||
uint64_t lba, uint32_t lba_count,
|
||||
spdk_bs_sequence_cpl cb_fn, void *cb_arg);
|
||||
uint64_t lba, uint32_t lba_count, spdk_bs_sequence_cpl cb_fn, void *cb_arg);
|
||||
|
||||
void spdk_bs_sequence_writev(spdk_bs_batch_t *batch, struct iovec *iov, int iovcnt,
|
||||
uint64_t lba, uint32_t lba_count,
|
||||
@ -164,6 +171,9 @@ void spdk_bs_sequence_finish(spdk_bs_sequence_t *seq, int bserrno);
|
||||
spdk_bs_batch_t *spdk_bs_batch_open(struct spdk_io_channel *channel,
|
||||
struct spdk_bs_cpl *cpl);
|
||||
|
||||
void spdk_bs_batch_read_bs_dev(spdk_bs_batch_t *batch, struct spdk_bs_dev *bs_dev,
|
||||
void *payload, uint64_t lba, uint32_t lba_count);
|
||||
|
||||
void spdk_bs_batch_read(spdk_bs_batch_t *batch, void *payload,
|
||||
uint64_t lba, uint32_t lba_count);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user