From 1f06ad3c96e5ce038e57c10b8155583d20307f98 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Tue, 26 Feb 2013 08:53:33 +0000 Subject: [PATCH] Update vendor/illumos/dist and vendor-sys/illumos/dist to illumos-gate 13969:b2c7608044b7 Illumos ZFS issues: 3588 provide zfs properties for logical (uncompressed) space used and referenced --- common/zfs/zfs_prop.c | 6 +++++- man/man1m/zfs.1m | 34 +++++++++++++++++++++++++++++++++ uts/common/fs/zfs/dsl_dataset.c | 2 ++ uts/common/fs/zfs/dsl_dir.c | 2 ++ uts/common/sys/fs/zfs.h | 2 ++ 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/common/zfs/zfs_prop.c b/common/zfs/zfs_prop.c index 9d8365528c39..ebb267965a39 100644 --- a/common/zfs/zfs_prop.c +++ b/common/zfs/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. */ @@ -350,6 +350,10 @@ zfs_prop_init(void) ZFS_TYPE_SNAPSHOT, "", "USERREFS"); zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY, ZFS_TYPE_DATASET, "", "WRITTEN"); + zprop_register_number(ZFS_PROP_LOGICALUSED, "logicalused", 0, + PROP_READONLY, ZFS_TYPE_DATASET, "", "LUSED"); + zprop_register_number(ZFS_PROP_LOGICALREFERENCED, "logicalreferenced", + 0, PROP_READONLY, ZFS_TYPE_DATASET, "", "LREFER"); /* default number properties */ zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT, diff --git a/man/man1m/zfs.1m b/man/man1m/zfs.1m index 10382efa7856..18441dad6ef8 100644 --- a/man/man1m/zfs.1m +++ b/man/man1m/zfs.1m @@ -532,6 +532,40 @@ by using the \fBzfs destroy\fR \fB-d\fR command. Otherwise, the property is \fBoff\fR. .RE +.sp +.ne 2 +.na +\fB\fBlogicalreferenced\fR\fR +.ad +.sp .6 +.RS 4n +The amount of space that is "logically" accessible by this dataset. See +the \fBreferenced\fR property. The logical space ignores the effect of +the \fBcompression\fR and \fBcopies\fR properties, giving a quantity +closer to the amount of data that applications see. However, it does +include space consumed by metadata. +.sp +This property can also be referred to by its shortened column name, +\fBlrefer\fR. +.RE + +.sp +.ne 2 +.na +\fB\fBlogicalused\fR\fR +.ad +.sp .6 +.RS 4n +The amount of space that is "logically" consumed by this dataset and all +its descendents. See the \fBused\fR property. The logical space +ignores the effect of the \fBcompression\fR and \fBcopies\fR properties, +giving a quantity closer to the amount of data that applications see. +However, it does include space consumed by metadata. +.sp +This property can also be referred to by its shortened column name, +\fBlused\fR. +.RE + .sp .ne 2 .na diff --git a/uts/common/fs/zfs/dsl_dataset.c b/uts/common/fs/zfs/dsl_dataset.c index cf888d2017a5..0a5ef837ccfd 100644 --- a/uts/common/fs/zfs/dsl_dataset.c +++ b/uts/common/fs/zfs/dsl_dataset.c @@ -2247,6 +2247,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/uts/common/fs/zfs/dsl_dir.c b/uts/common/fs/zfs/dsl_dir.c index df3f02b1df3e..5ccb6862e9d0 100644 --- a/uts/common/fs/zfs/dsl_dir.c +++ b/uts/common/fs/zfs/dsl_dir.c @@ -530,6 +530,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]); diff --git a/uts/common/sys/fs/zfs.h b/uts/common/sys/fs/zfs.h index 8639a2b8db49..286b35b9d6cd 100644 --- a/uts/common/sys/fs/zfs.h +++ b/uts/common/sys/fs/zfs.h @@ -138,6 +138,8 @@ typedef enum { ZFS_PROP_REFRATIO, ZFS_PROP_WRITTEN, ZFS_PROP_CLONES, + ZFS_PROP_LOGICALUSED, + ZFS_PROP_LOGICALREFERENCED, ZFS_NUM_PROPS } zfs_prop_t;