mirror_zfs/module/zcommon
Christian Schwarz a73f361fdb Implement bookmark copying
This feature allows copying existing bookmarks using

    zfs bookmark fs#target fs#newbookmark

There are some niche use cases for such functionality,
e.g. when using bookmarks as markers for replication progress.

Copying redaction bookmarks produces a normal bookmark that
cannot be used for redacted send (we are not duplicating
the redaction object).

ZCP support for bookmarking (both creation and copying) will be
implemented in a separate patch based on this work.

Overview:

- Terminology:
    - source = existing snapshot or bookmark
    - new/bmark = new bookmark
- Implement bookmark copying in `dsl_bookmark.c`
  - create new bookmark node
  - copy source's `zbn_phys` to new's `zbn_phys`
  - zero-out redaction object id in copy
- Extend existing bookmark ioctl nvlist schema to accept
  bookmarks as sources
  - => `dsl_bookmark_create_nvl_validate` is authoritative
- use `dsl_dataset_is_before` check for both snapshot
  and bookmark sources
- Adjust CLI
  - refactor shortname expansion logic in `zfs_do_bookmark`
- Update man pages
  - warn about redaction bookmark handling
- Add test cases
  - CLI
  - pyyzfs libzfs_core bindings

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Christian Schwarz <me@cschwarz.com>
Closes #9571
2020-02-11 13:19:12 -08:00
..
Makefile.in Unify target_cpu handling 2020-01-17 12:40:09 -08:00
zfeature_common.c Disable sysfs feature checks on FreeBSD 2019-12-06 09:44:29 -08:00
zfs_comutil.c Fix "zpool add -n" for dedup, special and log devices 2020-01-06 15:40:06 -08:00
zfs_deleg.c Remove code for zfs remap 2019-06-24 16:44:01 -07:00
zfs_fletcher_aarch64_neon.c OpenZFS restructuring - move platform specific headers 2019-09-05 09:34:54 -07:00
zfs_fletcher_avx512.c Add AVX512BW variant of fletcher 2019-10-30 12:26:14 -07:00
zfs_fletcher_intel.c OpenZFS restructuring - move platform specific headers 2019-09-05 09:34:54 -07:00
zfs_fletcher_sse.c OpenZFS restructuring - move platform specific headers 2019-09-05 09:34:54 -07:00
zfs_fletcher_superscalar4.c Update build system and packaging 2018-05-29 16:00:33 -07:00
zfs_fletcher_superscalar.c Update build system and packaging 2018-05-29 16:00:33 -07:00
zfs_fletcher.c Wrap module_param_call() routines under __linux__ 2019-12-03 09:56:15 -08:00
zfs_namecheck.c Implement bookmark copying 2020-02-11 13:19:12 -08:00
zfs_prop.c Restore aclmode and remove acltype on FreeBSD 2020-02-04 08:40:07 -08:00
zfs_uio.c Linux 5.0 compat: access_ok() drops 'type' parameter 2019-01-28 10:11:10 -08:00
zpool_prop.c Fix typos in module/ 2019-08-30 14:32:18 -07:00
zprop_common.c Left-align index props 2020-01-31 08:55:51 -08:00