Skip to content

Commit 1715493

Browse files
ahrensbehlendorf
authored andcommitted
Illumos 4929 - want prevsnap property
4929 want prevsnap property Reviewed by: Adam Leventhal <adam.leventhal@delphix.com> Reviewed by: Matt Amdur <matt.amdur@delphix.com> Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com> Reviewed by: Boris Protopopov <bprotopopov@hotmail.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Dan McDonald <danmcd@omniti.com> References: https://www.illumos.org/issues/4929 illumos/illumos-gate@b461c74 Porting notes: - [include/sys/fs/zfs.h] - f67d70 Create an 'overlay' property - 11b9ec Add full SELinux support - [fs/zfs/dsl_dataset.c] - This increases the stack size of dsl_dataset_stats() but nothing has been changed until this is shown to be an issue. Ported-by: kernelOfTruth kerneloftruth@gmail.com Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
1 parent 9867e8b commit 1715493

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

include/sys/fs/zfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ typedef enum {
155155
ZFS_PROP_RELATIME,
156156
ZFS_PROP_REDUNDANT_METADATA,
157157
ZFS_PROP_OVERLAY,
158+
ZFS_PROP_PREV_SNAP,
158159
ZFS_NUM_PROPS
159160
} zfs_prop_t;
160161

module/zcommon/zfs_prop.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@ zfs_prop_init(void)
452452
PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID");
453453
zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent",
454454
PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT");
455+
zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING,
456+
PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PREVSNAP");
455457

456458
/*
457459
* Property to be removed once libbe is integrated

module/zfs/dsl_dataset.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,12 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv)
16951695
dsl_dataset_phys(ds)->ds_unique_bytes);
16961696
get_clones_stat(ds, nv);
16971697
} else {
1698+
if (ds->ds_prev != NULL && ds->ds_prev != dp->dp_origin_snap) {
1699+
char buf[MAXNAMELEN];
1700+
dsl_dataset_name(ds->ds_prev, buf);
1701+
dsl_prop_nvlist_add_string(nv, ZFS_PROP_PREV_SNAP, buf);
1702+
}
1703+
16981704
dsl_dir_stats(ds->ds_dir, nv);
16991705
}
17001706

0 commit comments

Comments
 (0)