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 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_DMU_CTL_H
28 #define _SYS_DMU_CTL_H
30 #include <sys/types.h>
32 /* Default directory where the clients search for sockets to connect */
33 #define DMU_CTL_DEFAULT_DIR "/var/run/zfs/udmu"
36 * These functions are called by the server process.
38 * kernel_init() must be called before dctl_server_init().
39 * kernel_fini() must not be called before dctl_server_fini().
41 * All objsets must be closed and object references be released before calling
42 * dctl_server_fini(), otherwise it will return EBUSY.
44 * Note: On Solaris, it is highly recommended to either catch or ignore the
45 * SIGPIPE signal, otherwise the server process will die if the client is
48 int dctl_server_init(const char *cfg_dir, int min_threads,
49 int max_free_threads);
50 int dctl_server_fini();
53 * The following functions are called by the DMU from the server process context
54 * (in the worker threads).
56 int dctls_copyin(const void *src, void *dest, size_t size);
57 int dctls_copyinstr(const char *from, char *to, size_t max,
59 int dctls_copyout(const void *src, void *dest, size_t size);
60 int dctls_fd_read(int fd, void *buf, ssize_t len, ssize_t *residp);
61 int dctls_fd_write(int fd, const void *src, ssize_t len);
64 * These functions are called by the client process (libzfs).
66 int dctlc_connect(const char *dir, boolean_t check_subdirs);
67 void dctlc_disconnect(int fd);
69 int dctlc_ioctl(int fd, int32_t request, void *arg);