iscsi: replace RTE_VERIFY() where possible
In files that don't otherwise use DPDK, switch to the standard C library assert(). Change-Id: I79756908ecf9a2e141b036321e42309db30b5e0f Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
c320f79aa6
commit
e2d622e0aa
@ -32,6 +32,7 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -46,8 +47,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <rte_debug.h>
|
|
||||||
|
|
||||||
#include "spdk/log.h"
|
#include "spdk/log.h"
|
||||||
#include "spdk/conf.h"
|
#include "spdk/conf.h"
|
||||||
#include "spdk/net.h"
|
#include "spdk/net.h"
|
||||||
@ -290,7 +289,7 @@ spdk_iscsi_init_grp_destroy_by_tag(int tag)
|
|||||||
void
|
void
|
||||||
spdk_iscsi_init_grp_register(struct spdk_iscsi_init_grp *ig)
|
spdk_iscsi_init_grp_register(struct spdk_iscsi_init_grp *ig)
|
||||||
{
|
{
|
||||||
RTE_VERIFY(ig != NULL);
|
assert(ig != NULL);
|
||||||
|
|
||||||
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
||||||
ig->state = GROUP_READY;
|
ig->state = GROUP_READY;
|
||||||
@ -343,7 +342,7 @@ spdk_initiator_group_unregister(struct spdk_iscsi_init_grp *ig)
|
|||||||
struct spdk_iscsi_init_grp *initiator_group;
|
struct spdk_iscsi_init_grp *initiator_group;
|
||||||
struct spdk_iscsi_init_grp *initiator_group_tmp;
|
struct spdk_iscsi_init_grp *initiator_group_tmp;
|
||||||
|
|
||||||
RTE_VERIFY(ig != NULL);
|
assert(ig != NULL);
|
||||||
|
|
||||||
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
||||||
TAILQ_FOREACH_SAFE(initiator_group, &g_spdk_iscsi.ig_head, tailq, initiator_group_tmp) {
|
TAILQ_FOREACH_SAFE(initiator_group, &g_spdk_iscsi.ig_head, tailq, initiator_group_tmp) {
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -47,8 +48,6 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <rte_debug.h>
|
|
||||||
|
|
||||||
#include "spdk/log.h"
|
#include "spdk/log.h"
|
||||||
#include "spdk/conf.h"
|
#include "spdk/conf.h"
|
||||||
#include "spdk/net.h"
|
#include "spdk/net.h"
|
||||||
@ -68,8 +67,8 @@ spdk_iscsi_portal_create(char *host, char *port, uint64_t cpumask)
|
|||||||
{
|
{
|
||||||
struct spdk_iscsi_portal *p = NULL;
|
struct spdk_iscsi_portal *p = NULL;
|
||||||
|
|
||||||
RTE_VERIFY(host != NULL);
|
assert(host != NULL);
|
||||||
RTE_VERIFY(port != NULL);
|
assert(port != NULL);
|
||||||
|
|
||||||
p = malloc(sizeof(*p));
|
p = malloc(sizeof(*p));
|
||||||
if (!p) {
|
if (!p) {
|
||||||
@ -88,7 +87,7 @@ spdk_iscsi_portal_create(char *host, char *port, uint64_t cpumask)
|
|||||||
void
|
void
|
||||||
spdk_iscsi_portal_destroy(struct spdk_iscsi_portal *p)
|
spdk_iscsi_portal_destroy(struct spdk_iscsi_portal *p)
|
||||||
{
|
{
|
||||||
RTE_VERIFY(p != NULL);
|
assert(p != NULL);
|
||||||
|
|
||||||
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "spdk_iscsi_portal_destroy\n");
|
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "spdk_iscsi_portal_destroy\n");
|
||||||
free(p->host);
|
free(p->host);
|
||||||
@ -280,7 +279,7 @@ spdk_iscsi_portal_grp_destroy(struct spdk_iscsi_portal_grp *pg)
|
|||||||
{
|
{
|
||||||
struct spdk_iscsi_portal *p;
|
struct spdk_iscsi_portal *p;
|
||||||
|
|
||||||
RTE_VERIFY(pg != NULL);
|
assert(pg != NULL);
|
||||||
|
|
||||||
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "spdk_iscsi_portal_grp_destroy\n");
|
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "spdk_iscsi_portal_grp_destroy\n");
|
||||||
while (!TAILQ_EMPTY(&pg->head)) {
|
while (!TAILQ_EMPTY(&pg->head)) {
|
||||||
@ -294,8 +293,8 @@ spdk_iscsi_portal_grp_destroy(struct spdk_iscsi_portal_grp *pg)
|
|||||||
static void
|
static void
|
||||||
spdk_iscsi_portal_grp_register(struct spdk_iscsi_portal_grp *pg)
|
spdk_iscsi_portal_grp_register(struct spdk_iscsi_portal_grp *pg)
|
||||||
{
|
{
|
||||||
RTE_VERIFY(pg != NULL);
|
assert(pg != NULL);
|
||||||
RTE_VERIFY(!TAILQ_EMPTY(&pg->head));
|
assert(!TAILQ_EMPTY(&pg->head));
|
||||||
|
|
||||||
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
||||||
pg->state = GROUP_READY;
|
pg->state = GROUP_READY;
|
||||||
@ -442,8 +441,8 @@ void
|
|||||||
spdk_iscsi_portal_grp_add_portal(struct spdk_iscsi_portal_grp *pg,
|
spdk_iscsi_portal_grp_add_portal(struct spdk_iscsi_portal_grp *pg,
|
||||||
struct spdk_iscsi_portal *p)
|
struct spdk_iscsi_portal *p)
|
||||||
{
|
{
|
||||||
RTE_VERIFY(pg != NULL);
|
assert(pg != NULL);
|
||||||
RTE_VERIFY(p != NULL);
|
assert(p != NULL);
|
||||||
|
|
||||||
p->group = pg;
|
p->group = pg;
|
||||||
TAILQ_INSERT_TAIL(&pg->head, p, tailq);
|
TAILQ_INSERT_TAIL(&pg->head, p, tailq);
|
||||||
@ -588,8 +587,8 @@ spdk_iscsi_portal_grp_unregister(struct spdk_iscsi_portal_grp *pg)
|
|||||||
struct spdk_iscsi_portal_grp *portal_group;
|
struct spdk_iscsi_portal_grp *portal_group;
|
||||||
struct spdk_iscsi_portal_grp *portal_group_tmp;
|
struct spdk_iscsi_portal_grp *portal_group_tmp;
|
||||||
|
|
||||||
RTE_VERIFY(pg != NULL);
|
assert(pg != NULL);
|
||||||
RTE_VERIFY(!TAILQ_EMPTY(&pg->head));
|
assert(!TAILQ_EMPTY(&pg->head));
|
||||||
|
|
||||||
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
||||||
TAILQ_FOREACH_SAFE(portal_group, &g_spdk_iscsi.pg_head, tailq, portal_group_tmp) {
|
TAILQ_FOREACH_SAFE(portal_group, &g_spdk_iscsi.pg_head, tailq, portal_group_tmp) {
|
||||||
|
Loading…
Reference in New Issue
Block a user