bdev: Change spdk_bdev_get_io to take a bdev channel
We'll need the bdev channel inside this function in an upcoming change. Change-Id: Iadb07700ba57b23d37b7c373d0e9c5063aaed57b Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/406851 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
This commit is contained in:
parent
ddde2c74f2
commit
03717822c5
@ -827,9 +827,9 @@ spdk_bdev_finish(spdk_bdev_fini_cb cb_fn, void *cb_arg)
|
||||
}
|
||||
|
||||
static struct spdk_bdev_io *
|
||||
spdk_bdev_get_io(struct spdk_io_channel *_ch)
|
||||
spdk_bdev_get_io(struct spdk_bdev_channel *channel)
|
||||
{
|
||||
struct spdk_bdev_mgmt_channel *ch = spdk_io_channel_get_ctx(_ch);
|
||||
struct spdk_bdev_mgmt_channel *ch = spdk_io_channel_get_ctx(channel->mgmt_channel);
|
||||
struct spdk_bdev_io *bdev_io;
|
||||
|
||||
if (ch->per_thread_cache_count > 0) {
|
||||
@ -1496,7 +1496,7 @@ spdk_bdev_read_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("spdk_bdev_io memory allocation failed duing read\n");
|
||||
return -ENOMEM;
|
||||
@ -1544,7 +1544,7 @@ int spdk_bdev_readv_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("spdk_bdev_io memory allocation failed duing read\n");
|
||||
return -ENOMEM;
|
||||
@ -1593,7 +1593,7 @@ spdk_bdev_write_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed duing write\n");
|
||||
return -ENOMEM;
|
||||
@ -1646,7 +1646,7 @@ spdk_bdev_writev_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed duing writev\n");
|
||||
return -ENOMEM;
|
||||
@ -1698,7 +1698,7 @@ spdk_bdev_write_zeroes_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channe
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed duing write_zeroes\n");
|
||||
@ -1780,7 +1780,7 @@ spdk_bdev_unmap_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed duing unmap\n");
|
||||
return -ENOMEM;
|
||||
@ -1831,7 +1831,7 @@ spdk_bdev_flush_blocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed duing flush\n");
|
||||
return -ENOMEM;
|
||||
@ -1944,7 +1944,7 @@ spdk_bdev_reset(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
struct spdk_bdev_io *bdev_io;
|
||||
struct spdk_bdev_channel *channel = spdk_io_channel_get_ctx(ch);
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed duing reset\n");
|
||||
return -ENOMEM;
|
||||
@ -2000,7 +2000,7 @@ spdk_bdev_nvme_admin_passthru(struct spdk_bdev_desc *desc, struct spdk_io_channe
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed during nvme_admin_passthru\n");
|
||||
return -ENOMEM;
|
||||
@ -2038,7 +2038,7 @@ spdk_bdev_nvme_io_passthru(struct spdk_bdev_desc *desc, struct spdk_io_channel *
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed during nvme_admin_passthru\n");
|
||||
return -ENOMEM;
|
||||
@ -2076,7 +2076,7 @@ spdk_bdev_nvme_io_passthru_md(struct spdk_bdev_desc *desc, struct spdk_io_channe
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
bdev_io = spdk_bdev_get_io(channel->mgmt_channel);
|
||||
bdev_io = spdk_bdev_get_io(channel);
|
||||
if (!bdev_io) {
|
||||
SPDK_ERRLOG("bdev_io memory allocation failed during nvme_admin_passthru\n");
|
||||
return -ENOMEM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user