/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include "isns_server.h"
#include "isns_cache.h"
#include "isns_obj.h"
#include "isns_dsapi.h"
#include "isns_dseng.h"
#include "isns_msgq.h"
#include "isns_log.h"
#include "isns_scn.h"
#include "isns_esi.h"
/*
* extern variables
*/
extern const int NUM_OF_CHILD[MAX_OBJ_TYPE];
extern const int TYPE_OF_PARENT[MAX_OBJ_TYPE_FOR_SIZE];
int
)
{
return (target_init_data());
}
int
)
{
int ec = 0;
/* lock the cache */
(void) cache_lock_write();
scn_bitmap = NULL;
case OBJ_DD:
case OBJ_DDS:
break;
case OBJ_ENTITY:
ptype = OBJ_ENTITY;
if (ec == 0) {
}
break;
case OBJ_ISCSI:
case OBJ_PORTAL:
if (puid != 0 &&
} else {
}
if (ec == 0) {
}
/* register scn */
ec = scn_list_load(
uid,
}
break;
case OBJ_PG:
if (puid != 0 &&
} else {
}
break;
case OBJ_ASSOC_ISCSI:
if (puid != 0 &&
/* ignore adding member to default dd */
/* during loading objects from data store */
if (puid != ISNS_DEFAULT_DD_ID) {
}
} else {
}
break;
case OBJ_ASSOC_DD:
if (puid != 0 &&
/* ignore adding member to default dd-set */
/* and adding default dd to any dd-set */
/* during loading objects from data store */
if (puid != ISNS_DEFAULT_DD_SET_ID &&
}
} else {
}
break;
default:
ASSERT(0);
break;
}
if (ec == 0) {
}
if (ec == 0 &&
puid != 0 &&
NUM_OF_CHILD[ptype] > 0 &&
}
}
/* unlock the cache */
(void) cache_unlock_sync(0);
/* free the child buffer */
uid = 0;
while (uid < MAX_CHILD_TYPE) {
}
uid ++;
}
return (ec);
}
int
int op,
const isns_obj_t *obj
)
{
int ec = 0;
switch (op) {
case DATA_ADD:
break;
case DATA_UPDATE:
break;
case DATA_DELETE:
break;
case DATA_DELETE_ASSOC:
break;
case DATA_COMMIT:
ec = target_update_commit();
break;
case DATA_RETREAT:
ec = target_update_retreat();
break;
default:
break;
}
return (ec);
}