trans_ioctl.c revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahltrans_getun(minor_t mnum, md_error_t *mde, int flags, IOLOCK *lock)
23b5c241225a8ade2b6b9f06ebb891ee459e3b02tomee if ((setno >= md_nsets) || (MD_MIN2UNIT(mnum) >= md_nunits)) {
return (NULL);
return (NULL);
return (NULL);
return (un);
#ifdef DEBUG
return (EFAULT);
return (EFAULT);
int test;
return (EINVAL);
goto errout;
goto errout;
goto errout;
goto errout;
goto errout;
goto errout;
goto errout;
goto errout;
goto errout;
bp = 0;
if (bp) {
if (test)
return (EINVAL);
static page_t *
return (NULL);
return (NULL);
return (pp);
int test;
return (EINVAL);
goto errout;
goto errout;
goto errout;
pp = 0;
goto errout;
goto errout;
pp = 0;
if (pp)
if (test)
return (EINVAL);
struct tothread {
int test;
int error;
int exits;
int step;
static int allocatorvalue;
static int okdestructoralloc;
int exits;
okdestructoralloc = 0;
if (value) {
trans_test_allocator(void)
int *value;
return ((void *)value);
goto errout;
goto errout;
for (i = 0; i < NKEYS; ++i)
goto errout;
thread_exit();
thread_exit();
int test;
int error;
for (i = 0; i < NKEYS; ++i)
error = 0;
for (i = 0; i < NKEYS; ++i) {
goto errout;
if (keys[i]) {
goto errout;
if (keys[i]) {
goto errout;
goto errout;
goto errout;
goto errout;
error = 0;
for (i = 0; i < NKEYS; ++i)
for (i = 0; i < NKEYS; ++i) {
if (keys[i] == 0) {
goto errout;
goto errout;
for (i = 0; i < NKEYS; ++i)
error = 0;
goto errout;
goto errout;
goto errout;
goto errout;
error = 0;
for (i = 0; i < NKEYS; ++i) {
goto errout;
goto errout;
for (i = 0; i < NKEYS; ++i)
error = 0;
for (i = 0; i < NKEYS; ++i)
for (i = 0; i < NTSDTHREADS; ++i)
for (i = 0; i < NTSDTHREADS; ++i)
for (i = 0; i < NTSDTHREADS; ++i)
for (i = 0; i < NTSDTHREADS; ++i)
for (i = 0; i < NKEYS; ++i)
for (i = 0; i < NTSDTHREADS; ++i) {
if (!error)
error = 0;
for (i = 0; i < NKEYS; ++i)
for (i = 0; i < NKEYS; ++i) {
allocatorvalue = i;
goto errout;
for (i = 0; i < NKEYS; ++i) {
allocatorvalue = i;
goto errout;
for (i = 0; i < NKEYS; ++i) {
allocatorvalue = i;
okdestructoralloc = 0;
if (okdestructoralloc == 0) {
goto errout;
for (i = 0; i < NKEYS; ++i)
return (error);
} mte_state;
typedef struct mt_error {
} mt_error_t;
static mt_error_t *
return (errp);
static mt_error_t *
return (errp);
int rv = 0;
case mte_count_down:
target))) {
case mte_suspend:
case mte_watch_block:
return (rv);
int rv = 0;
int trv = 0;
return (rv);
int rv = 0;
return (EINVAL);
return (rv);
int rv = 0;
return (EINVAL);
return (rv);
return (EINVAL);
return (EINVAL);
return (EINVAL);
return (EFAULT);
return (EFAULT);
log:
goto master;
return (EFAULT);
ldev,
mdev;
struct mdc_unit *c;
int error;
return (EACCES);
return (error);
return (EFAULT);
mode))
return (EFAULT);
int ndev;
return (ENODEV);
return (EFAULT);
return (ENODEV);
return (EFAULT);
int error;
if (error == 0)
return (error);
return (ENXIO);
int cmd,
int mode,
void *d = NULL;
int err = 0;
return (EINVAL);
switch (cmd) {
case MD_IOCGET:
return (EACCES);
return (ENOMEM);
case MD_IOCGET_LOG:
return (EACCES);
return (ENOMEM);
case MD_IOCRESET:
md_i_reset_t *p;
return (EACCES);
return (ENOMEM);
case MD_IOCGROW:
return (EACCES);
return (ENOMEM);
case MD_IOC_TRANS_DETACH:
return (EACCES);
return (ENOMEM);
case MD_IOCREPLACE:
replace_params_t *p;
return (EACCES);
return (ENOMEM);
case MD_IOCGET_DEVS:
return (EACCES);
return (ENOMEM);
#ifdef DEBUG
case MD_IOCGET_TRANSSTATS:
return (EACCES);
return (ENOMEM);
case MD_IOC_DEBUG:
return (EACCES);
return (ENOMEM);
mdigp = d;
case MD_IOC_TSD:
return (EACCES);
return (ENOMEM);
case MD_IOC_TRYGETBLK:
return (EACCES);
return (ENOMEM);
case MD_IOC_TRYPAGE:
return (EACCES);
return (ENOMEM);
case MD_IOC_INJECTERRORS:
return (EACCES);
return (ENOMEM);
case MD_IOC_STOPERRORS:
return (EACCES);
return (ENOMEM);
case MD_IOC_ISDEBUG:
case MD_IOC_ISDEBUG:
case MD_IOCGET_TRANSSTATS:
case MD_IOC_STOPERRORS:
case MD_IOC_TSD:
case MD_IOC_TRYGETBLK:
case MD_IOC_TRYPAGE:
case MD_IOC_INJECTERRORS:
return (EACCES);
return (ENOMEM);
case MD_IOC_DEBUG:
return (EACCES);
return (ENOMEM);
mdigp = d;
case MD_IOC_UFSERROR:
return (EACCES);
return (ENOMEM);
case MD_IOC_SETSHADOW:
return (EACCES);
return (ENOMEM);
return (ENOTTY);
if (sz != 0) {
if (err == 0) {
return (err);
int cmd,
int mode,
int err = 0;
return (ENXIO);
switch (cmd) {
case DKIOCINFO:
struct dk_cinfo *p;
return (EACCES);
return (ENOMEM);
md_trans_free(p, sizeof (*p));
return (err);
case DKIOCGGEOM:
struct dk_geom *p;
return (EACCES);
return (ENOMEM);
mode) != 0)
md_trans_free(p, sizeof (*p));
return (err);
case DKIOCGVTOC:
return (EACCES);
return (err);
#ifdef _SYSCALL32
return (err);
case DKIOCSVTOC:
return (EACCES);
#ifdef _SYSCALL32
if (err == 0)
return (err);
case DKIOCGAPART:
return (err);
mode) != 0)
#ifdef _SYSCALL32
mode) != 0)
return (err);
case _FIOISLOG:
return (ENOTTY);
int n_children;
n_children = 0;
if (!new) {
++n_children;
if (!new) {
++n_children;
return (n_children);
from_min);
return (EINVAL);
return (EINVAL);
return (EINVAL);
case MDRNOP_EXCHANGE:
to_min);
return (EINVAL);
to_min);
return (EINVAL);
to_min);
return (EINVAL);
case MDRNOP_RENAME:
from_min);
return (EINVAL);
int err = 0;
return (EINVAL);
return (EBUSY);
return (EBUSY);
case MDRR_SELF:
if (err != 0) {
goto out;
case MDRR_PARENT:
out:
return (err);