dsl_dataset.h revision 9082849ec1ce8be7d4eff196c8f4a3a9f75dc65d
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DSL_DATASET_H
#define _SYS_DSL_DATASET_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/dsl_synctask.h>
#include <sys/zfs_context.h>
#ifdef __cplusplus
extern "C" {
#endif
struct dsl_dataset;
struct dsl_dir;
struct dsl_pool;
typedef void dsl_dataset_evict_func_t(struct dsl_dataset *, void *);
#define DS_FLAG_INCONSISTENT (1ULL<<0)
/*
* NB: nopromote can not yet be set, but we want support for it in this
* on-disk version, so that we don't need to upgrade for it later. It
* will be needed when we implement 'zfs split' (where the split off
* clone should not be promoted).
*/
/*
* DS_FLAG_UNIQUE_ACCURATE is set if ds_unique_bytes has been correctly
* calculated for head datasets (starting with SPA_VERSION_UNIQUE_ACCURATE,
*/
typedef struct dsl_dataset_phys {
/*
* The ds_fsid_guid is a 56-bit ID that can change to avoid
* collisions. The ds_guid is a 64-bit ID that will never
* change, so there is a small probability that it will collide.
*/
typedef struct dsl_dataset {
/* Immutable: */
/* only used in syncing context: */
/* has internal locking: */
/* protected by lock on pool's dp_dirty_datasets list */
/*
* ds_phys->ds_<accounting> is also protected by ds_lock.
* Protected by ds_lock:
*/
void *ds_user_ptr;
/* no locking; only for making guesses */
/* for objset_open() */
/* Protected by ds_lock; keep at end of struct for better locality */
char ds_snapname[MAXNAMELEN];
#define dsl_dataset_is_snapshot(ds) \
#define DS_UNIQUE_IS_ACCURATE(ds) \
dsl_dataset_t **dsp);
int dsl_dataset_promote(const char *name);
void *p, dsl_dataset_evict_func_t func);
#ifdef ZFS_DEBUG
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
} \
#else
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DSL_DATASET_H */