md_sp.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS__MD_SP_H
#define _SYS__MD_SP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define META_SP_DEBUG ("META_SP_DEBUG")
/* on-disk structures */
#define MD_SP_MAGIC (0x20000127)
/* number of sectors to reserve at the beginning of the volume */
#define MD_SP_START (0)
/* current watermark version number */
#define MD_SP_VERSION (1)
/* size of a watermark in sectors */
#define MD_SP_WMSIZE (1)
/* free watermark name */
#define MD_SP_FREEWMNAME "free"
/* local set name */
#define MD_SP_LOCALSETNAME ""
/* maximum length of a soft partition metadevice name. eg. dXXXX\0 */
#define MD_SP_MAX_DEVNAME_PLUS_1 (6)
/*
* The size of this structure is forced to be 512 bytes (ie a sector) by
* using a union. Note the MD_MAX_SETNAME_PLUS_1 is set in meta_basic.h
*/
#pragma pack(4)
#endif
typedef union mp_watermark {
struct {
char wm_mdname[MD_MAX_SETNAME_PLUS_1 +
MD_SP_MAX_DEVNAME_PLUS_1]; /* SP name */
} wm;
#pragma pack()
#endif
/* Watermark types */
typedef enum sp_ext_type {
/* ioctls */
#define MD_IOC_SPSTATUS (MDIOC_MISC|0)
#ifdef _KERNEL
/*
* parent and child save areas provide the mechanism for tracking
* I/O operations in the metadevice stack.
*/
/* soft partitioning parent save area */
typedef struct md_spps { /* soft partition parent save */
int ps_frags;
int ps_flags;
/*
* New structure members should be added here; fields added
* after ps_mx will not be zeroed during initialization.
*/
} md_spps_t;
/* parent save flags. */
#define MD_SPPS_ERROR 0x0001
#define MD_SPPS_DONTFREE 0x0002
#define MD_SPPS_DONE 0x0004
/* soft partitioning child save area */
typedef struct md_spcs {
/* Add new structure members HERE!! */
/* DO NOT add struture members here; cs_buf is dynamically sized */
} md_spcs_t;
{ \
else \
}
/* externals from sp.c */
extern int sp_build_incore(void *, int);
/* externals from sp_ioctl.c */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS__MD_SP_H */