Template Version: @(#)sac_nextcase 1.66 04/17/08 SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
         ZFS space accounting enhancements
    1.2. Name of Document Author/Supplier:
         Author:  Matthew Ahrens
    1.3  Date of This Document:
        13 August, 2008
4. Technical Description
This case requests patch/micro release binding.  The new interfaces are
committed.

A. INTRODUCTION

ZFS tracks and reports several properties on space usage: used,
available, compressratio, referenced.

B. NEW PROPERTIES

This case introduces several new zfs properties, the goal of which is to
decompose the "used" property into the various reasons that space is
"used".  In particular:

used == MAX(reserv, usedbysnapshots + usedbychildren +
    usedbyrefreservation + usedbydataset)

The new properties are all read-only and apply only to filesystems and
volumes (not snapshots).

The zpool on-disk version number will be incremented, and only
filesysystems and volumes (including clones) created after upgrading
will have these new properties.

For the below descriptions, "space that would be freed" means the amount
that the filesystem or volume's "used" property will decrease.  If the
fs/vol has a reservation, the space available to the rest of the pool
may not increase.

1. usedbysnapshots

The usedbysnapshots property is the amount of space that would be freed if all
the snapshots of a given filesystem or volume were destroyed.

Note that the "usedbysnapshots" property is not simply the sum of the
snapshots' "used" properties (which reports how much space would be
freed if that snapshot was destroyed).  This is because blocks may be
referenced by multiple snapshots, so destroying any one of them would
not free up the space, but destroying all of them would.  (Destroying
one snapshot could increase the space "used" by its adjacent snapshots.)

usedbysnapshots >= sum_over_snapshots(snap's used)

2. usedbychildren

The usedbychildren property is the amount of space that would be freed if all
children of this filesystem were destroyed.

usedbychildren == sum_over_children(MAX(child's used, child's reservation)

3. usedbyrefreservation

The usedbyrefreservation property is the amount of space that would be freed if
the refreservation was removed.

usedbyrefreservation <= referenced

4. usedbydataset

The usedbydataset property will report the amount of space that would be freed
if the contents of the filesystem or volume were removed (eg, by doing a
"rm -rf"), after first destroying any snapshots and removing any
refreservation.  (If there are snapshots or refreservation, removing the
contents will transfer some space from dsused to snapused or
refreservused.)

Note that the "usedbydataset" property is the same as the "referenced" property
for non-clones, but not for clones because a clone shares some space
with its origin, which will not be freed when the clone is destroyed.

usedbydataset <= referenced
For non-clones: usedbydataset == referenced.

C. ZFS LIST

We will add the shorthand "zfs list -o space" as a shortcut for:

zfs list -o name,avail,used,usedsnap,usedds,usedrefreserv,usedchild \
         -t filesystem,volume

eg:
$ zfs list -o space
NAME        AVAIL   USED  USEDSNAP  USEDDS  USEDREFRESERV  USEDCHILD
fast        29.3G  18.2M         0     21K              0      18.2M
fast/clone  29.3G     5M         0   2.02M          2.98M          0
fast/fs     29.3G  13.1M     10.0M   3.02M              0          0

Additional -o options will be added to the list above, and other flags
for zfs list will continue to function as usual.

(Note that on Nevada, the "-t filesystem,volume" is redundant if the
pool property listsnaps=off, which will be the default on Nevada, see
PSARC/2008/469 "Excluding snapshot info from 'zfs list'".)

D. MANPAGE CHANGES

To be determined.


6. Resources and Schedule
    6.4. Steering Committee requested information
        6.4.1. Consolidation C-team Name:
                ON
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open


Reply via email to