meta_db_balance.c revision 2fb876ae0cefcbd01f8d8490242aa4501caddbc3
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/Aenum md_ctlr_ops_t {
2N/Astruct md_ctlr_drv_t {
2N/A int drv_new_dbcnt;
2N/Astruct md_ctlr_ctl_t {
int dbcnt,
int indiskset,
int with_bus,
int errored,
char *cmp_name_1,
int not_found;
&cmp_name_2);
not_found = 0;
if (not_found)
(void) sdssc_convert_cluster_path(
&cmp_name_2);
if (not_found)
if (indiskset)
if (errored) {
if (indiskset) {
if (errored) {
if (errored) {
md_ctlr_ctl_t *c,
int minimum_replicas,
md_ctlr_drv_t *d;
int maxdb = 0;
if (c->ctl_drcnt == 0) {
assert(0);
if (maxdb == 0)
if (d->drv_dbcnt > 0) {
if (d->drv_dbcnt) {
d->drv_dbcnt = 0;
d->drv_dbcnt++;
c->ctl_dbcnt++;
maxdb++;
md_ctlr_ctl_t *c,
md_ctlr_drv_t *d;
int maxdb = 0;
if (c->ctl_drcnt == 0) {
assert(0);
if (maxdb == 0)
if (d->drv_dbcnt == 0)
d->drv_dbcnt--;
c->ctl_dbcnt--;
if (d->drv_dbcnt > 0) {
d->drv_dbcnt = 0;
maxdb--;
if (maxdb <= 0)
md_ctlr_ctl_t *c;
md_ctlr_drv_t *d;
if (d->drv_dbcnt == 0)
Free(d);
Free(c);
int with_bus,
md_drive_desc *d;
if (min_dbsize == 0) {
if (this_dbsize == 0)
md_ctlr_ctl_t *c,
int adding,
int *db_cnt,
int minimum_replicas
md_ctlr_drv_t *d;
int maxdb = 0;
if (c->ctl_drcnt == 0)
if (maxdb == 0) {
if (!adding)
if (adding) {
if (d->drv_new_dbcnt == 0)
if (adding) {
if (! partp)
(*db_cnt)++;
d->drv_new_dbcnt++;
(*db_cnt)--;
d->drv_new_dbcnt--;
if (adding) {
maxdb++;
maxdb--;
if (maxdb <= 0)
int min_reps
md_ctlr_ctl_t *c;
md_ctlr_drv_t *d;
int db_cnt;
int uctlrs = 0;
int total_cnt = 0;
if (c->ctl_drcnt > 0) {
uctlrs++;
if (c->ctl_drcnt == 0)
if (c->ctl_drcnt == 0)
return (total_cnt);
int *minimum_replicas,
int rctlrs = 0;
int uctlrs;
int ructlrs;
int octlrs;
int save_done;
int reps;
md_ctlr_ctl_t *c;
if (c->ctl_drcnt > 0) {
rctlrs++;
if (prevcnt == 0)
issame = 0;
goto cont;
for (n = drvcnt; n > 0; n--) {
*minimum_replicas = n;
cont:
* If Here: Try to put 2 replicas per controller/bus
* If that doesn't work put 1 replica per controller/bus
goto other;
drvcnt = ~0U;
uctlrs = 0;
if (c->ctl_drcnt > 0) {
uctlrs++;
goto other;
ructlrs = 0;
octlrs = 0;
save_done = 0;
if (c->ctl_drcnt == 0)
if (! save_done) {
&cmp_name_1);
octlrs++;
ructlrs++;
goto other;
for (n = drvcnt; n > 0; n--) {
*minimum_replicas = n;
for (n = MD_MINBALREP; n > 0; n--) {
*minimum_replicas = n;
int min_reps,
md_ctlr_ctl_t *c;
int err;
int multiple_reps = 0;
md_ctlr_drv_t *d;
if (c->ctl_drcnt == 0)
if (d->drv_dbcnt)
min_reps) {
if (err == 0)
if (err == 0)
int min_reps,
md_ctlr_ctl_t *c;
int err;
int multiple_reps = 0;
md_ctlr_drv_t *d;
if (c->ctl_drcnt == 0)
if (d->drv_dbcnt)
if (err == 0)
if (err == 0)
md_ctlr_ctl_t *c;
md_ctlr_drv_t *d;
return (TRUE);
== DRV_F_ERROR)
return (FALSE);
return (TRUE);
int min_reps;
int uctlrs = 0;
int retry = 0;
int rval = 0;
if (c->ctl_drcnt > 0)
uctlrs++;
if (rval) {
rval = 0;
if (! rval)
if (retry) {
rval = 0;
return (rval);