dmu_objset.c revision 87e5029a3226958edab1512d6182bc74d8d80c9a
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/zfs_context.h>
#include <sys/dmu_objset.h>
#include <sys/dsl_dataset.h>
#include <sys/dsl_prop.h>
#include <sys/dsl_pool.h>
#include <sys/zio_checksum.h>
#include <sys/dmu_impl.h>
spa_t *
{
}
zilog_t *
{
}
{
else
}
{
}
{
}
void
{
}
{
}
static void
{
/*
* Inheritance should have been done by now.
*/
}
static void
{
/*
* Inheritance and range checking should have been done by now.
*/
}
void
{
}
{
if (bp)
} else {
}
/*
* Note: the changed_cb will be called once before the register
* func returns, thus changing the checksum/compression from the
*/
if (ds) {
} else {
/* It's the meta-objset. */
}
/*
* Metadata always gets compressed and checksummed.
* If the data checksum is multi-bit correctable, and it's not
* a ZBT-style checksum, then it's suitable for metadata as well.
* Otherwise, the metadata checksum defaults to fletcher4.
*/
else
for (i = 0; i < TXG_SIZE; i++) {
}
if (winner) {
}
}
return (osi);
}
/* called from zpl */
int
{
int err;
if (err) {
return (err);
}
}
return (EINVAL);
}
return (0);
}
void
{
}
void
{
int err, i;
for (i = 0; i < TXG_SIZE; i++) {
}
if (ds) {
}
}
/* called from dsl for meta-objset */
{
/*
* We don't want to have to increase the meta-dnode's nlevels
* later, because then we could do it in quescing context while
* we are also accessing it in open context.
*
* This precaution is not necessary for the MOS (ds == NULL),
* because the MOS is only updated in syncing context.
* This is most fortunate: the MOS is the only objset that
* needs to be synced multiple times as spa_sync() iterates
* to convergence, so minimizing its dn_nlevels matters.
*/
return (osi);
}
struct oscarg {
void *userarg;
const char *fullname;
const char *lastname;
};
static int
{
int err;
if (err)
return (err);
if (BP_IS_HOLE(&bp)) {
/* This is an empty dmu_objset; not a clone. */
}
return (0);
}
int
{
const char *tail;
int err = 0;
return (ENOENT);
return (EEXIST);
}
if (tail[0] == '@') {
/*
* If we're creating a snapshot, make sure everything
* they might want is on disk. XXX Sketchy to know
* about snapshots here, better to put in DSL.
*/
if (err == 0) {
if (err == 0) {
}
}
} else {
if (clone_parent != NULL) {
/*
* You can't clone to a different type.
*/
return (EINVAL);
}
}
256*1024);
}
return (err);
}
int
dmu_objset_destroy(const char *name)
{
int error;
/*
* If it looks like we'll be able to destroy it, and there's
* an unplayed replay log sitting around, destroy the log.
* It would be nicer to do this in dsl_dataset_destroy_sync(),
* but the replay log objset is modified in open context.
*/
if (error == 0) {
}
/* XXX uncache everything? */
return (dsl_dataset_destroy(name));
}
int
dmu_objset_rollback(const char *name)
{
int err;
if (err == 0) {
if (err == 0)
if (err == 0) {
/* XXX uncache everything? */
}
}
return (err);
}
static void
{
while (dn) {
/*
* This dnode requires syncing at higher
* levels; put it back onto the list.
*/
if (next)
else
}
}
}
}
/* ARGSUSED */
static void
{
int i;
/*
* Update rootbp fill count.
*/
for (i = 0; i < dnp->dn_nblkptr; i++)
}
}
/* called from dsl */
void
{
int txgoff;
int err;
/* XXX the write_done callback should really give us the tx... */
/*
* Free intent log blocks up to this tx.
*/
/*
* Sync meta-dnode
*/
/*
* Sync the root block.
*/
}
void
{
} else {
}
}
int
{
else
return (B_FALSE);
}
int
{
return (ENOENT);
return (ENOENT);
}
return (ENAMETOOLONG);
}
if (idp)
return (0);
}
int
{
return (ENOENT);
/* there is no next dir on a snapshot! */
return (ENOENT);
return (ENOENT);
}
return (ENAMETOOLONG);
}
if (idp)
return (0);
}
/*
* Find all objsets under name, and for each, call 'func(child_name, arg)'.
*/
void
{
char *child;
int do_self;
return;
/*
* Iterate over all children.
*/
(void) zap_cursor_advance(&zc)) {
/*
* No separating '/' because parent's name ends in /.
*/
/* XXX could probably just use name here */
}
}
/*
* Iterate over all snapshots.
*/
if ((flags & DS_FIND_SNAPSHOTS) &&
(void) zap_cursor_advance(&zc)) {
/* XXX could probably just use name here */
}
}
/*
* Apply to self if appropriate.
*/
if (do_self)
}