meta_db.c revision bf85a12b7c81d0745d5a8aff65baeff50006cde9
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * CDDL HEADER START
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * The contents of this file are subject to the terms of the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Common Development and Distribution License (the "License").
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * You may not use this file except in compliance with the License.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * See the License for the specific language governing permissions
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * and limitations under the License.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * When distributing Covered Code, include this CDDL HEADER in each
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * If applicable, add the following below this CDDL HEADER, with the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * fields enclosed by brackets "[]" replaced with your own identifying
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * information: Portions Copyright [yyyy] [name of copyright owner]
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * CDDL HEADER END
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Use is subject to license terms.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Just in case we're not in a build environment, make sure that
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * TEXT_DOMAIN gets set to something.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Metadevice database interfaces.
char *svmd_kill_val;
struct mddb_config *c,
char *devid_str;
return (NULL);
goto out;
goto out;
goto out;
goto out;
goto out;
out:
return (diskname);
(void) memset(&c, 0, sizeof (c));
return (c.c_timestamp);
int fd,
int dbsize,
int consecutive;
char *buffer;
int iosize;
int mn_set = 0;
int cnt;
if (mn_set)
int fd,
int len;
goto out;
goto out;
goto out;
goto out;
goto out;
out:
int rval = 0;
int in_miniroot = 0;
goto error;
errno = 0;
errno = 0;
goto out;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
char *devidp;
(i < sizeof (r->r_driver_name))); i++) {
goto error;
goto error;
goto error;
goto error;
if (! in_miniroot) {
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
rval = 0;
goto out;
out:
return (rval);
rep_sblk = 0;
if (meta_check_overlap(
int rval = 0;
return (rval);
int set_locked,
int force,
int rval = 0;
if (! set_locked) {
while (nd) {
mynode()) != 0) {
for (i = 0; i < MD_MAXSIDES; i++) {
mynode()) != 0)
while (nd) {
for (i = 0; i < MD_MAXSIDES; i++) {
if (! set_locked) {
while (nd) {
if (force &&
ep)) {
for (i = 0; i < MD_MAXSIDES; i++) {
if (force &&
ep)) {
return (rval);
int bcast,
int done;
int rval = 0;
if (done == 0)
int send_rval;
sizeof (md_mn_msg_meta_db_newside_t),
if (send_rval != 0) {
if (resultp)
(void) memset(&c, 0, sizeof (c));
sizeof (c.c_setname));
return (rval);
int send_rval;
if (send_rval != 0) {
if (resultp)
(void) memset(&c, 0, sizeof (c));
goto out;
goto out;
goto out;
goto out;
goto out;
out:
if (tbuf)
if (buf)
return (ret);
* patch md.conf file with mddb locations
if (patch)
rval = 0;
goto out;
ep) != 0)
goto out;
rval = 0;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
rval = 0;
out:
return (rval);
int dbcnt,
int dbsize,
char *sysfilename,
struct mddb_config c;
md_drive_desc *p;
int fd;
int replicacount = 0;
int start_svmdaemons = 0;
int rval = 0;
int flags;
(void) memset(&c, 0, sizeof (c));
c.c_id = 0;
if (c.c_dbcnt == 0)
while (nlp) {
ep)) {
if (c.c_dbcnt != 0) {
firstmddb = 0;
for (i = 0; i < dbcnt; i++) {
goto out;
int send_rval;
sizeof (md_mn_msg_meta_db_attach_t),
if (send_rval != 0) {
goto out;
if (resultp)
for (i = 0; i < dbcnt; i++) {
(void) memset(&c, 0, sizeof (c));
FALSE) {
goto out;
goto out;
NULL) != 0) {
goto out;
goto out;
if (firstmddb) {
out:
if (rval == 0)
return (rval);
if (rval == 0)
&status)) {
if (rval == 0)
return (rval);
int list_length = 0;
list_length++;
return (list_length);
int index = 0;
return (index);
index++;
char *sysfilename,
struct mddb_config c;
md_drive_desc *p;
int replicacount;
int replica_delete_count;
int nr_replica_slices;
int stop_svmdaemons = 0;
int rval = 0;
int index;
int valid_replicas_nottodelete = 0;
int invalid_replicas_nottodelete = 0;
int invalid_replicas_todelete = 0;
int errored = 0;
int *tag_array;
int flags;
(void) memset(&c, 0, sizeof (c));
c.c_id = 0;
replica_delete_count = 0;
for (i = 0; i < replicacount; i++) {
char *devname;
int found = 0;
c.c_id = i;
index = 0;
int send_rval;
sizeof (md_mn_msg_meta_db_detach_t),
if (send_rval != 0) {
goto out;
if (resultp)
while (i < c.c_dbcnt) {
char *devname;
c.c_id = i;
goto out;
!= NULL) {
goto out;
p->dd_dbcnt = 0;
p->dd_dbsize = 0;
out:
for (i = 0; i < DAEMON_COUNT; i++) {
if (rval == 0)
return (rval);
if (rval == 0)
if (rval == 0)
return (rval);
static md_replica_t *
int flags,
struct mddb_config *c,
char *devname;
char *devid_str;
return (NULL);
return (NULL);
return (NULL);
return (NULL);
return (NULL);
return (NULL);
if (c->c_dbend != 0)
return (rp);
int flags,
int count = 0;
struct mddb_config c;
char *devid;
(void) memset(&c, 0, sizeof (c));
c.c_id = i;
goto out;
goto out;
goto out;
goto out;
if (c.c_dbcnt == 0)
goto out;
++count;
} while (++i < c.c_dbcnt);
return (count);
out:
/* Updates backup of configuration file (aka mddb.cf) */
/* Updates system configuration file (aka md.conf) */
* setup_db_locations - parse the mddb.cf file and
char *buff;
uint_t i;
int rval = 0;
char *devidp;
int checksum;
/* do mddb.cf file */
(void) memset(&c, 0, sizeof (c));
buff += i;
for (i = 0; i < devid_size; i++) {
c.c_id = 0;
0, NULL));
return (rval);
md_replica_t *r;
return (nblks);
int options,
int cnt = 0;
goto out;
goto out;
++cnt;
out:
return (cnt);