dsl_pool.h revision 1d3f896f5469c69c1339890ec3d68e9feddb0343
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * Common Development and Distribution License (the "License").
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock * You may not use this file except in compliance with the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * When distributing Covered Code, include this CDDL HEADER in each
fa9e4066f08beec538e775443c5be79dd423fcabahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * If applicable, add the following below this CDDL HEADER, with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * fields enclosed by brackets "[]" replaced with your own identifying
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information: Portions Copyright [yyyy] [name of copyright owner]
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER END
3113f7cee6785cfe8d9e78c535cf9e2a79283275George Wilson * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
69962b5647e4a8b9b14998733b765925381b727eMatthew Ahrens * Copyright (c) 2013 by Delphix. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
88b7b0f29b20b808b9e06071885b1d6a3ddb6328Matthew Ahrens/* These macros are for indexing into the zfs_all_blkstats_t. */
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden#define DMU_OT_OTHER DMU_OT_NUMTYPES /* place holder for DMU_OT() types */
88b7b0f29b20b808b9e06071885b1d6a3ddb6328Matthew Ahrenstypedef struct zfs_blkstat {
88b7b0f29b20b808b9e06071885b1d6a3ddb6328Matthew Ahrens zfs_blkstat_t zab_type[DN_MAX_LEVELS + 1][DMU_OT_TOTAL + 1];
fa9e4066f08beec538e775443c5be79dd423fcabahrenstypedef struct dsl_pool {
fa9e4066f08beec538e775443c5be79dd423fcabahrens /* Immutable */
fa9e4066f08beec538e775443c5be79dd423fcabahrens /* No lock needed - sync context only */
1ab7f2ded02e7a1bc3c73516eb27efa79bf2a2ffmaybee /* Uses dp_lock */
69962b5647e4a8b9b14998733b765925381b727eMatthew Ahrens * Time of most recently scheduled (furthest in the future)
69962b5647e4a8b9b14998733b765925381b727eMatthew Ahrens * wakeup for delayed transactions.
fa9e4066f08beec538e775443c5be79dd423fcabahrens /* Has its own locking */
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Protects administrative changes (properties, namespace)
fa9e4066f08beec538e775443c5be79dd423fcabahrens * It is only held for write in syncing context. Therefore
fa9e4066f08beec538e775443c5be79dd423fcabahrens * syncing context does not need to ever have it for read, since
fa9e4066f08beec538e775443c5be79dd423fcabahrens * nobody else could possibly have it for write.
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Sidenint dsl_pool_init(spa_t *spa, uint64_t txg, dsl_pool_t **dpp);
0a48a24e663a04e34e2ed4e55390ad96f178dbeatimhdsl_pool_t *dsl_pool_create(spa_t *spa, nvlist_t *zplprops, uint64_t txg);
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickvoid dsl_pool_sync_done(dsl_pool_t *dp, uint64_t txg);
fa9e4066f08beec538e775443c5be79dd423fcabahrensuint64_t dsl_pool_adjustedsize(dsl_pool_t *dp, boolean_t netfree);
468c413a79615e77179e8d98f22a7e513a8135bdTim Haleyuint64_t dsl_pool_adjustedfree(dsl_pool_t *dp, boolean_t netfree);
69962b5647e4a8b9b14998733b765925381b727eMatthew Ahrensvoid dsl_pool_dirty_space(dsl_pool_t *dp, int64_t space, dmu_tx_t *tx);
69962b5647e4a8b9b14998733b765925381b727eMatthew Ahrensvoid dsl_pool_undirty_space(dsl_pool_t *dp, int64_t space, uint64_t txg);
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwickvoid dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp);
3113f7cee6785cfe8d9e78c535cf9e2a79283275George Wilsonvoid dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg,
088f389458728c464569a5506b58070254fa4f7dahrensvoid dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx);
088f389458728c464569a5506b58070254fa4f7dahrensvoid dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx);
cde58dbc6a23d4d38db7c8866312be83221c765fMatthew Ahrensvoid dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx);
ce636f8b38e8c9ff484e880d9abb27251a882860Matthew Ahrensvoid dsl_pool_mos_diduse_space(dsl_pool_t *dp,
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensvoid dsl_pool_config_enter(dsl_pool_t *dp, void *tag);
1d3f896f5469c69c1339890ec3d68e9feddb0343Arne Jansenvoid dsl_pool_config_enter_prio(dsl_pool_t *dp, void *tag);
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensvoid dsl_pool_config_exit(dsl_pool_t *dp, void *tag);
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensboolean_t dsl_pool_config_held(dsl_pool_t *dp);
12380e1e701fda28c9e9f32d01cafb54af279eb5Arne Jansenboolean_t dsl_pool_config_held_writer(dsl_pool_t *dp);
69962b5647e4a8b9b14998733b765925381b727eMatthew Ahrensboolean_t dsl_pool_need_dirty_delay(dsl_pool_t *dp);
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensint dsl_pool_user_hold(dsl_pool_t *dp, uint64_t dsobj,
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrens const char *tag, uint64_t now, dmu_tx_t *tx);
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensint dsl_pool_user_release(dsl_pool_t *dp, uint64_t dsobj,
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensvoid dsl_pool_clean_tmp_userrefs(dsl_pool_t *dp);
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Lingint dsl_pool_open_special_dir(dsl_pool_t *dp, const char *name, dsl_dir_t **);
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensint dsl_pool_hold(const char *name, void *tag, dsl_pool_t **dp);
3b2aab18808792cbd248a12f1edf139b89833c13Matthew Ahrensvoid dsl_pool_rele(dsl_pool_t *dp, void *tag);
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* _SYS_DSL_POOL_H */