5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2012 by Delphix. All rights reserved.
25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
27 */
28
29 /* Portions Copyright 2010 Robert Milkowski */
30
31 #ifndef _SYS_DMU_H
32 #define _SYS_DMU_H
33
34 /*
35 * This file describes the interface that the DMU provides for its
36 * consumers.
37 *
38 * The DMU also interacts with the SPA. That interface is described in
39 * dmu_spa.h.
40 */
41
42 #include <sys/inttypes.h>
43 #include <sys/types.h>
44 #include <sys/param.h>
45 #include <sys/cred.h>
766
767 /*
768 * Find the next hole or data block in file starting at *off
769 * Return found offset in *off. Return ESRCH for end of file.
770 */
771 int dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole,
772 uint64_t *off);
773
774 /*
775 * Initial setup and final teardown.
776 */
777 extern void dmu_init(void);
778 extern void dmu_fini(void);
779
780 typedef void (*dmu_traverse_cb_t)(objset_t *os, void *arg, struct blkptr *bp,
781 uint64_t object, uint64_t offset, int len);
782 void dmu_traverse_objset(objset_t *os, uint64_t txg_start,
783 dmu_traverse_cb_t cb, void *arg);
784
785 int dmu_send(objset_t *tosnap, objset_t *fromsnap,
786 int outfd, struct vnode *vp, offset_t *off);
787 int dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, uint64_t *sizep);
788
789 typedef struct dmu_recv_cookie {
790 /*
791 * This structure is opaque!
792 *
793 * If logical and real are different, we are recving the stream
794 * into the "real" temporary clone, and then switching it with
795 * the "logical" target.
796 */
797 struct dsl_dataset *drc_logical_ds;
798 struct dsl_dataset *drc_real_ds;
799 struct drr_begin *drc_drrb;
800 char *drc_tosnap;
801 char *drc_top_ds;
802 boolean_t drc_newfs;
803 boolean_t drc_force;
804 struct avl_tree *drc_guid_to_ds_map;
805 } dmu_recv_cookie_t;
806
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2012 by Delphix. All rights reserved.
25 * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
26 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
27 */
28
29 /* Portions Copyright 2010 Robert Milkowski */
30
31 #ifndef _SYS_DMU_H
32 #define _SYS_DMU_H
33
34 /*
35 * This file describes the interface that the DMU provides for its
36 * consumers.
37 *
38 * The DMU also interacts with the SPA. That interface is described in
39 * dmu_spa.h.
40 */
41
42 #include <sys/inttypes.h>
43 #include <sys/types.h>
44 #include <sys/param.h>
45 #include <sys/cred.h>
766
767 /*
768 * Find the next hole or data block in file starting at *off
769 * Return found offset in *off. Return ESRCH for end of file.
770 */
771 int dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole,
772 uint64_t *off);
773
774 /*
775 * Initial setup and final teardown.
776 */
777 extern void dmu_init(void);
778 extern void dmu_fini(void);
779
780 typedef void (*dmu_traverse_cb_t)(objset_t *os, void *arg, struct blkptr *bp,
781 uint64_t object, uint64_t offset, int len);
782 void dmu_traverse_objset(objset_t *os, uint64_t txg_start,
783 dmu_traverse_cb_t cb, void *arg);
784
785 int dmu_send(objset_t *tosnap, objset_t *fromsnap,
786 int outfd, struct vnode *vp, offset_t *off, boolean_t sendsize);
787 int dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, uint64_t *sizep);
788
789 typedef struct dmu_recv_cookie {
790 /*
791 * This structure is opaque!
792 *
793 * If logical and real are different, we are recving the stream
794 * into the "real" temporary clone, and then switching it with
795 * the "logical" target.
796 */
797 struct dsl_dataset *drc_logical_ds;
798 struct dsl_dataset *drc_real_ds;
799 struct drr_begin *drc_drrb;
800 char *drc_tosnap;
801 char *drc_top_ds;
802 boolean_t drc_newfs;
803 boolean_t drc_force;
804 struct avl_tree *drc_guid_to_ds_map;
805 } dmu_recv_cookie_t;
806
|