Skip to content

Commit

Permalink
Illumos 4929 - want prevsnap property
Browse files Browse the repository at this point in the history
4929 want prevsnap property
Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Matt Amdur <[email protected]>
Reviewed by: Saso Kiselkov <[email protected]>
Reviewed by: Boris Protopopov <[email protected]>
Reviewed by: Richard Lowe <[email protected]>
Approved by: Dan McDonald <[email protected]>

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 [email protected]
Signed-off-by: Brian Behlendorf <[email protected]>
  • Loading branch information
ahrens authored and behlendorf committed Jan 11, 2016
1 parent 9867e8b commit 1715493
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/sys/fs/zfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ typedef enum {
ZFS_PROP_RELATIME,
ZFS_PROP_REDUNDANT_METADATA,
ZFS_PROP_OVERLAY,
ZFS_PROP_PREV_SNAP,
ZFS_NUM_PROPS
} zfs_prop_t;

Expand Down
2 changes: 2 additions & 0 deletions module/zcommon/zfs_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ zfs_prop_init(void)
PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID");
zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent",
PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT");
zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING,
PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PREVSNAP");

/*
* Property to be removed once libbe is integrated
Expand Down
6 changes: 6 additions & 0 deletions module/zfs/dsl_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,12 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv)
dsl_dataset_phys(ds)->ds_unique_bytes);
get_clones_stat(ds, nv);
} else {
if (ds->ds_prev != NULL && ds->ds_prev != dp->dp_origin_snap) {

This comment has been minimized.

Copy link
@marcelhuberfoo

marcelhuberfoo Jan 11, 2016

Contributor

compile error:
dp->dp_origin_snap: dp undefined, first referenced...

char buf[MAXNAMELEN];
dsl_dataset_name(ds->ds_prev, buf);
dsl_prop_nvlist_add_string(nv, ZFS_PROP_PREV_SNAP, buf);
}

dsl_dir_stats(ds->ds_dir, nv);
}

Expand Down

1 comment on commit 1715493

@behlendorf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcelhuberfoo sorry about that. I didn't catch it initially because I only did a debug build. Fix applied as:

b858767 Fix 'prevsnap property' build failure

Please sign in to comment.