bdev/aio: Eliminate bdev_aio_initialize_channel
Small static function only called from one place, so just inline it. Change-Id: Ibc54f790da55dd1635d81181208b1d506550ca9c Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/443307 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
71889403e2
commit
d92e0a403b
@ -209,24 +209,6 @@ bdev_aio_destruct(void *ctx)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
bdev_aio_initialize_io_channel(struct bdev_aio_io_channel *ch)
|
||||
{
|
||||
ch->efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
|
||||
if (ch->efd == -1) {
|
||||
SPDK_ERRLOG("Cannot create efd\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (io_setup(SPDK_AIO_QUEUE_DEPTH, &ch->io_ctx) < 0) {
|
||||
close(ch->efd);
|
||||
SPDK_ERRLOG("async I/O context setup failure\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
bdev_aio_group_poll(void *arg)
|
||||
{
|
||||
@ -409,7 +391,15 @@ bdev_aio_create_cb(void *io_device, void *ctx_buf)
|
||||
struct bdev_aio_group_channel *group_ch_ctx;
|
||||
struct epoll_event epevent;
|
||||
|
||||
if (bdev_aio_initialize_io_channel(ch) != 0) {
|
||||
ch->efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
|
||||
if (ch->efd == -1) {
|
||||
SPDK_ERRLOG("Cannot create efd\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (io_setup(SPDK_AIO_QUEUE_DEPTH, &ch->io_ctx) < 0) {
|
||||
close(ch->efd);
|
||||
SPDK_ERRLOG("async I/O context setup failure\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user