vhost: removed spdk_vhost_dev_task_ref/unref

Removed these functions in preperation to removing task.h/task.c.

Change-Id: I84b3c81505c0b8a7d08e2ca803aada1d20bc518e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/366718
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-06-21 12:11:41 +02:00 committed by Jim Harris
parent b93a37a8fb
commit 475d400394
3 changed files with 6 additions and 19 deletions

View File

@ -41,6 +41,7 @@
#include "spdk/env.h"
#include "spdk/queue.h"
#include "spdk/vhost.h"
#include "vhost_internal.h"
#include "task.h"
static struct rte_mempool *g_task_pool;
@ -56,7 +57,8 @@ spdk_vhost_task_free_cb(struct spdk_scsi_task *scsi_task)
{
struct spdk_vhost_task *task = container_of(scsi_task, struct spdk_vhost_task, scsi);
spdk_vhost_dev_task_unref((struct spdk_vhost_dev *) task->svdev);
assert(((struct spdk_vhost_dev *) task->svdev)->task_cnt > 0);
((struct spdk_vhost_dev *) task->svdev)->task_cnt--;
rte_mempool_put(g_task_pool, task);
}
@ -74,7 +76,9 @@ spdk_vhost_task_get(struct spdk_vhost_scsi_dev *vdev, spdk_scsi_task_cpl cpl_fn)
memset(task, 0, sizeof(*task));
task->svdev = vdev;
spdk_vhost_dev_task_ref((struct spdk_vhost_dev *) task->svdev);
assert(((struct spdk_vhost_dev *) task->svdev)->task_cnt < INT_MAX);
((struct spdk_vhost_dev *) task->svdev)->task_cnt++;
spdk_scsi_task_construct(&task->scsi,
cpl_fn,
spdk_vhost_task_free_cb,

View File

@ -67,9 +67,6 @@ void spdk_vhost_task_put(struct spdk_vhost_task *task);
struct spdk_vhost_task *spdk_vhost_task_get(struct spdk_vhost_scsi_dev *vdev,
spdk_scsi_task_cpl cpl_fn);
void spdk_vhost_dev_task_ref(struct spdk_vhost_dev *vdev);
void spdk_vhost_dev_task_unref(struct spdk_vhost_dev *vdev);
void spdk_vhost_task_cpl(struct spdk_scsi_task *scsi_task);
void spdk_vhost_task_mgmt_cpl(struct spdk_scsi_task *scsi_task);

View File

@ -222,20 +222,6 @@ spdk_vhost_dev_mem_unregister(struct spdk_vhost_dev *vdev)
}
}
void
spdk_vhost_dev_task_ref(struct spdk_vhost_dev *vdev)
{
assert(vdev->task_cnt < INT_MAX);
vdev->task_cnt++;
}
void
spdk_vhost_dev_task_unref(struct spdk_vhost_dev *vdev)
{
assert(vdev->task_cnt > 0);
vdev->task_cnt--;
}
static void
spdk_vhost_free_reactor(uint32_t lcore)
{