Files
mars-nwe/include/nwnss/include/mal.h

121 lines
4.1 KiB
C

/****************************************************************************
|
| (C) Copyright 1995 - 2000 Novell, Inc.
| All Rights Reserved.
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of version 2 of the GNU General Public
| License as published by the Free Software Foundation.
|
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU General Public License
| along with this program; if not, contact Novell, Inc.
|
| To contact Novell about this file by physical or electronic mail,
| you may find current contact information at www.novell.com
|
|***************************************************************************
|
| Novell Storage Services (NSS) support module
|
|---------------------------------------------------------------------------
|
| $Author: vandana $
| $Date: 2007-05-04 03:01:42 +0530 (Fri, 04 May 2007) $
|
| $RCSfile$
| $Revision: 1971 $
|
|---------------------------------------------------------------------------
| This module is used to:
|
|
|
| WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
|
| This header file should ONLY be used for NSS internal development.
| This includes Semantic Agents (SA) and Loadable Storage Services (LSS).
| Any other use may cause conflicts which NSS will NOT fix.
+-------------------------------------------------------------------------*/
#ifndef _MAL_H_
#define _MAL_H_
#ifdef __cplusplus
extern "C" {
#endif
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*- MAL basic defines
|
| These are basic defines to determine the size of common items
|
+-------------------------------------------------------------------------*/
#define MAL_ONEKBYTES 1024
#define MAL_ONEMEG 0x00100000
#define MAL_BLKSHFT512 9
#define MAL_BLKSHFT4K 12
#define MAL_BLKSHFT64K 16
#define MAL_BUFSZ512 (1 << MAL_BLKSHFT512)
#define MAL_BUFSZ4K (1 << MAL_BLKSHFT4K)
#define MAL_BUFSZ64K (1 << MAL_BLKSHFT64K)
#define MAL_DEFAULTBLKSIZE 4096
#define MAL_STDUNITSIZE 512
#define MAL_UNITSPER1MEG 2048
#define MAL_BLKSPER1MEG 256
#define MAL_UNITSPERBLK 8
#define POOL_MAXNAME 64
#define MAL_MAXNAME 64 /*- max. size of a pool name -*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*- Deposit Message Type Defined
|
|
+-------------------------------------------------------------------------*/
typedef struct Deposit_s
{
struct block_device *dp_dev; /* Linux block device structure */
LONG unitsize; /*- smallest IO unit size in bytes -*/
QUAD sizeinunits; /*- number of units for this storage deposit -*/
LONG sizeinmeg; /*- number of meg for this storage deposit -*/
GUID_t guid; /*- GUID (128 bits) when storage was created -*/
void *dp_inode; /* pointer to a root inode on the pool */
unicode_t name[MAL_MAXNAME];
unicode_t snapname[MAL_MAXNAME];
} Deposit_s;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
extern LONG MAL_RemoveDeposit (struct block_device *dev);
extern LONG MAL_ForwardDepositToConsumer(struct block_device *dev, LONG unitSize, char *poolName, LONG flags, char *snapname, void *inode);
#define ZLSS_DEV_FLAG_SHARED 0x00000001
#define ZLSS_DEV_FLAG_BARRIER 0x00000002
#define ZLSS_DEV_FLAG_SNAPSHOT 0x00000004
#define ZLSS_DEV_FLAG_NEW 0x00000008
extern LONG MAL_CreateDeposit (struct block_device *dev, LONG unitSize, char *poolName);
extern STATUS MAL_GetPoolNameFromDevice (struct block_device *dev, char *poolName, NINT poolNameSize);
extern STATUS ZLSS_GetPoolDev(unicode_t *uniName, struct block_device **dev);
extern STATUS ZLSS_SetPoolSize(struct block_device *dev, QUAD newSize);
extern STATUS ZLSS_SetPoolShared(struct block_device *dev, BOOL sharedstate);
#ifdef __cplusplus
}
#endif
#endif /* _MAL_H_ */