diff options
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/Makefile.am | 1 | ||||
-rw-r--r-- | include/sys/dsl_bookmark.h | 51 | ||||
-rw-r--r-- | include/sys/dsl_dataset.h | 12 | ||||
-rw-r--r-- | include/sys/dsl_deleg.h | 3 | ||||
-rw-r--r-- | include/sys/fs/zfs.h | 14 |
5 files changed, 74 insertions, 7 deletions
diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am index 4115c6d8f..90f3cce1b 100644 --- a/include/sys/Makefile.am +++ b/include/sys/Makefile.am @@ -17,6 +17,7 @@ COMMON_H = \ $(top_srcdir)/include/sys/dmu_tx.h \ $(top_srcdir)/include/sys/dmu_zfetch.h \ $(top_srcdir)/include/sys/dnode.h \ + $(top_srcdir)/include/sys/dsl_bookmark.h \ $(top_srcdir)/include/sys/dsl_dataset.h \ $(top_srcdir)/include/sys/dsl_deadlist.h \ $(top_srcdir)/include/sys/dsl_deleg.h \ diff --git a/include/sys/dsl_bookmark.h b/include/sys/dsl_bookmark.h new file mode 100644 index 000000000..3591986d7 --- /dev/null +++ b/include/sys/dsl_bookmark.h @@ -0,0 +1,51 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +#ifndef _SYS_DSL_BOOKMARK_H +#define _SYS_DSL_BOOKMARK_H + +#include <sys/zfs_context.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct dsl_pool; +struct dsl_dataset; + +/* + * On disk zap object. + */ +typedef struct zfs_bookmark_phys { + uint64_t zbm_guid; /* guid of bookmarked dataset */ + uint64_t zbm_creation_txg; /* birth transaction group */ + uint64_t zbm_creation_time; /* bookmark creation time */ +} zfs_bookmark_phys_t; + +int dsl_bookmark_create(nvlist_t *, nvlist_t *); +int dsl_get_bookmarks(const char *, nvlist_t *, nvlist_t *); +int dsl_get_bookmarks_impl(dsl_dataset_t *, nvlist_t *, nvlist_t *); +int dsl_bookmark_destroy(nvlist_t *, nvlist_t *); +int dsl_bookmark_lookup(struct dsl_pool *, const char *, + struct dsl_dataset *, zfs_bookmark_phys_t *); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_DSL_BOOKMARK_H */ diff --git a/include/sys/dsl_dataset.h b/include/sys/dsl_dataset.h index 27ef405e0..4979ae615 100644 --- a/include/sys/dsl_dataset.h +++ b/include/sys/dsl_dataset.h @@ -76,6 +76,13 @@ struct dsl_pool; */ /* + * This field's value is the object ID of a zap object which contains the + * bookmarks of this dataset. If it is present, then this dataset is counted + * in the refcount of the SPA_FEATURES_BOOKMARKS feature. + */ +#define DS_FIELD_BOOKMARK_NAMES "com.delphix:bookmarks" + +/* * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose * name lookups should be performed case-insensitively. */ @@ -127,6 +134,7 @@ typedef struct dsl_dataset { /* only used in syncing context, only valid for non-snapshots: */ struct dsl_dataset *ds_prev; + uint64_t ds_bookmarks; /* DMU_OTN_ZAP_METADATA */ /* has internal locking: */ dsl_deadlist_t ds_deadlist; @@ -247,7 +255,8 @@ int dsl_dataset_set_refquota(const char *dsname, zprop_source_t source, int dsl_dataset_set_refreservation(const char *dsname, zprop_source_t source, uint64_t reservation); -boolean_t dsl_dataset_is_before(dsl_dataset_t *later, dsl_dataset_t *earlier); +boolean_t dsl_dataset_is_before(dsl_dataset_t *later, dsl_dataset_t *earlier, + uint64_t earlier_txg); void dsl_dataset_long_hold(dsl_dataset_t *ds, void *tag); void dsl_dataset_long_rele(dsl_dataset_t *ds, void *tag); boolean_t dsl_dataset_long_held(dsl_dataset_t *ds); @@ -270,6 +279,7 @@ int dsl_dataset_snap_lookup(dsl_dataset_t *ds, const char *name, int dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx); void dsl_dataset_set_refreservation_sync_impl(dsl_dataset_t *ds, zprop_source_t source, uint64_t value, dmu_tx_t *tx); +void dsl_dataset_zapify(dsl_dataset_t *ds, dmu_tx_t *tx); int dsl_dataset_rollback(const char *fsname, void *owner, nvlist_t *result); #ifdef ZFS_DEBUG diff --git a/include/sys/dsl_deleg.h b/include/sys/dsl_deleg.h index 5842639aa..59e8e0555 100644 --- a/include/sys/dsl_deleg.h +++ b/include/sys/dsl_deleg.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_DSL_DELEG_H @@ -56,6 +56,7 @@ extern "C" { #define ZFS_DELEG_PERM_HOLD "hold" #define ZFS_DELEG_PERM_RELEASE "release" #define ZFS_DELEG_PERM_DIFF "diff" +#define ZFS_DELEG_PERM_BOOKMARK "bookmark" /* * Note: the names of properties that are marked delegatable are also diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index 7b3ae6cff..53f2718ab 100644 --- a/include/sys/fs/zfs.h +++ b/include/sys/fs/zfs.h @@ -46,10 +46,11 @@ extern "C" { * combined into masks that can be passed to various functions. */ typedef enum { - ZFS_TYPE_FILESYSTEM = 0x1, - ZFS_TYPE_SNAPSHOT = 0x2, - ZFS_TYPE_VOLUME = 0x4, - ZFS_TYPE_POOL = 0x8 + ZFS_TYPE_FILESYSTEM = (1 << 0), + ZFS_TYPE_SNAPSHOT = (1 << 1), + ZFS_TYPE_VOLUME = (1 << 2), + ZFS_TYPE_POOL = (1 << 3), + ZFS_TYPE_BOOKMARK = (1 << 4) } zfs_type_t; typedef enum dmu_objset_type { @@ -786,7 +787,7 @@ typedef struct ddt_histogram { */ typedef enum zfs_ioc { /* - * Illumos - 69/128 numbers reserved. + * Illumos - 70/128 numbers reserved. */ ZFS_IOC_FIRST = ('Z' << 8), ZFS_IOC = ZFS_IOC_FIRST, @@ -857,6 +858,9 @@ typedef enum zfs_ioc { ZFS_IOC_SEND_NEW, ZFS_IOC_SEND_SPACE, ZFS_IOC_CLONE, + ZFS_IOC_BOOKMARK, + ZFS_IOC_GET_BOOKMARKS, + ZFS_IOC_DESTROY_BOOKMARKS, /* * Linux - 3/64 numbers reserved. |