mirror_zfs/lib
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
..
libavl OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libefi cppcheck: (error) Memory leak: vtoc 2019-12-18 17:25:04 -08:00
libicp ICP: Improve AES-GCM performance 2020-02-10 12:59:50 -08:00
libnvpair Use correct format string when printing int8 2019-10-20 20:37:30 -07:00
libshare Fix static data to link with -fno-common 2020-02-06 09:25:29 -08:00
libspl ICP: Improve AES-GCM performance 2020-02-10 12:59:50 -08:00
libtpool OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libunicode OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libuutil Remove unused headers from uu_string.c 2019-10-25 13:53:50 -07:00
libzfs Disable get_numeric_property for xattr on FreeBSD 2020-01-21 15:06:10 -08:00
libzfs_core Implement bookmark copying 2020-02-11 13:19:12 -08:00
libzpool async zvol minor node creation interferes with receive 2020-02-03 09:33:14 -08:00
libzutil Add wrapper stub for zfs_cmd ioctl to libzpool 2019-11-12 10:40:39 -08:00
Makefile.am Add libzutil for libzfs or libzpool consumers 2018-11-05 11:22:33 -08:00