aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2013-02-22 01:23:09 -0800
committerBrian Behlendorf <[email protected]>2013-10-31 10:16:11 -0700
commit24a64651b4163d47b1187821152d762e9a263d5a (patch)
tree0550704340de1f097d31cd4c8d1e47b2ed78f16d /module
parentc2e42f9d53bec422abb71efade2c004383345038 (diff)
Illumos #3588
3588 provide zfs properties for logical (uncompressed) space used and referenced Reviewed by: Adam Leventhal <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Dan McDonald <[email protected]> Reviewed by: Richard Elling <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/3588 illumos/illumos-gate@77372cb0f35e8d3615ca2e16044f033397e88e21 Ported-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module')
-rw-r--r--module/zcommon/zfs_prop.c6
-rw-r--r--module/zfs/dsl_dataset.c2
-rw-r--r--module/zfs/dsl_dir.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c
index 7e3563285..93ccfef6b 100644
--- a/module/zcommon/zfs_prop.c
+++ b/module/zcommon/zfs_prop.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
@@ -365,6 +365,10 @@ zfs_prop_init(void)
ZFS_TYPE_SNAPSHOT, "<count>", "USERREFS");
zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY,
ZFS_TYPE_DATASET, "<size>", "WRITTEN");
+ zprop_register_number(ZFS_PROP_LOGICALUSED, "logicalused", 0,
+ PROP_READONLY, ZFS_TYPE_DATASET, "<size>", "LUSED");
+ zprop_register_number(ZFS_PROP_LOGICALREFERENCED, "logicalreferenced",
+ 0, PROP_READONLY, ZFS_TYPE_DATASET, "<size>", "LREFER");
/* default number properties */
zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT,
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c
index 33bcd2ab3..4d767cd86 100644
--- a/module/zfs/dsl_dataset.c
+++ b/module/zfs/dsl_dataset.c
@@ -1387,6 +1387,8 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv)
ds->ds_phys->ds_compressed_bytes);
dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio);
+ dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_LOGICALREFERENCED,
+ ds->ds_phys->ds_uncompressed_bytes);
if (dsl_dataset_is_snapshot(ds)) {
dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, ratio);
diff --git a/module/zfs/dsl_dir.c b/module/zfs/dsl_dir.c
index ccae3f270..69a28ef25 100644
--- a/module/zfs/dsl_dir.c
+++ b/module/zfs/dsl_dir.c
@@ -440,6 +440,8 @@ dsl_dir_stats(dsl_dir_t *dd, nvlist_t *nv)
dd->dd_phys->dd_compressed_bytes == 0 ? 100 :
(dd->dd_phys->dd_uncompressed_bytes * 100 /
dd->dd_phys->dd_compressed_bytes));
+ dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_LOGICALUSED,
+ dd->dd_phys->dd_uncompressed_bytes);
if (dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN) {
dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USEDSNAP,
dd->dd_phys->dd_used_breakdown[DD_USED_SNAP]);