]> git.proxmox.com Git - mirror_zfs-debian.git/blobdiff - include/sys/dmu_objset.h
Imported Upstream version 0.6.5.3
[mirror_zfs-debian.git] / include / sys / dmu_objset.h
index 507f73222895c362b151c53da8196dd59017670f..837a0d5107b7f1aa636445a0ec1ebb281bd6167a 100644 (file)
@@ -21,6 +21,8 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  */
 
 /* Portions Copyright 2010 Robert Milkowski */
@@ -43,6 +45,7 @@ extern "C" {
 
 extern krwlock_t os_lock;
 
+struct dsl_pool;
 struct dsl_dataset;
 struct dmu_tx;
 
@@ -72,26 +75,30 @@ struct objset {
        arc_buf_t *os_phys_buf;
        objset_phys_t *os_phys;
        /*
-        * The following "special" dnodes have no parent and are exempt from
-        * dnode_move(), but they root their descendents in this objset using
-        * handles anyway, so that all access to dnodes from dbufs consistently
-        * uses handles.
+        * The following "special" dnodes have no parent, are exempt
+        * from dnode_move(), and are not recorded in os_dnodes, but they
+        * root their descendents in this objset using handles anyway, so
+        * that all access to dnodes from dbufs consistently uses handles.
         */
        dnode_handle_t os_meta_dnode;
        dnode_handle_t os_userused_dnode;
        dnode_handle_t os_groupused_dnode;
        zilog_t *os_zil;
 
+       list_node_t os_evicting_node;
+
        /* can change, under dsl_dir's locks: */
-       uint8_t os_checksum;
-       uint8_t os_compress;
+       enum zio_checksum os_checksum;
+       enum zio_compress os_compress;
        uint8_t os_copies;
-       uint8_t os_dedup_checksum;
-       uint8_t os_dedup_verify;
-       uint8_t os_logbias;
-       uint8_t os_primary_cache;
-       uint8_t os_secondary_cache;
-       uint8_t os_sync;
+       enum zio_checksum os_dedup_checksum;
+       boolean_t os_dedup_verify;
+       zfs_logbias_op_t os_logbias;
+       zfs_cache_type_t os_primary_cache;
+       zfs_cache_type_t os_secondary_cache;
+       zfs_sync_type_t os_sync;
+       zfs_redundant_metadata_type_t os_redundant_metadata;
+       int os_recordsize;
 
        /* no lock needed: */
        struct dmu_tx *os_synctx; /* XXX sketchy */
@@ -114,8 +121,6 @@ struct objset {
        /* stuff we store for the user */
        kmutex_t os_user_ptr_lock;
        void *os_user_ptr;
-
-       /* SA layout/attribute registration */
        sa_os_t *os_sa;
 };
 
@@ -136,29 +141,22 @@ struct objset {
 int dmu_objset_hold(const char *name, void *tag, objset_t **osp);
 int dmu_objset_own(const char *name, dmu_objset_type_t type,
     boolean_t readonly, void *tag, objset_t **osp);
+int dmu_objset_own_obj(struct dsl_pool *dp, uint64_t obj,
+    dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp);
+void dmu_objset_refresh_ownership(objset_t *os, void *tag);
 void dmu_objset_rele(objset_t *os, void *tag);
 void dmu_objset_disown(objset_t *os, void *tag);
 int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp);
 
-int dmu_objset_create(const char *name, dmu_objset_type_t type, uint64_t flags,
-    void (*func)(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx), void *arg);
-int dmu_objset_clone(const char *name, struct dsl_dataset *clone_origin,
-    uint64_t flags);
-int dmu_objset_destroy(const char *name, boolean_t defer);
-int dmu_objset_snapshot(char *fsname, char *snapname, char *tag,
-    struct nvlist *props, boolean_t recursive, boolean_t temporary, int fd);
 void dmu_objset_stats(objset_t *os, nvlist_t *nv);
 void dmu_objset_fast_stat(objset_t *os, dmu_objset_stats_t *stat);
 void dmu_objset_space(objset_t *os, uint64_t *refdbytesp, uint64_t *availbytesp,
     uint64_t *usedobjsp, uint64_t *availobjsp);
 uint64_t dmu_objset_fsid_guid(objset_t *os);
-int dmu_objset_find(char *name, int func(const char *, void *), void *arg,
-    int flags);
-int dmu_objset_find_spa(spa_t *spa, const char *name,
-    int func(spa_t *, uint64_t, const char *, void *), void *arg, int flags);
-int dmu_objset_prefetch(const char *name, void *arg);
-void dmu_objset_byteswap(void *buf, size_t size);
-int dmu_objset_evict_dbufs(objset_t *os);
+int dmu_objset_find_dp(struct dsl_pool *dp, uint64_t ddobj,
+    int func(struct dsl_pool *, struct dsl_dataset *, void *),
+    void *arg, int flags);
+void dmu_objset_evict_dbufs(objset_t *os);
 timestruc_t dmu_objset_snap_cmtime(objset_t *os);
 
 /* called from dsl */
@@ -174,6 +172,9 @@ void dmu_objset_userquota_get_ids(dnode_t *dn, boolean_t before, dmu_tx_t *tx);
 boolean_t dmu_objset_userused_enabled(objset_t *os);
 int dmu_objset_userspace_upgrade(objset_t *os);
 boolean_t dmu_objset_userspace_present(objset_t *os);
+int dmu_fsname(const char *snapname, char *buf);
+
+void dmu_objset_evict_done(objset_t *os);
 
 void dmu_objset_init(void);
 void dmu_objset_fini(void);