Deleted Added
full compact
dsl_dataset.c (219320) dsl_dataset.c (223623)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
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

--- 6 unchanged lines hidden (view full) ---

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 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
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

--- 6 unchanged lines hidden (view full) ---

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 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2011 by Delphix. All rights reserved.
23 */
24
25#include <sys/dmu_objset.h>
26#include <sys/dsl_dataset.h>
27#include <sys/dsl_dir.h>
28#include <sys/dsl_prop.h>
29#include <sys/dsl_synctask.h>
30#include <sys/dmu_traverse.h>

--- 2114 unchanged lines hidden (view full) ---

2145
2146 dsl_dir_dirty(ds->ds_dir, tx);
2147 dmu_objset_sync(ds->ds_objset, zio, tx);
2148}
2149
2150void
2151dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv)
2152{
24 */
25
26#include <sys/dmu_objset.h>
27#include <sys/dsl_dataset.h>
28#include <sys/dsl_dir.h>
29#include <sys/dsl_prop.h>
30#include <sys/dsl_synctask.h>
31#include <sys/dmu_traverse.h>

--- 2114 unchanged lines hidden (view full) ---

2146
2147 dsl_dir_dirty(ds->ds_dir, tx);
2148 dmu_objset_sync(ds->ds_objset, zio, tx);
2149}
2150
2151void
2152dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv)
2153{
2153 uint64_t refd, avail, uobjs, aobjs;
2154 uint64_t refd, avail, uobjs, aobjs, ratio;
2154
2155 dsl_dir_stats(ds->ds_dir, nv);
2156
2157 dsl_dataset_space(ds, &refd, &avail, &uobjs, &aobjs);
2158 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_AVAILABLE, avail);
2159 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFERENCED, refd);
2160
2161 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_CREATION,

--- 10 unchanged lines hidden (view full) ---

2172 ds->ds_phys->ds_unique_bytes);
2173 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_OBJSETID,
2174 ds->ds_object);
2175 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USERREFS,
2176 ds->ds_userrefs);
2177 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_DEFER_DESTROY,
2178 DS_IS_DEFER_DESTROY(ds) ? 1 : 0);
2179
2155
2156 dsl_dir_stats(ds->ds_dir, nv);
2157
2158 dsl_dataset_space(ds, &refd, &avail, &uobjs, &aobjs);
2159 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_AVAILABLE, avail);
2160 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFERENCED, refd);
2161
2162 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_CREATION,

--- 10 unchanged lines hidden (view full) ---

2173 ds->ds_phys->ds_unique_bytes);
2174 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_OBJSETID,
2175 ds->ds_object);
2176 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USERREFS,
2177 ds->ds_userrefs);
2178 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_DEFER_DESTROY,
2179 DS_IS_DEFER_DESTROY(ds) ? 1 : 0);
2180
2181 ratio = ds->ds_phys->ds_compressed_bytes == 0 ? 100 :
2182 (ds->ds_phys->ds_uncompressed_bytes * 100 /
2183 ds->ds_phys->ds_compressed_bytes);
2184 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio);
2185
2180 if (ds->ds_phys->ds_next_snap_obj) {
2181 /*
2182 * This is a snapshot; override the dd's space used with
2183 * our unique space and compression ratio.
2184 */
2185 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USED,
2186 ds->ds_phys->ds_unique_bytes);
2186 if (ds->ds_phys->ds_next_snap_obj) {
2187 /*
2188 * This is a snapshot; override the dd's space used with
2189 * our unique space and compression ratio.
2190 */
2191 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USED,
2192 ds->ds_phys->ds_unique_bytes);
2187 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO,
2188 ds->ds_phys->ds_compressed_bytes == 0 ? 100 :
2189 (ds->ds_phys->ds_uncompressed_bytes * 100 /
2190 ds->ds_phys->ds_compressed_bytes));
2193 dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, ratio);
2191 }
2192}
2193
2194void
2195dsl_dataset_fast_stat(dsl_dataset_t *ds, dmu_objset_stats_t *stat)
2196{
2197 stat->dds_creation_txg = ds->ds_phys->ds_creation_txg;
2198 stat->dds_inconsistent = ds->ds_phys->ds_flags & DS_FLAG_INCONSISTENT;

--- 1843 unchanged lines hidden ---
2194 }
2195}
2196
2197void
2198dsl_dataset_fast_stat(dsl_dataset_t *ds, dmu_objset_stats_t *stat)
2199{
2200 stat->dds_creation_txg = ds->ds_phys->ds_creation_txg;
2201 stat->dds_inconsistent = ds->ds_phys->ds_flags & DS_FLAG_INCONSISTENT;

--- 1843 unchanged lines hidden ---