bdev: rename (pull|push)_done callbacks
The functions that were passed as callbacks for the memory domain pull/push calls were prefixed with an underscore, which doesn't really explain the difference between the corresponding functions without an underscore. So, they're now renamed to *_and_track() to emphasize that they additionally responsible for tracking IOs. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: Ia9e56230fe244d2c64d729e97445fae105418a76 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17931 Community-CI: Mellanox Build Bot Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
f8a33650d2
commit
b059b49bdf
@ -1230,10 +1230,8 @@ _bdev_io_set_md_buf(struct spdk_bdev_io *bdev_io)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
bdev_io_pull_bounce_data_buf_done(void *ctx, int rc)
|
bdev_io_pull_data_done(struct spdk_bdev_io *bdev_io, int rc)
|
||||||
{
|
{
|
||||||
struct spdk_bdev_io *bdev_io = ctx;
|
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
SPDK_ERRLOG("Failed to get data buffer\n");
|
SPDK_ERRLOG("Failed to get data buffer\n");
|
||||||
assert(bdev_io->internal.data_transfer_cpl);
|
assert(bdev_io->internal.data_transfer_cpl);
|
||||||
@ -1245,7 +1243,7 @@ bdev_io_pull_bounce_data_buf_done(void *ctx, int rc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_bdev_io_pull_bounce_data_buf_done(void *ctx, int status)
|
bdev_io_pull_data_done_and_track(void *ctx, int status)
|
||||||
{
|
{
|
||||||
struct spdk_bdev_io *bdev_io = ctx;
|
struct spdk_bdev_io *bdev_io = ctx;
|
||||||
struct spdk_bdev_channel *ch = bdev_io->internal.ch;
|
struct spdk_bdev_channel *ch = bdev_io->internal.ch;
|
||||||
@ -1257,7 +1255,7 @@ _bdev_io_pull_bounce_data_buf_done(void *ctx, int status)
|
|||||||
bdev_ch_retry_io(ch);
|
bdev_ch_retry_io(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdev_io_pull_bounce_data_buf_done(ctx, status);
|
bdev_io_pull_data_done(bdev_io, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1304,7 +1302,7 @@ bdev_io_pull_data(struct spdk_bdev_io *bdev_io)
|
|||||||
bdev_io->internal.orig_iovs,
|
bdev_io->internal.orig_iovs,
|
||||||
(uint32_t) bdev_io->internal.orig_iovcnt,
|
(uint32_t) bdev_io->internal.orig_iovcnt,
|
||||||
bdev_io->u.bdev.iovs, 1,
|
bdev_io->u.bdev.iovs, 1,
|
||||||
_bdev_io_pull_bounce_data_buf_done,
|
bdev_io_pull_data_done_and_track,
|
||||||
bdev_io);
|
bdev_io);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
/* Continue to submit IO in completion callback */
|
/* Continue to submit IO in completion callback */
|
||||||
@ -1329,7 +1327,7 @@ bdev_io_pull_data(struct spdk_bdev_io *bdev_io)
|
|||||||
if (spdk_unlikely(rc == -ENOMEM)) {
|
if (spdk_unlikely(rc == -ENOMEM)) {
|
||||||
bdev_queue_nomem_io_head(ch->shared_resource, bdev_io, BDEV_IO_RETRY_STATE_PULL);
|
bdev_queue_nomem_io_head(ch->shared_resource, bdev_io, BDEV_IO_RETRY_STATE_PULL);
|
||||||
} else {
|
} else {
|
||||||
bdev_io_pull_bounce_data_buf_done(bdev_io, rc);
|
bdev_io_pull_data_done(bdev_io, rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1560,7 +1558,7 @@ _bdev_io_complete_push_bounce_done(void *ctx, int rc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_bdev_io_push_bounce_md_buf_done(void *ctx, int rc)
|
bdev_io_push_bounce_md_buf_done(void *ctx, int rc)
|
||||||
{
|
{
|
||||||
struct spdk_bdev_io *bdev_io = ctx;
|
struct spdk_bdev_io *bdev_io = ctx;
|
||||||
struct spdk_bdev_channel *ch = bdev_io->internal.ch;
|
struct spdk_bdev_channel *ch = bdev_io->internal.ch;
|
||||||
@ -1596,7 +1594,7 @@ bdev_io_push_bounce_md_buf(struct spdk_bdev_io *bdev_io)
|
|||||||
&bdev_io->internal.orig_md_iov,
|
&bdev_io->internal.orig_md_iov,
|
||||||
(uint32_t)bdev_io->internal.orig_iovcnt,
|
(uint32_t)bdev_io->internal.orig_iovcnt,
|
||||||
&bdev_io->internal.bounce_md_iov, 1,
|
&bdev_io->internal.bounce_md_iov, 1,
|
||||||
_bdev_io_push_bounce_md_buf_done,
|
bdev_io_push_bounce_md_buf_done,
|
||||||
bdev_io);
|
bdev_io);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
/* Continue IO completion in async callback */
|
/* Continue IO completion in async callback */
|
||||||
@ -1625,10 +1623,8 @@ bdev_io_push_bounce_md_buf(struct spdk_bdev_io *bdev_io)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
bdev_io_push_bounce_data_buffer_done(void *ctx, int rc)
|
bdev_io_push_bounce_data_done(struct spdk_bdev_io *bdev_io, int rc)
|
||||||
{
|
{
|
||||||
struct spdk_bdev_io *bdev_io = ctx;
|
|
||||||
|
|
||||||
assert(bdev_io->internal.data_transfer_cpl);
|
assert(bdev_io->internal.data_transfer_cpl);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
bdev_io->internal.data_transfer_cpl(bdev_io, rc);
|
bdev_io->internal.data_transfer_cpl(bdev_io, rc);
|
||||||
@ -1646,7 +1642,7 @@ bdev_io_push_bounce_data_buffer_done(void *ctx, int rc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_bdev_io_push_bounce_data_buffer_done(void *ctx, int status)
|
bdev_io_push_bounce_data_done_and_track(void *ctx, int status)
|
||||||
{
|
{
|
||||||
struct spdk_bdev_io *bdev_io = ctx;
|
struct spdk_bdev_io *bdev_io = ctx;
|
||||||
struct spdk_bdev_channel *ch = bdev_io->internal.ch;
|
struct spdk_bdev_channel *ch = bdev_io->internal.ch;
|
||||||
@ -1658,7 +1654,7 @@ _bdev_io_push_bounce_data_buffer_done(void *ctx, int status)
|
|||||||
bdev_ch_retry_io(ch);
|
bdev_ch_retry_io(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdev_io_push_bounce_data_buffer_done(ctx, status);
|
bdev_io_push_bounce_data_done(bdev_io, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@ -1679,7 +1675,7 @@ bdev_io_push_bounce_data(struct spdk_bdev_io *bdev_io)
|
|||||||
bdev_io->internal.orig_iovs,
|
bdev_io->internal.orig_iovs,
|
||||||
(uint32_t)bdev_io->internal.orig_iovcnt,
|
(uint32_t)bdev_io->internal.orig_iovcnt,
|
||||||
&bdev_io->internal.bounce_iov, 1,
|
&bdev_io->internal.bounce_iov, 1,
|
||||||
_bdev_io_push_bounce_data_buffer_done,
|
bdev_io_push_bounce_data_done_and_track,
|
||||||
bdev_io);
|
bdev_io);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
/* Continue IO completion in async callback */
|
/* Continue IO completion in async callback */
|
||||||
@ -1704,7 +1700,7 @@ bdev_io_push_bounce_data(struct spdk_bdev_io *bdev_io)
|
|||||||
if (spdk_unlikely(rc == -ENOMEM)) {
|
if (spdk_unlikely(rc == -ENOMEM)) {
|
||||||
bdev_queue_nomem_io_head(ch->shared_resource, bdev_io, BDEV_IO_RETRY_STATE_PUSH);
|
bdev_queue_nomem_io_head(ch->shared_resource, bdev_io, BDEV_IO_RETRY_STATE_PUSH);
|
||||||
} else {
|
} else {
|
||||||
bdev_io_push_bounce_data_buffer_done(bdev_io, rc);
|
bdev_io_push_bounce_data_done(bdev_io, rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user