nvme: rename struct spdk_nvme_controller_process

Change-Id: If8f29409b86281532eae6d87d056a2f02f6609d4
Signed-off-by: GangCao <gang.cao@intel.com>
This commit is contained in:
GangCao 2016-11-16 20:54:17 -05:00 committed by Daniel Verkamp
parent 74c4833229
commit af9eca84d6
3 changed files with 19 additions and 19 deletions

View File

@ -809,10 +809,10 @@ nvme_ctrlr_configure_aer(struct spdk_nvme_ctrlr *ctrlr)
int int
nvme_ctrlr_add_process(struct spdk_nvme_ctrlr *ctrlr, void *devhandle) nvme_ctrlr_add_process(struct spdk_nvme_ctrlr *ctrlr, void *devhandle)
{ {
struct spdk_nvme_controller_process *ctrlr_proc; struct spdk_nvme_ctrlr_process *ctrlr_proc;
/* Initialize the per process properties for this ctrlr */ /* Initialize the per process properties for this ctrlr */
ctrlr_proc = spdk_zmalloc(sizeof(struct spdk_nvme_controller_process), 64, NULL); ctrlr_proc = spdk_zmalloc(sizeof(struct spdk_nvme_ctrlr_process), 64, NULL);
if (ctrlr_proc == NULL) { if (ctrlr_proc == NULL) {
SPDK_ERRLOG("failed to allocate memory to track the process props\n"); SPDK_ERRLOG("failed to allocate memory to track the process props\n");
@ -836,7 +836,7 @@ nvme_ctrlr_add_process(struct spdk_nvme_ctrlr *ctrlr, void *devhandle)
* Note: the ctrl_lock must be held when calling this function. * Note: the ctrl_lock must be held when calling this function.
*/ */
static void static void
nvme_ctrlr_cleanup_process(struct spdk_nvme_controller_process *proc) nvme_ctrlr_cleanup_process(struct spdk_nvme_ctrlr_process *proc)
{ {
struct nvme_request *req, *tmp_req; struct nvme_request *req, *tmp_req;
@ -859,7 +859,7 @@ nvme_ctrlr_cleanup_process(struct spdk_nvme_controller_process *proc)
void void
nvme_ctrlr_free_processes(struct spdk_nvme_ctrlr *ctrlr) nvme_ctrlr_free_processes(struct spdk_nvme_ctrlr *ctrlr)
{ {
struct spdk_nvme_controller_process *active_proc, *tmp; struct spdk_nvme_ctrlr_process *active_proc, *tmp;
/* Free all the processes' properties and make sure no pending admin IOs */ /* Free all the processes' properties and make sure no pending admin IOs */
TAILQ_FOREACH_SAFE(active_proc, &ctrlr->active_procs, tailq, tmp) { TAILQ_FOREACH_SAFE(active_proc, &ctrlr->active_procs, tailq, tmp) {
@ -880,7 +880,7 @@ nvme_ctrlr_free_processes(struct spdk_nvme_ctrlr *ctrlr)
static void static void
nvme_ctrlr_remove_inactive_proc(struct spdk_nvme_ctrlr *ctrlr) nvme_ctrlr_remove_inactive_proc(struct spdk_nvme_ctrlr *ctrlr)
{ {
struct spdk_nvme_controller_process *active_proc, *tmp; struct spdk_nvme_ctrlr_process *active_proc, *tmp;
TAILQ_FOREACH_SAFE(active_proc, &ctrlr->active_procs, tailq, tmp) { TAILQ_FOREACH_SAFE(active_proc, &ctrlr->active_procs, tailq, tmp) {
if ((kill(active_proc->pid, 0) == -1) && (errno == ESRCH)) { if ((kill(active_proc->pid, 0) == -1) && (errno == ESRCH)) {
@ -896,7 +896,7 @@ nvme_ctrlr_remove_inactive_proc(struct spdk_nvme_ctrlr *ctrlr)
void void
nvme_ctrlr_proc_get_ref(struct spdk_nvme_ctrlr *ctrlr) nvme_ctrlr_proc_get_ref(struct spdk_nvme_ctrlr *ctrlr)
{ {
struct spdk_nvme_controller_process *active_proc; struct spdk_nvme_ctrlr_process *active_proc;
pid_t pid = getpid(); pid_t pid = getpid();
pthread_mutex_lock(&ctrlr->ctrlr_lock); pthread_mutex_lock(&ctrlr->ctrlr_lock);
@ -916,7 +916,7 @@ nvme_ctrlr_proc_get_ref(struct spdk_nvme_ctrlr *ctrlr)
void void
nvme_ctrlr_proc_put_ref(struct spdk_nvme_ctrlr *ctrlr) nvme_ctrlr_proc_put_ref(struct spdk_nvme_ctrlr *ctrlr)
{ {
struct spdk_nvme_controller_process *active_proc; struct spdk_nvme_ctrlr_process *active_proc;
pid_t pid = getpid(); pid_t pid = getpid();
pthread_mutex_lock(&ctrlr->ctrlr_lock); pthread_mutex_lock(&ctrlr->ctrlr_lock);
@ -937,7 +937,7 @@ nvme_ctrlr_proc_put_ref(struct spdk_nvme_ctrlr *ctrlr)
int int
nvme_ctrlr_get_ref_count(struct spdk_nvme_ctrlr *ctrlr) nvme_ctrlr_get_ref_count(struct spdk_nvme_ctrlr *ctrlr)
{ {
struct spdk_nvme_controller_process *active_proc; struct spdk_nvme_ctrlr_process *active_proc;
int ref = 0; int ref = 0;
pthread_mutex_lock(&ctrlr->ctrlr_lock); pthread_mutex_lock(&ctrlr->ctrlr_lock);

View File

@ -297,7 +297,7 @@ enum nvme_ctrlr_state {
/* /*
* Used to track properties for all processes accessing the controller. * Used to track properties for all processes accessing the controller.
*/ */
struct spdk_nvme_controller_process { struct spdk_nvme_ctrlr_process {
/** Whether it is the primary process */ /** Whether it is the primary process */
bool is_primary; bool is_primary;
@ -307,7 +307,7 @@ struct spdk_nvme_controller_process {
/** Active admin requests to be completed */ /** Active admin requests to be completed */
STAILQ_HEAD(, nvme_request) active_reqs; STAILQ_HEAD(, nvme_request) active_reqs;
TAILQ_ENTRY(spdk_nvme_controller_process) tailq; TAILQ_ENTRY(spdk_nvme_ctrlr_process) tailq;
/** Per process PCI device handle */ /** Per process PCI device handle */
struct spdk_pci_device *devhandle; struct spdk_pci_device *devhandle;
@ -399,7 +399,7 @@ struct spdk_nvme_ctrlr {
uint64_t sleep_timeout_tsc; uint64_t sleep_timeout_tsc;
/** Track all the processes manage this controller */ /** Track all the processes manage this controller */
TAILQ_HEAD(, spdk_nvme_controller_process) active_procs; TAILQ_HEAD(, spdk_nvme_ctrlr_process) active_procs;
}; };
struct nvme_driver { struct nvme_driver {

View File

@ -685,7 +685,7 @@ nvme_pcie_qpair_insert_pending_admin_request(struct spdk_nvme_qpair *qpair,
{ {
struct spdk_nvme_ctrlr *ctrlr = qpair->ctrlr; struct spdk_nvme_ctrlr *ctrlr = qpair->ctrlr;
struct nvme_request *active_req = req; struct nvme_request *active_req = req;
struct spdk_nvme_controller_process *active_proc, *tmp; struct spdk_nvme_ctrlr_process *active_proc, *tmp;
bool pending_on_proc = false; bool pending_on_proc = false;
/* /*
@ -725,7 +725,7 @@ nvme_pcie_qpair_complete_pending_admin_request(struct spdk_nvme_qpair *qpair)
struct nvme_request *req, *tmp_req; struct nvme_request *req, *tmp_req;
bool proc_found = false; bool proc_found = false;
pid_t pid = getpid(); pid_t pid = getpid();
struct spdk_nvme_controller_process *proc; struct spdk_nvme_ctrlr_process *proc;
/* /*
* Check whether there is any pending admin request from * Check whether there is any pending admin request from