event: remove spdk_event_allocate() next parameter

The 'next' event pointer was never used in the entire code base (always
NULL).

Change-Id: I75f999d3a2e10512d86edec1a5a46ef263e2635b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2017-01-04 18:40:14 -07:00 committed by Ben Walker
parent c3ede774c7
commit 7ac9a4ecbb
15 changed files with 26 additions and 34 deletions

View File

@ -100,7 +100,7 @@ nvmf_tgt_delete_subsystem(struct nvmf_tgt_subsystem *app_subsys)
* the subsystem's memory.
*/
event = spdk_event_allocate(spdk_app_get_current_core(), subsystem_delete_event,
app_subsys, NULL, NULL);
app_subsys, NULL);
spdk_poller_unregister(&app_subsys->poller, event);
}
@ -132,7 +132,7 @@ spdk_nvmf_shutdown_cb(void)
fprintf(stdout, "=========================\n");
event = spdk_event_allocate(spdk_app_get_current_core(), acceptor_poller_unregistered_event,
NULL, NULL, NULL);
NULL, NULL);
spdk_poller_unregister(&g_acceptor_poller, event);
}
@ -159,7 +159,7 @@ connect_cb(void *cb_ctx, struct spdk_nvmf_request *req)
struct spdk_event *event;
/* Pass an event to the lcore that owns this subsystem */
event = spdk_event_allocate(app_subsys->lcore, connect_event, req, NULL, NULL);
event = spdk_event_allocate(app_subsys->lcore, connect_event, req, NULL);
spdk_event_call(event);
}
@ -178,7 +178,7 @@ disconnect_cb(void *cb_ctx, struct spdk_nvmf_conn *conn)
struct spdk_event *event;
/* Pass an event to the core that owns this connection */
event = spdk_event_allocate(app_subsys->lcore, disconnect_event, conn, NULL, NULL);
event = spdk_event_allocate(app_subsys->lcore, disconnect_event, conn, NULL);
spdk_event_call(event);
}
@ -211,7 +211,7 @@ nvmf_tgt_start_subsystem(struct nvmf_tgt_subsystem *app_subsys)
struct spdk_event *event;
event = spdk_event_allocate(app_subsys->lcore, _nvmf_tgt_start_subsystem,
app_subsys, NULL, NULL);
app_subsys, NULL);
spdk_event_call(event);
}

View File

@ -199,8 +199,7 @@ uint32_t spdk_app_get_current_core(void);
* \brief Allocate an event to be passed to \ref spdk_event_call
*/
struct spdk_event *spdk_event_allocate(uint32_t lcore, spdk_event_fn fn,
void *arg1, void *arg2,
struct spdk_event *next);
void *arg1, void *arg2);
/**
* \brief Pass the given event to the associated lcore and call the function.

View File

@ -43,7 +43,6 @@ struct spdk_event {
spdk_event_fn fn;
void *arg1;
void *arg2;
struct spdk_event *next;
};
int spdk_reactors_init(const char *mask, unsigned int max_delay_us);

View File

@ -449,7 +449,7 @@ spdk_bdev_io_submit(struct spdk_bdev_io *bdev_io)
if (bdev_io->status == SPDK_BDEV_IO_STATUS_PENDING) {
cb_event = spdk_event_allocate(rte_lcore_id(), bdev_io->cb,
bdev_io->caller_ctx, bdev_io, NULL);
bdev_io->caller_ctx, bdev_io);
assert(cb_event != NULL);
}

View File

@ -349,7 +349,7 @@ spdk_app_init(struct spdk_app_opts *opts)
if (opts->shutdown_cb != NULL) {
g_shutdown_event = spdk_event_allocate(rte_lcore_id(), __shutdown_event_cb,
NULL, NULL, NULL);
NULL, NULL);
sigact.sa_handler = __shutdown_signal;
sigemptyset(&sigact.sa_mask);
@ -434,7 +434,7 @@ spdk_app_start(spdk_event_fn start_fn, void *arg1, void *arg2)
g_spdk_app.rc = 0;
event = spdk_event_allocate(rte_get_master_lcore(), start_fn,
arg1, arg2, NULL);
arg1, arg2);
/* Queues up the event, but can't run it until the reactors start */
spdk_event_call(event);

View File

@ -140,8 +140,7 @@ spdk_reactor_get(uint32_t lcore)
}
struct spdk_event *
spdk_event_allocate(uint32_t lcore, spdk_event_fn fn, void *arg1, void *arg2,
struct spdk_event *next)
spdk_event_allocate(uint32_t lcore, spdk_event_fn fn, void *arg1, void *arg2)
{
struct spdk_event *event = NULL;
unsigned socket_id = rte_lcore_to_socket_id(lcore);
@ -158,7 +157,6 @@ spdk_event_allocate(uint32_t lcore, spdk_event_fn fn, void *arg1, void *arg2,
event->fn = fn;
event->arg1 = arg1;
event->arg2 = arg2;
event->next = next;
return event;
}
@ -686,8 +684,7 @@ spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg,
* The poller is registered to run on a different core.
* Schedule an event to run on the poller's core that will add the poller.
*/
spdk_event_call(spdk_event_allocate(lcore, _spdk_event_add_poller, reactor, poller,
NULL));
spdk_event_call(spdk_event_allocate(lcore, _spdk_event_add_poller, reactor, poller));
}
}
@ -759,7 +756,6 @@ spdk_poller_unregister(struct spdk_poller **ppoller,
* The poller is registered on a different core.
* Schedule an event to run on the poller's core that will remove the poller.
*/
spdk_event_call(spdk_event_allocate(lcore, _spdk_event_remove_poller, poller, complete,
NULL));
spdk_event_call(spdk_event_allocate(lcore, _spdk_event_remove_poller, poller, complete));
}
}

View File

@ -684,7 +684,7 @@ spdk_iscsi_conn_get_migrate_event(struct spdk_iscsi_conn *conn, int *_lcore)
*_lcore = lcore;
}
event = spdk_event_allocate(lcore, spdk_iscsi_conn_full_feature_migrate, conn, NULL, NULL);
event = spdk_event_allocate(lcore, spdk_iscsi_conn_full_feature_migrate, conn, NULL);
return event;
}
@ -710,7 +710,7 @@ spdk_iscsi_conn_stop_poller(struct spdk_iscsi_conn *conn, spdk_event_fn fn_after
}
__sync_fetch_and_sub(&g_num_connections[spdk_app_get_current_core()], 1);
spdk_net_framework_clear_socket_association(conn->sock);
event = spdk_event_allocate(lcore, fn_after_stop, conn, NULL, NULL);
event = spdk_event_allocate(lcore, fn_after_stop, conn, NULL);
spdk_poller_unregister(&conn->poller, event);
}

View File

@ -2809,7 +2809,7 @@ static void spdk_iscsi_queue_task(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_task *task)
{
task->scsi.cb_event = spdk_event_allocate(spdk_app_get_current_core(), process_task_completion,
conn, task, NULL);
conn, task);
spdk_trace_record(TRACE_ISCSI_TASK_QUEUE, conn->id, task->scsi.length,
(uintptr_t)task, (uintptr_t)task->pdu);
spdk_scsi_dev_queue_task(conn->dev, &task->scsi);
@ -2819,7 +2819,7 @@ static void spdk_iscsi_queue_mgmt_task(struct spdk_iscsi_conn *conn,
struct spdk_iscsi_task *task)
{
task->scsi.cb_event = spdk_event_allocate(spdk_app_get_current_core(), process_task_mgmt_completion,
conn, task, NULL);
conn, task);
spdk_scsi_dev_queue_mgmt_task(conn->dev, &task->scsi);
}

View File

@ -975,8 +975,7 @@ spdk_iscsi_subsystem_init(void)
/*
* Defer creation of listening sockets until the reactor has started.
*/
spdk_event_call(spdk_event_allocate(spdk_app_get_current_core(), spdk_iscsi_setup, NULL, NULL,
NULL));
spdk_event_call(spdk_event_allocate(spdk_app_get_current_core(), spdk_iscsi_setup, NULL, NULL));
return 0;
}

View File

@ -1087,7 +1087,7 @@ spdk_iscsi_tgt_node_cleanup_luns(struct spdk_iscsi_conn *conn,
task->scsi.function = SPDK_SCSI_TASK_FUNC_LUN_RESET;
task->scsi.cb_event = spdk_event_allocate(spdk_app_get_current_core(),
process_task_mgmt_completion, conn, task, NULL);
process_task_mgmt_completion, conn, task);
spdk_scsi_dev_queue_mgmt_task(target->dev, &task->scsi);
}

View File

@ -262,7 +262,7 @@ spdk_rpc_finish(void)
}
complete = spdk_event_allocate(spdk_app_get_current_core(), spdk_rpc_finish_cleanup,
NULL, NULL, NULL);
NULL, NULL);
spdk_poller_unregister(&g_rpc_poller, complete);
return 0;
}

View File

@ -195,7 +195,7 @@ blockdev_write(struct io_target *target, char *tx_buf,
g_completion_status = SPDK_BDEV_IO_STATUS_FAILED;
event = spdk_event_allocate(1, __blockdev_write, &req, NULL, NULL);
event = spdk_event_allocate(1, __blockdev_write, &req, NULL);
pthread_mutex_lock(&g_test_mutex);
spdk_event_call(event);
pthread_cond_wait(&g_test_cond, &g_test_mutex);
@ -242,7 +242,7 @@ blockdev_read(struct io_target *target, char *rx_buf,
g_completion_status = SPDK_BDEV_IO_STATUS_FAILED;
event = spdk_event_allocate(1, __blockdev_read, &req, NULL, NULL);
event = spdk_event_allocate(1, __blockdev_read, &req, NULL);
pthread_mutex_lock(&g_test_mutex);
spdk_event_call(event);
pthread_cond_wait(&g_test_cond, &g_test_mutex);
@ -647,7 +647,7 @@ blockdev_reset(struct io_target *target, enum spdk_bdev_reset_type reset_type)
g_completion_status = SPDK_BDEV_IO_STATUS_FAILED;
event = spdk_event_allocate(1, __blockdev_reset, &req, &reset_type, NULL);
event = spdk_event_allocate(1, __blockdev_reset, &req, &reset_type);
pthread_mutex_lock(&g_test_mutex);
spdk_event_call(event);
pthread_cond_wait(&g_test_cond, &g_test_mutex);

View File

@ -221,7 +221,7 @@ bdevperf_complete(void *arg1, void *arg2)
bdevperf_submit_single(target);
} else if (target->current_queue_depth == 0) {
spdk_put_io_channel(target->ch);
complete = spdk_event_allocate(rte_get_master_lcore(), end_run, NULL, NULL, NULL);
complete = spdk_event_allocate(rte_get_master_lcore(), end_run, NULL, NULL);
spdk_event_call(complete);
}
}
@ -502,7 +502,7 @@ bdevperf_run(void *arg1, void *arg2)
target = head[i];
if (target != NULL) {
event = spdk_event_allocate(target->lcore, bdevperf_submit_on_core,
target, NULL, NULL);
target, NULL);
spdk_event_call(event);
}
}

View File

@ -65,7 +65,7 @@ submit_new_event(void *arg1, void *arg2)
}
++__call_count;
event = spdk_event_allocate(next_lcore, submit_new_event, NULL, NULL, NULL);
event = spdk_event_allocate(next_lcore, submit_new_event, NULL, NULL);
spdk_event_call(event);
}

View File

@ -93,8 +93,7 @@ spdk_app_get_current_core(void)
}
struct spdk_event *
spdk_event_allocate(uint32_t core, spdk_event_fn fn, void *arg1, void *arg2,
struct spdk_event *next)
spdk_event_allocate(uint32_t core, spdk_event_fn fn, void *arg1, void *arg2)
{
return NULL;
}