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) 2013 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>
46 #include <sys/time.h>
292 #define DMU_POOL_FEATURES_FOR_WRITE "features_for_write"
293 #define DMU_POOL_FEATURES_FOR_READ "features_for_read"
294 #define DMU_POOL_FEATURE_DESCRIPTIONS "feature_descriptions"
295 #define DMU_POOL_ROOT_DATASET "root_dataset"
296 #define DMU_POOL_SYNC_BPOBJ "sync_bplist"
297 #define DMU_POOL_ERRLOG_SCRUB "errlog_scrub"
298 #define DMU_POOL_ERRLOG_LAST "errlog_last"
299 #define DMU_POOL_SPARES "spares"
300 #define DMU_POOL_DEFLATE "deflate"
301 #define DMU_POOL_HISTORY "history"
302 #define DMU_POOL_PROPS "pool_props"
303 #define DMU_POOL_L2CACHE "l2cache"
304 #define DMU_POOL_TMP_USERREFS "tmp_userrefs"
305 #define DMU_POOL_DDT "DDT-%s-%s-%s"
306 #define DMU_POOL_DDT_STATS "DDT-statistics"
307 #define DMU_POOL_CREATION_VERSION "creation_version"
308 #define DMU_POOL_SCAN "scan"
309 #define DMU_POOL_FREE_BPOBJ "free_bpobj"
310 #define DMU_POOL_BPTREE_OBJ "bptree_obj"
311 #define DMU_POOL_EMPTY_BPOBJ "empty_bpobj"
312
313 /*
314 * Allocate an object from this objset. The range of object numbers
315 * available is (0, DN_MAX_OBJECT). Object 0 is the meta-dnode.
316 *
317 * The transaction must be assigned to a txg. The newly allocated
318 * object will be "held" in the transaction (ie. you can modify the
319 * newly allocated object in this transaction).
320 *
321 * dmu_object_alloc() chooses an object and returns it in *objectp.
322 *
323 * dmu_object_claim() allocates a specific object number. If that
324 * number is already allocated, it fails and returns EEXIST.
325 *
326 * Return 0 on success, or ENOSPC or EEXIST as specified above.
327 */
328 uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot,
329 int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx);
330 int dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot,
331 int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx);
|
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) 2013 by Delphix. All rights reserved.
25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
27 * Copyright 2013 Saso Kiselkov. All rights reserved.
28 */
29
30 /* Portions Copyright 2010 Robert Milkowski */
31
32 #ifndef _SYS_DMU_H
33 #define _SYS_DMU_H
34
35 /*
36 * This file describes the interface that the DMU provides for its
37 * consumers.
38 *
39 * The DMU also interacts with the SPA. That interface is described in
40 * dmu_spa.h.
41 */
42
43 #include <sys/inttypes.h>
44 #include <sys/types.h>
45 #include <sys/param.h>
46 #include <sys/cred.h>
47 #include <sys/time.h>
293 #define DMU_POOL_FEATURES_FOR_WRITE "features_for_write"
294 #define DMU_POOL_FEATURES_FOR_READ "features_for_read"
295 #define DMU_POOL_FEATURE_DESCRIPTIONS "feature_descriptions"
296 #define DMU_POOL_ROOT_DATASET "root_dataset"
297 #define DMU_POOL_SYNC_BPOBJ "sync_bplist"
298 #define DMU_POOL_ERRLOG_SCRUB "errlog_scrub"
299 #define DMU_POOL_ERRLOG_LAST "errlog_last"
300 #define DMU_POOL_SPARES "spares"
301 #define DMU_POOL_DEFLATE "deflate"
302 #define DMU_POOL_HISTORY "history"
303 #define DMU_POOL_PROPS "pool_props"
304 #define DMU_POOL_L2CACHE "l2cache"
305 #define DMU_POOL_TMP_USERREFS "tmp_userrefs"
306 #define DMU_POOL_DDT "DDT-%s-%s-%s"
307 #define DMU_POOL_DDT_STATS "DDT-statistics"
308 #define DMU_POOL_CREATION_VERSION "creation_version"
309 #define DMU_POOL_SCAN "scan"
310 #define DMU_POOL_FREE_BPOBJ "free_bpobj"
311 #define DMU_POOL_BPTREE_OBJ "bptree_obj"
312 #define DMU_POOL_EMPTY_BPOBJ "empty_bpobj"
313 #define DMU_POOL_CHECKSUM_SALT "checksum_salt"
314
315 /*
316 * Allocate an object from this objset. The range of object numbers
317 * available is (0, DN_MAX_OBJECT). Object 0 is the meta-dnode.
318 *
319 * The transaction must be assigned to a txg. The newly allocated
320 * object will be "held" in the transaction (ie. you can modify the
321 * newly allocated object in this transaction).
322 *
323 * dmu_object_alloc() chooses an object and returns it in *objectp.
324 *
325 * dmu_object_claim() allocates a specific object number. If that
326 * number is already allocated, it fails and returns EEXIST.
327 *
328 * Return 0 on success, or ENOSPC or EEXIST as specified above.
329 */
330 uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot,
331 int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx);
332 int dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot,
333 int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx);
|