1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _META_SET_COM_H 28 #define _META_SET_COM_H 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 #include <meta.h> 33 #include <ctype.h> 34 #include <sys/lvm/md_convert.h> 35 36 #ifdef __cplusplus 37 extern "C" { 38 #endif 39 40 #define RB_PREEMPT if (md_got_sig()) goto rollback 41 #ifdef DEBUG 42 #define RB_TEST(tstpt, tag, ep) if (rb_test(tstpt, tag, (ep)) < 0) \ 43 goto rollback; 44 #else /* !DEBUG */ 45 #define RB_TEST(tstpt, tag, ep) 46 #endif /* DEBUG */ 47 48 /* meta_setup.c */ 49 extern int procsigs(int block, sigset_t *oldsigs, md_error_t *ep); 50 51 #ifdef DEBUG 52 extern int rb_test(int rbt_sel_tpt, char *rbt_sel_tag, md_error_t *ep); 53 #endif /* DEBUG */ 54 55 /* 56 * Flag values used by the nodehasset() function. 57 */ 58 #define NHS_N_EQ 0x00000001 /* name == */ 59 #define NHS_NS_EQ 0x00000002 /* name, setno == */ 60 #define NHS_NST_EQ 0x00000004 /* name, setno, TS == */ 61 #define NHS_NSTG_EQ 0x00000008 /* name, setno, TS, genid == */ 62 #define NHS_NST_EQ_G_GT 0x00000010 /* name, setno, TS ==, genid > */ 63 64 /* 65 * Node, set, and mediator names can be any printable characters 66 * (isprint()) except for the characters in the #define that follows. 67 */ 68 #define INVALID_IN_NAMES " *?/" 69 70 /* meta_set_prv.c */ 71 extern int checkdrive_onnode(mdsetname_t *sp, mddrivename_t *dnp, 72 char *node, md_error_t *ep); 73 extern side_t getnodeside(char *node, md_set_desc *sd); 74 extern int halt_set(mdsetname_t *sp, md_error_t *ep); 75 extern md_drive_desc *metadrivedesc_append(md_drive_desc **dd, 76 mddrivename_t *dnp, int dbcnt, int dbsize, 77 md_timeval32_t timestamp, ulong_t genid, 78 uint_t flags); 79 extern int nodehasset(mdsetname_t *sp, char *node, 80 uint_t match_flag, md_error_t *ep); 81 extern int nodesuniq(mdsetname_t *sp, int cnt, char **strings, 82 md_error_t *ep); 83 extern int own_set(mdsetname_t *sp, char **owner_of_set, 84 int forceflg, md_error_t *ep); 85 extern void resync_genid(mdsetname_t *sp, md_set_desc *sd, 86 ulong_t max_genid, int node_c, char **node_v); 87 extern int setup_db_bydd(mdsetname_t *sp, md_drive_desc *dd, 88 int force, md_error_t *ep); 89 extern int snarf_set(mdsetname_t *sp, bool_t stale_bool, 90 md_error_t *ep); 91 92 #ifdef __cplusplus 93 } 94 #endif 95 96 #endif /* _META_SET_COM_H */ 97