fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _SD_SAFESTORE_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _SD_SAFESTORE_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsc_thread.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef DS_DDICT
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsctl/contract.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsctl/nsctl.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(_KERNEL) || defined(_KMEMUSER)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * token for a volume directory stream
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_vdir_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte intptr_t opaque[6];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ss_vdir_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * token for a cache entry directory stream
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_cdir_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte intptr_t opaque[6];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}ss_cdir_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * token for a volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_vol_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte intptr_t opaque;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}ss_vol_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * token for cache entry block and dirty bits
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct s_resource_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte intptr_t opaque;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ss_resource_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * token for a list of cache safestore resources
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_resourcelist_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte intptr_t opaque;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}ss_resourcelist_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cache entry directory stream type specifier
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ck_type specifies all cache entries, cache entries for volume, node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ck_vol volume token if ck_type is CDIR_VOL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ck_node node id if ck_type is node CDIR_NODE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_cdirkey_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ck_type; /* discriminator: see type defines below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ss_vol_t *ck_vol;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ck_node;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } cdk_u;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ss_cdirkey_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* centry directory stream types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CDIR_ALL 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CDIR_VOL 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CDIR_NODE 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* BEGIN CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * exported cache entry info
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sc_cd the cache descriptor, associates this entry with a volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sc_fpos file position in cache blocks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sc_dirty dirty bits, one for each fba in the cache block
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sc_flag flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sc_res safestore resource token for this cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_voldata_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_centry_info_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sc_cd; /* Cache descriptor */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_off_t sc_fpos; /* File position */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sc_dirty; /* Dirty mask */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sc_flag; /* CC_PINNABLE | CC_PINNED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ss_resource_t *sc_res; /* token for this centry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ss_centry_info_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* END CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * volume directory stream type specifier
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field vk_type specifies all volume entries, entries for volume, node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field vk_vol volume token if vk_type is VDIR_VOL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field vk_node node id if vk_type is node VDIR_NODE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_vdirkey_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t vk_type; /* discriminator: see type defines below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ss_vol_t *vk_vol;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t vk_node;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } cdk_u;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ss_vdirkey_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* volume directory stream types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define VDIR_ALL 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define VDIR_VOL 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define VDIR_NODE 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * exported volume entry info
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sv_cd the cache descriptor
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sv_vol the safestore volume token for this volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sv_pinned volume has pinned blocks, holds node id
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sv_attached node which has attached this volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sv_volname path name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sv_devidsz length of device id, the sv_devid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field sv_devid unique id for physical, i.e. non-volume-managed volumes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_voldata_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sv_cd; /* NOTE may need dual node map info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ss_vol_t *sv_vol; /* volume token for this vol entry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sv_pinned; /* Device has failed/pinned blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sv_attached; /* Node which has device attached */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char sv_volname[NSC_MAXPATH]; /* Filename */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sv_devidsz; /* unique dev id length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t sv_devid[NSC_MAXPATH]; /* wwn id - physical devs only */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ss_voldata_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* safestore media types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**%
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * safestore in RAM, useful but not very safe
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_M_RAM 0x00000001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**%
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * safestore in NVRAM on a single node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_M_NV_SINGLENODE 0x00000002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**%
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * safestore in NVRAM on a dual node system. all data is store remotely.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_M_NV_DUALNODE_NOMIRROR 0x00000004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**%
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * safestore in NVRAM on a dual node system. data is mirrored on both nodes.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_M_NV_DUALNODE_MIRROR 0x00000008
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* safestore data and metadata transport types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**%
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * data is transferred using STE connection
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_T_STE 0x00010000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**%
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * data is transferred using RPC
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_T_RPC 0x00020000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**%
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * no transport -- (single node)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_T_NONE 0x08000000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_MEDIA_MASK 0x0000ffff
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_TRANSPORT_MASK 0xffff0000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _SD_NO_NET 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _SD_NO_NETADDR 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _SD_NO_HOST -1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _SD_NO_CD -1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* config settings */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_UNCONFIGURED 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_INITTED 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_CONFIGURED 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* error return for safestore ops */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_ERR -1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_OK 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_EOF 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* config flag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_GENPATTERN 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * convenience macros. should they be implemented in ss_ctl()?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* is safestore on a single node? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SAFESTORE_LOCAL(ssp) ((ssp) && (ssp->ssop_type & SS_T_NONE))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* is safestore really safe or is it just RAM? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SAFESTORE_SAFE(ssp) ((ssp) && !(ssp->ssop_type & SS_M_RAM))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* is recovery needed with this safestore module? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SAFESTORE_RECOVERY(ssp) ((ssp) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (ssp->ssop_flags & SS_RECOVERY_NEEDED))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * configuration structure provided by safestore client
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssc_configured set by safestore module to indicate config completed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssc_ss_psize safestore internal page size, set by ss module
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssc_client_psize callers page size
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssc_wsize cache size in bytes: amount of data that can be safestored
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssc_maxfiles maximum number of volumes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssc_pattern initialization pattern if any
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssc_flag use ssc_pattern if this is SS_GENPATTERN
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ss_common_config_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssc_configured;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssc_ss_psize; /* safestore internal page size */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssc_client_psize; /* client page size */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssc_wsize; /* Write cache size in bytes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ssc_maxfiles; /* max files */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssc_pattern; /* initialization pattern */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssc_flag;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ss_common_config_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* BEGIN CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**$
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * safestore operations structure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_name description of this module.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_type media type OR'd with transport type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_flags SS_RECOVERY_NEEDED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_configure configure the module
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_deconfigure deconfigure the module
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_getvdir get a volume directory stream according to type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_getvdirent get next entry in a volume directory stream
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_getvol get the data for a volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_setvol set the data for a volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_getcdir get cache entry directory stream according to type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_getcdirent get next cache entry in stream
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_allocresource allocate safestore resources from free list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_deallocresource deallocate, i.e. free, a safestore resource
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_getresource get next resource in resource list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_getcentry get metadata for a cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_setcentry set the metadata for a cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_read_cblock read the actual data for a cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_write_cblock write the data for a cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @field ssop_ctl module entry point for everything else, e.g. stats
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_vdirkey_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_voldata_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_cdirkey_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resourcelist_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resource_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_centry_info_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct safestore_ops_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char *ssop_name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssop_type; /* media type OR'd with transport type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ssop_flags; /* recovery needed, etc */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_configure)(ss_common_config_t *, spcs_s_info_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_deconfigure)(int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_getvdir)(const ss_vdirkey_t *, ss_vdir_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_getvdirent)(const ss_vdir_t *, ss_voldata_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_getvol)(ss_voldata_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_setvol)(const ss_voldata_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_getcdir)(const ss_cdirkey_t *, ss_cdir_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_getcdirent)(ss_cdir_t *, ss_centry_info_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_allocresource)(int, int *, ss_resourcelist_t **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void (* ssop_deallocresource)(ss_resource_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_getresource)(ss_resourcelist_t **, ss_resource_t **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_getcentry)(ss_centry_info_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_setcentry)(const ss_centry_info_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_read_cblock)(const ss_resource_t *, void *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_write_cblock)(const ss_resource_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte const void *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (* ssop_ctl)(uint_t, uintptr_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} safestore_ops_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* END CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ssop_flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * no writes permitted when this bit is set in ssop flags field
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (single node nvram mostly)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SS_RECOVERY_NEEDED 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* safestore operations */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* BEGIN CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_CONFIGURE() configure a safestore module
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param cfg a pointer to ss_common_config_t, initialized by caller
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param kstatus unistat spcs_s_info_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK successful, errno otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_common_config_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_CONFIGURE(ssp, cfg, kstatus) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_configure(cfg, kstatus))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_DECONFIGURE deconfigure a safestore module
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param dirty integer flag, if set it signifies there is pinned data
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success, SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_DECONFIGURE(ssp, dirty) ((ssp)->ssop_deconfigure(dirty))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* volume directory functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_GETVDIR get a volume directory stream according to type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param key pointer to ss_vdirkey_t initialized by caller
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param vdir pointer to ss_vdir_t owned by caller
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success, SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_vdirkey_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_vdir_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_GETVDIR(ssp, key, vdir) ((ssp)->ssop_getvdir(key, vdir))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_GETVDIRENT get next volume in a volume directory stream
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param vdir pointer to a properly initialized ss_vdir_t obtained
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * from a successsful SSOP_GETVDIR() call
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param voldata pointer to ss_voldata_t owned by caller, filled
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in with valid data on successful return
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_EOF if no more elements in stream,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_vdir_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_voldata_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETVDIR()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_GETVDIRENT(ssp, vdir, voldata) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_getvdirent(vdir, voldata))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* volume accessor functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_GETVOL get the volume data for a particular volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param voldata pointer to ss_voldata_t owned by caller, field sv_vol
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * must be initialized with a valid ss_vol_t, normally
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * obtained from a successful SSOP_GETVDIRENT() call.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the rest of the structure is filled with valid volume data
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * on successful return
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK if data read successfully
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_voldata_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_vol_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETVDIRENT()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_GETVOL(ssp, voldata) ((ssp)->ssop_getvol(voldata))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_SETVOL set the volume data for a particular volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param voldata pointer to ss_voldata_t owned by caller, field sv_vol
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * must be initialized with a valid ss_vol_t, obtained from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * a successful SSOP_GETVDIRENT() call. the remaining
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields of the structure are written to safestore
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK if data saved successfully
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_voldata_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_vol_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETVDIRENT()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_SETVOL(ssp, voldata) ((ssp)->ssop_setvol(voldata))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* centry directory functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_GETCDIR get a cache entry stream accroding to type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param key pointer to a ss_cdirkey_t initialized by caller
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param cdir pointer to ss_cdir_t owned by caller
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success, SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_cdirkey_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @ see ss_cdir_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_GETCDIR(ssp, key, cdir) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_getcdir(key, cdir))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_GETCDIRENT get next cache entry in a cache entry stream
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param cdir pointer to valid ss_cdirkey_t obtained from a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * successsful SSOP_GETCDIR call
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param voldata pointer to ss_voldata_t owned by caller, filled
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in with valid data on successful return
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_EOF if no more elements in stream,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_vdirkey_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_voldata_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETVDIR()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_GETCDIRENT(ssp, cdir, centry) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_getcdirent(cdir, centry))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* cache entry alloc functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_ALLOCRESOURCE allocate safestore resources from the free list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param count number of resources, that is data blocks, needed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param stall integer pointer to stall count, no blocks available. used only
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * when _sd_wblk_sync === 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param reslist pointer to pointer to ss_resourcelist_t. points to valid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * resource list on successful return
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resourcelist_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_DEALLOCRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_ALLOCRESOURCE(ssp, count, stall, reslist) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_allocresource(count, stall, reslist))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_DEALLOCRESOURCE deallocate, i.e. release, a single safestore resource
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param res pointer to ss_resource_t to be released
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return void
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resource_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_ALLOCRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_DEALLOCRESOURCE(ssp, res) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_deallocresource(res))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_GETRESOURCE get the next safestore resource in a list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param reslist pointer to pointer to ss_resourcelist_t obtained from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * a successful call to SSOP_ALLOCRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param res pointer to pointer to ss_resource_t. points to a valid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * on successful resource
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_EOF if no more resources in list
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resourcelist_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resource_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_ALLOCRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_DEALLOCRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_GETRESOURCE(ssp, reslist, res) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_getresource(reslist, res))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* centry accessor functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_GETCENTRY read cache entry metadata for a particular cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param centry_info pointer to ss_centry_info_t owned by caller.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * field sc_res must point to a valid ss_resource_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * obtained from a successful call to SSOP_GETRESOURCE().
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the rest of the structure is filled with valid
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * metadata on successful return
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK if data was read successfully
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_centry_info_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resource_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_GETCENTRY(ssp, centry_info) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_getcentry(centry_info))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_SETCENTRY write cache entry metadata for a particular cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param centry_info pointer to ss_centry_info_t owned by caller.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * field sc_res must point to a valid ss_resource_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * obtained from a successful call to SSOP_GETRESOURCE().
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the remaining fields of the structured are written
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to safestore.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK if data was written successfully
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_centry_info_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resource_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_SETCENTRY(ssp, centry_info) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_setcentry(centry_info))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* cache data block read/write and ctl */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_READ_CBLOCK read cache data for a particular cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param resource pointer to ss_resource_t obtained from a successful
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * call to SSOP_GETRESOURCE().
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param buf buffer to hold the data
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param nbyte number of bytes to read
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param srcoffset byte location from beginning of the cache block
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * represented by resource to read the data from
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK if data was read successfully
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resource_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_READ_CBLOCK(ssp, resource, buf, nbyte, srcoffset) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_read_cblock(resource, buf, nbyte, srcoffset))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_WRITE_CBLOCK write cache data for a particular cache entry
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param ssp a safestore_ops_t pointer obtained from sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param resource pointer to ss_resource_t obtained from a successful
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * call to SSOP_GETRESOURCE().
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param buf buffer to hold the data
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param nbyte number of bytes to write
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param destoffset byte location from beginning the cache block
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * represented by resource to write the data to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK if data was read successfully
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SS_ERR otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see safestore_ops_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see sst_open()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see ss_resource_t{}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @see SSOP_GETRESOURCE()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_WRITE_CBLOCK(ssp, resource, buf, nbyte, destoffset) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ssp)->ssop_write_cblock(resource, buf, nbyte, destoffset))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**#
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSOP_CTL perform a safestore control function
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param cmd integer specifying the command to execute, e.g. SSIOC_STATS.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * some commands may be specific to a safestore module type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param arg a uintptr_t that has additional information that is
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * needed by the safestore module to perform the command. it
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * may be an int or a pionter to a module specifc structure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return SS_OK success
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * errno otherwise
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSOP_CTL(ssp, cmd, arg) ((ssp)->ssop_ctl(cmd, arg))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* END CSTYLED */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* general control definitions supported by safestore modules */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSCTL(x) (('S'<< 16)|('S'<< 8)|(x))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSIOC_STATS SSCTL(1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SSIOC_SETFLAG SSCTL(2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* structure definitions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ssioc_stats_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int wq_inq; /* write queue count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ssioc_stats_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void sst_init();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void sst_register_mod(safestore_ops_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void sst_unregister_mod(safestore_ops_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern safestore_ops_t *sst_open(uint_t, ...);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int sst_close(safestore_ops_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern safestore_ops_t *sdbc_safestore;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int _sd_centry_shift;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _KERNEL */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SD_SAFESTORE_H */