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
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.
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]
23 * Copyright (c) 1994, 2000 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include "mhd_local.h"
37 mhd_list_args_t
*argp
,
39 struct svc_req
*rqstp
/* RPC stuff */
42 mhd_error_t
*mhep
= &resp
->status
;
45 /* setup, check permissions */
46 (void) memset(resp
, 0, sizeof (*resp
));
47 if ((err
= mhd_init(rqstp
, R_OK
, mhep
)) < 0)
53 (void) mhd_list_drives(argp
->path
, argp
->flags
, resp
, mhep
);
58 * take ownership of drives
63 mhd_tkown_args_t
*argp
,
65 struct svc_req
*rqstp
/* RPC stuff */
70 /* setup, check permissions */
71 if ((err
= mhd_init(rqstp
, W_OK
, mhep
)) < 0)
77 (void) mhd_reserve_drives(&argp
->set
, &argp
->timeouts
, argp
->ff_mode
,
83 * release ownership of drives
88 mhd_relown_args_t
*argp
,
90 struct svc_req
*rqstp
/* RPC stuff */
95 /* setup, check permissions */
96 if ((err
= mhd_init(rqstp
, W_OK
, mhep
)) < 0)
102 (void) mhd_release_drives(&argp
->set
, argp
->options
, mhep
);
112 mhd_status_args_t
*argp
,
113 mhd_status_res_t
*resp
,
114 struct svc_req
*rqstp
/* RPC stuff */
117 mhd_error_t
*mhep
= &resp
->status
;
118 mhd_drive_status_t
*status
= NULL
;
122 /* setup, check permissions */
123 (void) memset(resp
, 0, sizeof (*resp
));
124 if ((err
= mhd_init(rqstp
, W_OK
, mhep
)) < 0)
130 if ((cnt
= mhd_status_drives(&argp
->set
, argp
->options
,
131 &status
, mhep
)) < 0) {
134 resp
->results
.results_len
= cnt
;
135 resp
->results
.results_val
= status
;