]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Add linux kernel module support
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Aug 2010 18:49:16 +0000 (11:49 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 Aug 2010 20:41:58 +0000 (13:41 -0700)
Setup linux kernel module support, this includes:
- zfs context for kernel/user
- kernel module build system integration
- kernel module macros
- kernel module symbol export
- kernel module options

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
40 files changed:
module/avl/avl.c
module/nvpair/nvpair.c
module/nvpair/nvpair_alloc_fixed.c
module/nvpair/nvpair_alloc_spl.c [new file with mode: 0644]
module/unicode/u8_textprep.c
module/unicode/uconv.c
module/zcommon/zfs_comutil.c
module/zcommon/zfs_deleg.c
module/zcommon/zfs_fletcher.c
module/zcommon/zfs_namecheck.c
module/zcommon/zfs_prop.c
module/zcommon/zpool_prop.c
module/zcommon/zprop_common.c
module/zfs/arc.c
module/zfs/dbuf.c
module/zfs/dmu.c
module/zfs/dmu_object.c
module/zfs/dmu_objset.c
module/zfs/dmu_traverse.c
module/zfs/dmu_tx.c
module/zfs/dmu_zfetch.c
module/zfs/dsl_dataset.c
module/zfs/dsl_deleg.c
module/zfs/dsl_dir.c
module/zfs/dsl_prop.c
module/zfs/dsl_synctask.c
module/zfs/include/sys/spa_impl.h
module/zfs/spa.c
module/zfs/spa_boot.c
module/zfs/spa_config.c
module/zfs/spa_errlog.c
module/zfs/spa_history.c
module/zfs/spa_misc.c
module/zfs/txg.c
module/zfs/vdev.c
module/zfs/vdev_queue.c
module/zfs/zap_micro.c
module/zfs/zfs_byteswap.c
module/zfs/zfs_znode.c
module/zfs/zio.c

index dd39c12d215e9749d01f2a53ab4c77ff67856899..e000647be23886db432d1becd235e9cb7bbc48ed 100644 (file)
@@ -1028,3 +1028,30 @@ done:
 
        return (AVL_NODE2DATA(node, off));
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+
+static int avl_init(void) { return 0; }
+static int avl_fini(void) { return 0; }
+
+spl_module_init(avl_init);
+spl_module_exit(avl_fini);
+
+MODULE_DESCRIPTION("Generic AVL tree implementation");
+MODULE_AUTHOR(ZFS_META_AUTHOR);
+MODULE_LICENSE(ZFS_META_LICENSE);
+
+EXPORT_SYMBOL(avl_create);
+EXPORT_SYMBOL(avl_find);
+EXPORT_SYMBOL(avl_insert);
+EXPORT_SYMBOL(avl_insert_here);
+EXPORT_SYMBOL(avl_walk);
+EXPORT_SYMBOL(avl_first);
+EXPORT_SYMBOL(avl_last);
+EXPORT_SYMBOL(avl_nearest);
+EXPORT_SYMBOL(avl_add);
+EXPORT_SYMBOL(avl_remove);
+EXPORT_SYMBOL(avl_numnodes);
+EXPORT_SYMBOL(avl_destroy_nodes);
+EXPORT_SYMBOL(avl_destroy);
+#endif
index 282e0f8a617020b56183fb6200225e1e27954e5f..5c6898446793d5d429b76d592e5a2ce78e827c88 100644 (file)
@@ -3295,3 +3295,131 @@ nvs_xdr(nvstream_t *nvs, nvlist_t *nvl, char *buf, size_t *buflen)
 
        return (err);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+
+static int nvpair_init(void) { return 0; }
+static int nvpair_fini(void) { return 0; }
+
+spl_module_init(nvpair_init);
+spl_module_exit(nvpair_fini);
+
+MODULE_DESCRIPTION("Generic name/value pair implementation");
+MODULE_AUTHOR(ZFS_META_AUTHOR);
+MODULE_LICENSE(ZFS_META_LICENSE);
+
+EXPORT_SYMBOL(nv_alloc_init);
+EXPORT_SYMBOL(nv_alloc_reset);
+EXPORT_SYMBOL(nv_alloc_fini);
+
+/* list management */
+EXPORT_SYMBOL(nvlist_alloc);
+EXPORT_SYMBOL(nvlist_free);
+EXPORT_SYMBOL(nvlist_size);
+EXPORT_SYMBOL(nvlist_pack);
+EXPORT_SYMBOL(nvlist_unpack);
+EXPORT_SYMBOL(nvlist_dup);
+EXPORT_SYMBOL(nvlist_merge);
+
+EXPORT_SYMBOL(nvlist_xalloc);
+EXPORT_SYMBOL(nvlist_xpack);
+EXPORT_SYMBOL(nvlist_xunpack);
+EXPORT_SYMBOL(nvlist_xdup);
+EXPORT_SYMBOL(nvlist_lookup_nv_alloc);
+
+EXPORT_SYMBOL(nvlist_add_nvpair);
+EXPORT_SYMBOL(nvlist_add_boolean);
+EXPORT_SYMBOL(nvlist_add_boolean_value);
+EXPORT_SYMBOL(nvlist_add_byte);
+EXPORT_SYMBOL(nvlist_add_int8);
+EXPORT_SYMBOL(nvlist_add_uint8);
+EXPORT_SYMBOL(nvlist_add_int16);
+EXPORT_SYMBOL(nvlist_add_uint16);
+EXPORT_SYMBOL(nvlist_add_int32);
+EXPORT_SYMBOL(nvlist_add_uint32);
+EXPORT_SYMBOL(nvlist_add_int64);
+EXPORT_SYMBOL(nvlist_add_uint64);
+EXPORT_SYMBOL(nvlist_add_string);
+EXPORT_SYMBOL(nvlist_add_nvlist);
+EXPORT_SYMBOL(nvlist_add_boolean_array);
+EXPORT_SYMBOL(nvlist_add_byte_array);
+EXPORT_SYMBOL(nvlist_add_int8_array);
+EXPORT_SYMBOL(nvlist_add_uint8_array);
+EXPORT_SYMBOL(nvlist_add_int16_array);
+EXPORT_SYMBOL(nvlist_add_uint16_array);
+EXPORT_SYMBOL(nvlist_add_int32_array);
+EXPORT_SYMBOL(nvlist_add_uint32_array);
+EXPORT_SYMBOL(nvlist_add_int64_array);
+EXPORT_SYMBOL(nvlist_add_uint64_array);
+EXPORT_SYMBOL(nvlist_add_string_array);
+EXPORT_SYMBOL(nvlist_add_nvlist_array);
+EXPORT_SYMBOL(nvlist_next_nvpair);
+EXPORT_SYMBOL(nvlist_prev_nvpair);
+EXPORT_SYMBOL(nvlist_empty);
+EXPORT_SYMBOL(nvlist_add_hrtime);
+
+EXPORT_SYMBOL(nvlist_remove);
+EXPORT_SYMBOL(nvlist_remove_nvpair);
+EXPORT_SYMBOL(nvlist_remove_all);
+
+EXPORT_SYMBOL(nvlist_lookup_boolean);
+EXPORT_SYMBOL(nvlist_lookup_boolean_value);
+EXPORT_SYMBOL(nvlist_lookup_byte);
+EXPORT_SYMBOL(nvlist_lookup_int8);
+EXPORT_SYMBOL(nvlist_lookup_uint8);
+EXPORT_SYMBOL(nvlist_lookup_int16);
+EXPORT_SYMBOL(nvlist_lookup_uint16);
+EXPORT_SYMBOL(nvlist_lookup_int32);
+EXPORT_SYMBOL(nvlist_lookup_uint32);
+EXPORT_SYMBOL(nvlist_lookup_int64);
+EXPORT_SYMBOL(nvlist_lookup_uint64);
+EXPORT_SYMBOL(nvlist_lookup_string);
+EXPORT_SYMBOL(nvlist_lookup_nvlist);
+EXPORT_SYMBOL(nvlist_lookup_boolean_array);
+EXPORT_SYMBOL(nvlist_lookup_byte_array);
+EXPORT_SYMBOL(nvlist_lookup_int8_array);
+EXPORT_SYMBOL(nvlist_lookup_uint8_array);
+EXPORT_SYMBOL(nvlist_lookup_int16_array);
+EXPORT_SYMBOL(nvlist_lookup_uint16_array);
+EXPORT_SYMBOL(nvlist_lookup_int32_array);
+EXPORT_SYMBOL(nvlist_lookup_uint32_array);
+EXPORT_SYMBOL(nvlist_lookup_int64_array);
+EXPORT_SYMBOL(nvlist_lookup_uint64_array);
+EXPORT_SYMBOL(nvlist_lookup_string_array);
+EXPORT_SYMBOL(nvlist_lookup_nvlist_array);
+EXPORT_SYMBOL(nvlist_lookup_hrtime);
+EXPORT_SYMBOL(nvlist_lookup_pairs);
+
+EXPORT_SYMBOL(nvlist_lookup_nvpair);
+EXPORT_SYMBOL(nvlist_exists);
+
+/* processing nvpair */
+EXPORT_SYMBOL(nvpair_name);
+EXPORT_SYMBOL(nvpair_type);
+EXPORT_SYMBOL(nvpair_value_boolean_value);
+EXPORT_SYMBOL(nvpair_value_byte);
+EXPORT_SYMBOL(nvpair_value_int8);
+EXPORT_SYMBOL(nvpair_value_uint8);
+EXPORT_SYMBOL(nvpair_value_int16);
+EXPORT_SYMBOL(nvpair_value_uint16);
+EXPORT_SYMBOL(nvpair_value_int32);
+EXPORT_SYMBOL(nvpair_value_uint32);
+EXPORT_SYMBOL(nvpair_value_int64);
+EXPORT_SYMBOL(nvpair_value_uint64);
+EXPORT_SYMBOL(nvpair_value_string);
+EXPORT_SYMBOL(nvpair_value_nvlist);
+EXPORT_SYMBOL(nvpair_value_boolean_array);
+EXPORT_SYMBOL(nvpair_value_byte_array);
+EXPORT_SYMBOL(nvpair_value_int8_array);
+EXPORT_SYMBOL(nvpair_value_uint8_array);
+EXPORT_SYMBOL(nvpair_value_int16_array);
+EXPORT_SYMBOL(nvpair_value_uint16_array);
+EXPORT_SYMBOL(nvpair_value_int32_array);
+EXPORT_SYMBOL(nvpair_value_uint32_array);
+EXPORT_SYMBOL(nvpair_value_int64_array);
+EXPORT_SYMBOL(nvpair_value_uint64_array);
+EXPORT_SYMBOL(nvpair_value_string_array);
+EXPORT_SYMBOL(nvpair_value_nvlist_array);
+EXPORT_SYMBOL(nvpair_value_hrtime);
+
+#endif
index 33e3c0d00705ee432e8f95f005d8552185c95126..20081ba56c4d5c937b089baa5c0e6e6b27169664 100644 (file)
@@ -118,3 +118,7 @@ const nv_alloc_ops_t nv_fixed_ops_def = {
 };
 
 const nv_alloc_ops_t *nv_fixed_ops = &nv_fixed_ops_def;
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(nv_fixed_ops);
+#endif
diff --git a/module/nvpair/nvpair_alloc_spl.c b/module/nvpair/nvpair_alloc_spl.c
new file mode 100644 (file)
index 0000000..d26d269
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License").  You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at * usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/nvpair.h>
+#include <sys/kmem.h>
+
+static void *
+nv_alloc_sleep_spl(nv_alloc_t *nva, size_t size)
+{
+       return (kmem_alloc(size, KM_SLEEP));
+}
+
+static void *
+nv_alloc_nosleep_spl(nv_alloc_t *nva, size_t size)
+{
+       return (kmem_alloc(size, KM_NOSLEEP));
+}
+
+static void
+nv_free_spl(nv_alloc_t *nva, void *buf, size_t size)
+{
+       kmem_free(buf, size);
+}
+
+const nv_alloc_ops_t spl_sleep_ops_def = {
+       NULL,                   /* nv_ao_init() */
+       NULL,                   /* nv_ao_fini() */
+       nv_alloc_sleep_spl,     /* nv_ao_alloc() */
+       nv_free_spl,            /* nv_ao_free() */
+       NULL                    /* nv_ao_reset() */
+};
+
+const nv_alloc_ops_t spl_nosleep_ops_def = {
+       NULL,                   /* nv_ao_init() */
+       NULL,                   /* nv_ao_fini() */
+       nv_alloc_nosleep_spl,   /* nv_ao_alloc() */
+       nv_free_spl,            /* nv_ao_free() */
+       NULL                    /* nv_ao_reset() */
+};
+
+nv_alloc_t nv_alloc_sleep_def = {
+       &spl_sleep_ops_def,
+       NULL
+};
+
+nv_alloc_t nv_alloc_nosleep_def = {
+       &spl_nosleep_ops_def,
+       NULL
+};
+
+nv_alloc_t *nv_alloc_sleep = &nv_alloc_sleep_def;
+nv_alloc_t *nv_alloc_nosleep = &nv_alloc_nosleep_def;
index 2532769c86f868de684a1e335f69ae9454a799df..df6dcf552b4546bcc04aede991653ae052807867 100644 (file)
@@ -2131,3 +2131,20 @@ u8_textprep_str(char *inarray, size_t *inlen, char *outarray, size_t *outlen,
 
        return (ret_val);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+
+static int unicode_init(void) { return 0; }
+static int unicode_fini(void) { return 0; }
+
+spl_module_init(unicode_init);
+spl_module_exit(unicode_fini);
+
+MODULE_DESCRIPTION("Unicode implementation");
+MODULE_AUTHOR(ZFS_META_AUTHOR);
+MODULE_LICENSE(ZFS_META_LICENSE);
+
+EXPORT_SYMBOL(u8_validate);
+EXPORT_SYMBOL(u8_strcmp);
+EXPORT_SYMBOL(u8_textprep_str);
+#endif
index b996e1f60e09529449bb6a873ac505feac06a2d6..7a827832262aac13a7666154bffddc01d2d181e6 100644 (file)
@@ -853,3 +853,12 @@ uconv_u8tou32(const uchar_t *u8s, size_t *utf8len,
 
        return (0);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(uconv_u16tou32);
+EXPORT_SYMBOL(uconv_u16tou8);
+EXPORT_SYMBOL(uconv_u32tou16);
+EXPORT_SYMBOL(uconv_u32tou8);
+EXPORT_SYMBOL(uconv_u8tou16);
+EXPORT_SYMBOL(uconv_u8tou32);
+#endif
index ed9b67ea3bc9f41fa08ab2cd4d9d1f44f2b9657e..ccf169be6dae1484ef047a33154f79529a97d003 100644 (file)
@@ -200,3 +200,11 @@ const char *zfs_history_event_names[LOG_END] = {
        "user release",
        "pool split",
 };
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(zfs_allocatable_devs);
+EXPORT_SYMBOL(zpool_get_rewind_policy);
+EXPORT_SYMBOL(zfs_zpl_version_map);
+EXPORT_SYMBOL(zfs_spa_version_map);
+EXPORT_SYMBOL(zfs_history_event_names);
+#endif
index a4aa77adbf1588f6210853b15363a70c1124468f..6754ab84bea5e3c793da2d5fb6c8d2bcf5541cf9 100644 (file)
@@ -235,3 +235,9 @@ zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
                ASSERT(!"bad zfs_deleg_who_type_t");
        }
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(zfs_deleg_verify_nvlist);
+EXPORT_SYMBOL(zfs_deleg_whokey);
+EXPORT_SYMBOL(zfs_deleg_canonicalize_perm);
+#endif
index fa43ce6bdb5dd1d625896fe73d0cbd84d2631d69..edd0cbe6c6117c0e15e1ade541b8fccfafa9d10e 100644 (file)
@@ -244,3 +244,12 @@ fletcher_4_incremental_byteswap(const void *buf, uint64_t size,
 
        ZIO_SET_CHECKSUM(zcp, a, b, c, d);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(fletcher_2_native);
+EXPORT_SYMBOL(fletcher_2_byteswap);
+EXPORT_SYMBOL(fletcher_4_native);
+EXPORT_SYMBOL(fletcher_4_byteswap);
+EXPORT_SYMBOL(fletcher_4_incremental_native);
+EXPORT_SYMBOL(fletcher_4_incremental_byteswap);
+#endif
index 2398c2755cc7aa306a611b408dcb9455113cd4bd..8508bc73442c40cba0d5c36280880c12f42eff5d 100644 (file)
@@ -370,3 +370,9 @@ pool_namecheck(const char *pool, namecheck_err_t *why, char *what)
 
        return (0);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(snapshot_namecheck);
+EXPORT_SYMBOL(pool_namecheck);
+EXPORT_SYMBOL(dataset_namecheck);
+#endif
index f29bcf62718f05d5ef3411b648b574bff6489584..ce03a498c701f6b0b4c4c9d4eb3fc60d21c41792 100644 (file)
@@ -593,3 +593,38 @@ zfs_prop_align_right(zfs_prop_t prop)
 }
 
 #endif
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+
+static int zcommon_init(void) { return 0; }
+static int zcommon_fini(void) { return 0; }
+
+spl_module_init(zcommon_init);
+spl_module_exit(zcommon_fini);
+
+MODULE_DESCRIPTION("Generic ZFS support");
+MODULE_AUTHOR(ZFS_META_AUTHOR);
+MODULE_LICENSE(ZFS_META_LICENSE);
+
+/* zfs dataset property functions */
+EXPORT_SYMBOL(zfs_userquota_prop_prefixes);
+EXPORT_SYMBOL(zfs_prop_init);
+EXPORT_SYMBOL(zfs_prop_get_type);
+EXPORT_SYMBOL(zfs_prop_get_table);
+EXPORT_SYMBOL(zfs_prop_delegatable);
+
+/* Dataset property functions shared between libzfs and kernel. */
+EXPORT_SYMBOL(zfs_prop_default_string);
+EXPORT_SYMBOL(zfs_prop_default_numeric);
+EXPORT_SYMBOL(zfs_prop_readonly);
+EXPORT_SYMBOL(zfs_prop_inheritable);
+EXPORT_SYMBOL(zfs_prop_setonce);
+EXPORT_SYMBOL(zfs_prop_to_name);
+EXPORT_SYMBOL(zfs_name_to_prop);
+EXPORT_SYMBOL(zfs_prop_user);
+EXPORT_SYMBOL(zfs_prop_userquota);
+EXPORT_SYMBOL(zfs_prop_index_to_string);
+EXPORT_SYMBOL(zfs_prop_string_to_index);
+EXPORT_SYMBOL(zfs_prop_valid_for_type);
+
+#endif
index 988d05de6e209ee3fffe0b6e97e878386d9c2928..37d977f47f6cf5a071f23093392b9b45cd24d259 100644 (file)
@@ -200,3 +200,19 @@ zpool_prop_align_right(zpool_prop_t prop)
        return (zpool_prop_table[prop].pd_rightalign);
 }
 #endif
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+/* zpool property functions */
+EXPORT_SYMBOL(zpool_prop_init);
+EXPORT_SYMBOL(zpool_prop_get_type);
+EXPORT_SYMBOL(zpool_prop_get_table);
+
+/* Pool property functions shared between libzfs and kernel. */
+EXPORT_SYMBOL(zpool_name_to_prop);
+EXPORT_SYMBOL(zpool_prop_to_name);
+EXPORT_SYMBOL(zpool_prop_default_string);
+EXPORT_SYMBOL(zpool_prop_default_numeric);
+EXPORT_SYMBOL(zpool_prop_readonly);
+EXPORT_SYMBOL(zpool_prop_index_to_string);
+EXPORT_SYMBOL(zpool_prop_string_to_index);
+#endif
index df2fdeab8ba1897122df63c70178f907ab11bb4e..ab5b4662b79c4250798a68aeb11c8bf4836a0bcf 100644 (file)
@@ -424,3 +424,21 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type)
 }
 
 #endif
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+/* Common routines to initialize property tables */
+EXPORT_SYMBOL(zprop_register_impl);
+EXPORT_SYMBOL(zprop_register_string);
+EXPORT_SYMBOL(zprop_register_number);
+EXPORT_SYMBOL(zprop_register_index);
+EXPORT_SYMBOL(zprop_register_hidden);
+
+/* Common routines for zfs and zpool property management */
+EXPORT_SYMBOL(zprop_iter_common);
+EXPORT_SYMBOL(zprop_name_to_prop);
+EXPORT_SYMBOL(zprop_string_to_index);
+EXPORT_SYMBOL(zprop_index_to_string);
+EXPORT_SYMBOL(zprop_random_value);
+EXPORT_SYMBOL(zprop_values);
+EXPORT_SYMBOL(zprop_valid_for_type);
+#endif
index f1d51805b19fd63a490462a93037ce2469b33523..f8dfee2cc1d574234c5e2e989b44e8df52bb0661 100644 (file)
@@ -174,9 +174,9 @@ static boolean_t arc_warm;
 /*
  * These tunables are for performance analysis.
  */
-uint64_t zfs_arc_max;
-uint64_t zfs_arc_min;
-uint64_t zfs_arc_meta_limit = 0;
+unsigned long zfs_arc_max = 0;
+unsigned long zfs_arc_min = 0;
+unsigned long zfs_arc_meta_limit = 0;
 int zfs_arc_grow_retry = 0;
 int zfs_arc_shrink_shift = 0;
 int zfs_arc_p_min_shift = 0;
@@ -4680,3 +4680,18 @@ l2arc_stop(void)
                cv_wait(&l2arc_feed_thr_cv, &l2arc_feed_thr_lock);
        mutex_exit(&l2arc_feed_thr_lock);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(arc_read);
+EXPORT_SYMBOL(arc_buf_remove_ref);
+EXPORT_SYMBOL(arc_getbuf_func);
+
+module_param(zfs_arc_min, ulong, 0644);
+MODULE_PARM_DESC(zfs_arc_min, "Minimum arc size");
+
+module_param(zfs_arc_max, ulong, 0644);
+MODULE_PARM_DESC(zfs_arc_max, "Maximum arc size");
+
+module_param(zfs_arc_meta_limit, ulong, 0644);
+MODULE_PARM_DESC(zfs_arc_meta_limit, "Meta limit for arc size");
+#endif
index fb7d0ac86eca1a3064708cc58b25b295b3cfd009..1ebac4ee6da7c4c14196b0167884d9b46e2f7703 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <sys/zfs_context.h>
+#include <sys/arc.h>
 #include <sys/dmu.h>
 #include <sys/dmu_impl.h>
 #include <sys/dbuf.h>
@@ -2816,3 +2817,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx)
                    ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb);
        }
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dmu_buf_rele);
+EXPORT_SYMBOL(dmu_buf_will_dirty);
+#endif
index fea9cd5027d49e0c8daf0b001fa5721fa6e9c9d1..aaeec418d1681b06ce5c7220dc724c9718116a97 100644 (file)
@@ -1829,3 +1829,22 @@ dmu_fini(void)
        sa_cache_fini();
        zfs_dbgmsg_fini();
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dmu_bonus_hold);
+EXPORT_SYMBOL(dmu_free_range);
+EXPORT_SYMBOL(dmu_read);
+EXPORT_SYMBOL(dmu_write);
+
+/* Get information on a DMU object. */
+EXPORT_SYMBOL(dmu_object_info);
+EXPORT_SYMBOL(dmu_object_info_from_dnode);
+EXPORT_SYMBOL(dmu_object_info_from_db);
+EXPORT_SYMBOL(dmu_object_size_from_db);
+
+EXPORT_SYMBOL(dmu_object_set_blocksize);
+EXPORT_SYMBOL(dmu_object_set_checksum);
+EXPORT_SYMBOL(dmu_object_set_compress);
+
+EXPORT_SYMBOL(dmu_ot);
+#endif
index 8dff46048902d44b48aec40b26a061e7593e94bf..8bb3eb4b0e7bd556a1759402546b5641953ff53e 100644 (file)
@@ -194,3 +194,11 @@ dmu_object_next(objset_t *os, uint64_t *objectp, boolean_t hole, uint64_t txg)
 
        return (error);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dmu_object_alloc);
+EXPORT_SYMBOL(dmu_object_claim);
+EXPORT_SYMBOL(dmu_object_reclaim);
+EXPORT_SYMBOL(dmu_object_free);
+EXPORT_SYMBOL(dmu_object_next);
+#endif
index 1dcfb02c529dc5e8ff365a19d9e32c8cf7ac5df1..7da5c1aa08f5b5321e8575c333fb38816e8c52e8 100644 (file)
@@ -910,8 +910,10 @@ dmu_objset_snapshot_one(const char *name, void *arg)
         * permission checks for the starting dataset have already been
         * performed in zfs_secpolicy_snapshot()
         */
+#ifdef HAVE_ZPL
        if (sn->recursive && (err = zfs_secpolicy_snapshot_perms(name, CRED())))
                return (err);
+#endif
 
        err = dmu_objset_hold(name, sn, &os);
        if (err != 0)
@@ -1796,3 +1798,39 @@ dmu_objset_get_user(objset_t *os)
        ASSERT(MUTEX_HELD(&os->os_user_ptr_lock));
        return (os->os_user_ptr);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dmu_objset_pool);
+EXPORT_SYMBOL(dmu_objset_name);
+EXPORT_SYMBOL(dmu_objset_hold);
+EXPORT_SYMBOL(dmu_objset_own);
+EXPORT_SYMBOL(dmu_objset_rele);
+EXPORT_SYMBOL(dmu_objset_disown);
+EXPORT_SYMBOL(dmu_objset_from_ds);
+EXPORT_SYMBOL(dmu_objset_create);
+EXPORT_SYMBOL(dmu_objset_clone);
+EXPORT_SYMBOL(dmu_objset_destroy);
+EXPORT_SYMBOL(dmu_objset_snapshot);
+EXPORT_SYMBOL(dmu_objset_stats);
+EXPORT_SYMBOL(dmu_objset_fast_stat);
+EXPORT_SYMBOL(dmu_objset_space);
+EXPORT_SYMBOL(dmu_objset_fsid_guid);
+EXPORT_SYMBOL(dmu_objset_find);
+EXPORT_SYMBOL(dmu_objset_find_spa);
+EXPORT_SYMBOL(dmu_objset_prefetch);
+EXPORT_SYMBOL(dmu_objset_byteswap);
+EXPORT_SYMBOL(dmu_objset_evict_dbufs);
+EXPORT_SYMBOL(dmu_objset_snap_cmtime);
+
+EXPORT_SYMBOL(dmu_objset_sync);
+EXPORT_SYMBOL(dmu_objset_is_dirty);
+EXPORT_SYMBOL(dmu_objset_create_impl);
+EXPORT_SYMBOL(dmu_objset_open_impl);
+EXPORT_SYMBOL(dmu_objset_evict);
+EXPORT_SYMBOL(dmu_objset_register_type);
+EXPORT_SYMBOL(dmu_objset_do_userquota_updates);
+EXPORT_SYMBOL(dmu_objset_userquota_get_ids);
+EXPORT_SYMBOL(dmu_objset_userused_enabled);
+EXPORT_SYMBOL(dmu_objset_userspace_upgrade);
+EXPORT_SYMBOL(dmu_objset_userspace_present);
+#endif
index ee7eb5f8a91b99b47e174ba3f7796ddc8a3eb8c4..775bb83583787313835ce2d83241d64a6ce87ab6 100644 (file)
@@ -567,3 +567,8 @@ traverse_pool(spa_t *spa, uint64_t txg_start, int flags,
                err = 0;
        return (err != 0 ? err : lasterr);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(traverse_dataset);
+EXPORT_SYMBOL(traverse_pool);
+#endif
index 91dc01e91c9e9f43af75957c59f974d36b3f3da9..fa64b3af602bb558e824f638e0b3d2f8bf785e7c 100644 (file)
@@ -1381,3 +1381,21 @@ dmu_tx_hold_sa(dmu_tx_t *tx, sa_handle_t *hdl, boolean_t may_grow)
                DB_DNODE_EXIT(db);
        }
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dmu_tx_create);
+EXPORT_SYMBOL(dmu_tx_hold_write);
+EXPORT_SYMBOL(dmu_tx_hold_free);
+EXPORT_SYMBOL(dmu_tx_hold_zap);
+EXPORT_SYMBOL(dmu_tx_hold_bonus);
+EXPORT_SYMBOL(dmu_tx_abort);
+EXPORT_SYMBOL(dmu_tx_assign);
+EXPORT_SYMBOL(dmu_tx_wait);
+EXPORT_SYMBOL(dmu_tx_commit);
+EXPORT_SYMBOL(dmu_tx_get_txg);
+EXPORT_SYMBOL(dmu_tx_callback_register);
+EXPORT_SYMBOL(dmu_tx_do_callbacks);
+EXPORT_SYMBOL(dmu_tx_hold_spill);
+EXPORT_SYMBOL(dmu_tx_hold_sa_create);
+EXPORT_SYMBOL(dmu_tx_hold_sa);
+#endif
index 4a1b1f4a7f4fc9b21595366ac703d0ebbeb16d51..b36c30fc62783309118c547c961b91dff07478cd 100644 (file)
@@ -722,3 +722,9 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset, uint64_t size, int prefetched)
                }
        }
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+module_param(zfs_prefetch_disable, int, 0644);
+MODULE_PARM_DESC(zfs_prefetch_disable, "Disable all ZFS prefetching");
+#endif
+
index 96a8b667f3d3ed276072ca8e2853090e37c7de11..dfccede04199ad1e9d6a04ec2851ad63a97a24ac 100644 (file)
@@ -2364,13 +2364,16 @@ dsl_snapshot_rename_one(const char *name, void *arg)
         * For recursive snapshot renames the parent won't be changing
         * so we just pass name for both the to/from argument.
         */
+#ifdef HAVE_ZPL
        err = zfs_secpolicy_rename_perms(snapname, snapname, CRED());
        if (err != 0) {
                strfree(snapname);
                return (err == ENOENT ? 0 : err);
        }
+#endif
 
-#ifdef _KERNEL
+/* XXX: Ignore for SPL version until mounting the FS is supported */
+#if defined(_KERNEL) && !defined(HAVE_SPL)
        /*
         * For all filesystems undergoing rename, we'll need to unmount it.
         */
@@ -4036,3 +4039,51 @@ dsl_destroy_inconsistent(const char *dsname, void *arg)
        }
        return (0);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dsl_dataset_hold);
+EXPORT_SYMBOL(dsl_dataset_hold_obj);
+EXPORT_SYMBOL(dsl_dataset_own);
+EXPORT_SYMBOL(dsl_dataset_own_obj);
+EXPORT_SYMBOL(dsl_dataset_name);
+EXPORT_SYMBOL(dsl_dataset_rele);
+EXPORT_SYMBOL(dsl_dataset_disown);
+EXPORT_SYMBOL(dsl_dataset_drop_ref);
+EXPORT_SYMBOL(dsl_dataset_tryown);
+EXPORT_SYMBOL(dsl_dataset_make_exclusive);
+EXPORT_SYMBOL(dsl_dataset_create_sync);
+EXPORT_SYMBOL(dsl_dataset_create_sync_dd);
+EXPORT_SYMBOL(dsl_dataset_destroy);
+EXPORT_SYMBOL(dsl_snapshots_destroy);
+EXPORT_SYMBOL(dsl_dataset_destroy_check);
+EXPORT_SYMBOL(dsl_dataset_destroy_sync);
+EXPORT_SYMBOL(dsl_dataset_snapshot_check);
+EXPORT_SYMBOL(dsl_dataset_snapshot_sync);
+EXPORT_SYMBOL(dsl_dataset_rename);
+EXPORT_SYMBOL(dsl_dataset_promote);
+EXPORT_SYMBOL(dsl_dataset_clone_swap);
+EXPORT_SYMBOL(dsl_dataset_user_hold);
+EXPORT_SYMBOL(dsl_dataset_user_release);
+EXPORT_SYMBOL(dsl_dataset_user_release_tmp);
+EXPORT_SYMBOL(dsl_dataset_get_holds);
+EXPORT_SYMBOL(dsl_dataset_get_blkptr);
+EXPORT_SYMBOL(dsl_dataset_set_blkptr);
+EXPORT_SYMBOL(dsl_dataset_get_spa);
+EXPORT_SYMBOL(dsl_dataset_modified_since_lastsnap);
+EXPORT_SYMBOL(dsl_dataset_sync);
+EXPORT_SYMBOL(dsl_dataset_block_born);
+EXPORT_SYMBOL(dsl_dataset_block_kill);
+EXPORT_SYMBOL(dsl_dataset_block_freeable);
+EXPORT_SYMBOL(dsl_dataset_prev_snap_txg);
+EXPORT_SYMBOL(dsl_dataset_dirty);
+EXPORT_SYMBOL(dsl_dataset_stats);
+EXPORT_SYMBOL(dsl_dataset_fast_stat);
+EXPORT_SYMBOL(dsl_dataset_space);
+EXPORT_SYMBOL(dsl_dataset_fsid_guid);
+EXPORT_SYMBOL(dsl_dsobj_to_dsname);
+EXPORT_SYMBOL(dsl_dataset_check_quota);
+EXPORT_SYMBOL(dsl_dataset_set_quota);
+EXPORT_SYMBOL(dsl_dataset_set_quota_sync);
+EXPORT_SYMBOL(dsl_dataset_set_reservation);
+EXPORT_SYMBOL(dsl_destroy_inconsistent);
+#endif
index 23c8baf94f59a5d618d122ec29e3c11ac602913b..6b5c8424a68772abccae9152af5d61da5c7b1121 100644 (file)
@@ -753,3 +753,8 @@ dsl_delegation_on(objset_t *os)
 {
        return (!!spa_delegation(os->os_spa));
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dsl_deleg_get);
+EXPORT_SYMBOL(dsl_deleg_set);
+#endif
index 6ebf17f7079a8c5e7afdbef4fe1d6b90bc1a0bdf..224cc0a3c423abced2c0907a5059d21ae14788ca 100644 (file)
@@ -1419,3 +1419,10 @@ dsl_dir_snap_cmtime_update(dsl_dir_t *dd)
        dd->dd_snap_cmtime = t;
        mutex_exit(&dd->dd_lock);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dsl_dir_set_quota);
+EXPORT_SYMBOL(dsl_dir_set_reservation);
+EXPORT_SYMBOL(dsl_dir_open);
+EXPORT_SYMBOL(dsl_dir_close);
+#endif
index af99d7415302766007a734ba61c167fa4f073ce2..0ba929a713e145c28738af1802c2710062c94511 100644 (file)
@@ -1153,3 +1153,10 @@ dsl_prop_nvlist_add_string(nvlist_t *nv, zfs_prop_t prop, const char *value)
        VERIFY(nvlist_add_nvlist(nv, propname, propval) == 0);
        nvlist_free(propval);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dsl_prop_set);
+EXPORT_SYMBOL(dsl_prop_get_all);
+EXPORT_SYMBOL(dsl_prop_nvlist_add_uint64);
+EXPORT_SYMBOL(dsl_prop_get_integer);
+#endif
index 977702912b659633505d488fb83760464c798dbd..f807ccc692c7998a91a700cea14a1bcc57fef751 100644 (file)
@@ -238,3 +238,8 @@ dsl_sync_task_do_nowait(dsl_pool_t *dp,
            arg1, arg2, blocks_modified);
        dsl_sync_task_group_nowait(dstg, tx);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(dsl_sync_task_do);
+EXPORT_SYMBOL(dsl_sync_task_do_nowait);
+#endif
index 8cab66992c488e415e9842c2b0d0d0350edd9743..1c34873b6c6dae2fd3853c0f4aa8d4b30270dfed 100644 (file)
@@ -226,7 +226,7 @@ struct spa {
        refcount_t      spa_refcount;           /* number of opens */
 };
 
-extern const char *spa_config_path;
+extern char *spa_config_path;
 
 #ifdef __cplusplus
 }
index afdfa123221e5c053a2f73b87f9eb0f6ae2aec2c..dea58f1e6ae4b0bd7db8238805edfb595a84bc5f 100644 (file)
@@ -40,6 +40,7 @@
 #include <sys/zil.h>
 #include <sys/ddt.h>
 #include <sys/vdev_impl.h>
+#include <sys/vdev_disk.h>
 #include <sys/metaslab.h>
 #include <sys/metaslab_impl.h>
 #include <sys/uberblock_impl.h>
@@ -229,7 +230,9 @@ spa_prop_get(spa_t *spa, nvlist_t **nvp)
        zap_attribute_t za;
        int err;
 
-       VERIFY(nvlist_alloc(nvp, NV_UNIQUE_NAME, KM_SLEEP) == 0);
+       err = nvlist_alloc(nvp, NV_UNIQUE_NAME, KM_SLEEP);
+       if (err)
+               return err;
 
        mutex_enter(&spa->spa_props_lock);
 
@@ -241,7 +244,7 @@ spa_prop_get(spa_t *spa, nvlist_t **nvp)
        /* If no pool property object, no more prop to get. */
        if (mos == NULL || spa->spa_pool_props_object == 0) {
                mutex_exit(&spa->spa_props_lock);
-               return (0);
+               goto out;
        }
 
        /*
@@ -5858,3 +5861,62 @@ spa_event_notify(spa_t *spa, vdev_t *vd, const char *name)
        zfs_ereport_post(name, spa, vd, NULL, 0, 0);
 #endif
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+/* state manipulation functions */
+EXPORT_SYMBOL(spa_open);
+EXPORT_SYMBOL(spa_open_rewind);
+EXPORT_SYMBOL(spa_get_stats);
+EXPORT_SYMBOL(spa_create);
+EXPORT_SYMBOL(spa_import_rootpool);
+EXPORT_SYMBOL(spa_import);
+EXPORT_SYMBOL(spa_tryimport);
+EXPORT_SYMBOL(spa_destroy);
+EXPORT_SYMBOL(spa_export);
+EXPORT_SYMBOL(spa_reset);
+EXPORT_SYMBOL(spa_async_request);
+EXPORT_SYMBOL(spa_async_suspend);
+EXPORT_SYMBOL(spa_async_resume);
+EXPORT_SYMBOL(spa_inject_addref);
+EXPORT_SYMBOL(spa_inject_delref);
+EXPORT_SYMBOL(spa_scan_stat_init);
+EXPORT_SYMBOL(spa_scan_get_stats);
+
+/* device maniion */
+EXPORT_SYMBOL(spa_vdev_add);
+EXPORT_SYMBOL(spa_vdev_attach);
+EXPORT_SYMBOL(spa_vdev_detach);
+EXPORT_SYMBOL(spa_vdev_remove);
+EXPORT_SYMBOL(spa_vdev_setpath);
+EXPORT_SYMBOL(spa_vdev_setfru);
+EXPORT_SYMBOL(spa_vdev_split_mirror);
+
+/* spare statech is global across all pools) */
+EXPORT_SYMBOL(spa_spare_add);
+EXPORT_SYMBOL(spa_spare_remove);
+EXPORT_SYMBOL(spa_spare_exists);
+EXPORT_SYMBOL(spa_spare_activate);
+
+/* L2ARC statech is global across all pools) */
+EXPORT_SYMBOL(spa_l2cache_add);
+EXPORT_SYMBOL(spa_l2cache_remove);
+EXPORT_SYMBOL(spa_l2cache_exists);
+EXPORT_SYMBOL(spa_l2cache_activate);
+EXPORT_SYMBOL(spa_l2cache_drop);
+
+/* scanning */
+EXPORT_SYMBOL(spa_scan);
+EXPORT_SYMBOL(spa_scan_stop);
+
+/* spa syncing */
+EXPORT_SYMBOL(spa_sync); /* only for DMU use */
+EXPORT_SYMBOL(spa_sync_allpools);
+
+/* properties */
+EXPORT_SYMBOL(spa_prop_set);
+EXPORT_SYMBOL(spa_prop_get);
+EXPORT_SYMBOL(spa_prop_clear_bootfs);
+
+/* asynchronous event notification */
+EXPORT_SYMBOL(spa_event_notify);
+#endif
index a6cdb818901a5507bb02d42140959586a57fbc70..be79542c9049c7fea4adc0c0f29d2d3269e9a32d 100644 (file)
@@ -24,6 +24,8 @@
  * Use is subject to license terms.
  */
 
+#ifdef _KERNEL
+
 #include <sys/zio.h>
 #include <sys/spa.h>
 #include <sys/sunddi.h>
@@ -44,3 +46,5 @@ spa_free_bootprop(char *value)
 {
        ddi_prop_free(value);
 }
+
+#endif /* _KERNEL */
index b7ef12a8fa38f5d14efb7ca5fa5836e293c8f7a2..79664cbe1df70908b1c2b850f7f361ab04e2c34e 100644 (file)
@@ -61,7 +61,7 @@ static uint64_t spa_config_generation = 1;
  * This can be overridden in userland to preserve an alternate namespace for
  * userland pools when doing testing.
  */
-const char *spa_config_path = ZPOOL_CACHE;
+char *spa_config_path = ZPOOL_CACHE;
 
 /*
  * Called when the module is first loaded, this routine loads the configuration
@@ -485,3 +485,15 @@ spa_config_update(spa_t *spa, int what)
        if (what == SPA_CONFIG_UPDATE_POOL)
                spa_config_update(spa, SPA_CONFIG_UPDATE_VDEVS);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(spa_config_sync);
+EXPORT_SYMBOL(spa_config_load);
+EXPORT_SYMBOL(spa_all_configs);
+EXPORT_SYMBOL(spa_config_set);
+EXPORT_SYMBOL(spa_config_generate);
+EXPORT_SYMBOL(spa_config_update);
+
+module_param(spa_config_path, charp, 0444);
+MODULE_PARM_DESC(spa_config_path, "SPA config file (/etc/zfs/zpool.cache)");
+#endif
index 282140b3bd655403646e55398f2d124a19a0488f..3fab1922c0c60135ce095228cc5af8a51c509ec5 100644 (file)
@@ -401,3 +401,14 @@ spa_errlog_sync(spa_t *spa, uint64_t txg)
 
        mutex_exit(&spa->spa_errlog_lock);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+/* error handling */
+EXPORT_SYMBOL(spa_log_error);
+EXPORT_SYMBOL(spa_get_errlog_size);
+EXPORT_SYMBOL(spa_get_errlog);
+EXPORT_SYMBOL(spa_errlog_rotate);
+EXPORT_SYMBOL(spa_errlog_drain);
+EXPORT_SYMBOL(spa_errlog_sync);
+EXPORT_SYMBOL(spa_get_errlists);
+#endif
index ce7d378c6ff97e843fb53e3aea028c9eb7b635dc..243f2b4ab370e83ca5bad8d19a6848c5a551b467 100644 (file)
@@ -178,7 +178,11 @@ static char *
 spa_history_zone(void)
 {
 #ifdef _KERNEL
+#ifdef HAVE_SPL
+       return ("linux");
+#else
        return (curproc->p_zone->zone_name);
+#endif
 #else
        return ("global");
 #endif
@@ -499,3 +503,11 @@ spa_history_log_version(spa_t *spa, history_internal_events_t event)
            (u_longlong_t)current_vers, spa_name(spa), SPA_VERSION);
 #endif
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(spa_history_create_obj);
+EXPORT_SYMBOL(spa_history_get);
+EXPORT_SYMBOL(spa_history_log);
+EXPORT_SYMBOL(spa_history_log_internal);
+EXPORT_SYMBOL(spa_history_log_version);
+#endif
index 31e82d879adf200fd1fd1167ad32918416794edc..d4cfd3c892e2bc89545990fc6cbb0d868019129d 100644 (file)
@@ -1679,3 +1679,83 @@ spa_scan_get_stats(spa_t *spa, pool_scan_stat_t *ps)
 
        return (0);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+/* Namespace manipulation */
+EXPORT_SYMBOL(spa_lookup);
+EXPORT_SYMBOL(spa_add);
+EXPORT_SYMBOL(spa_remove);
+EXPORT_SYMBOL(spa_next);
+
+/* Refcount functions */
+EXPORT_SYMBOL(spa_open_ref);
+EXPORT_SYMBOL(spa_close);
+EXPORT_SYMBOL(spa_refcount_zero);
+
+/* Pool configuration lock */
+EXPORT_SYMBOL(spa_config_tryenter);
+EXPORT_SYMBOL(spa_config_enter);
+EXPORT_SYMBOL(spa_config_exit);
+EXPORT_SYMBOL(spa_config_held);
+
+/* Pool vdev add/remove lock */
+EXPORT_SYMBOL(spa_vdev_enter);
+EXPORT_SYMBOL(spa_vdev_exit);
+
+/* Pool vdev state change lock */
+EXPORT_SYMBOL(spa_vdev_state_enter);
+EXPORT_SYMBOL(spa_vdev_state_exit);
+
+/* Accessor functions */
+EXPORT_SYMBOL(spa_shutting_down);
+EXPORT_SYMBOL(spa_get_dsl);
+EXPORT_SYMBOL(spa_get_rootblkptr);
+EXPORT_SYMBOL(spa_set_rootblkptr);
+EXPORT_SYMBOL(spa_altroot);
+EXPORT_SYMBOL(spa_sync_pass);
+EXPORT_SYMBOL(spa_name);
+EXPORT_SYMBOL(spa_guid);
+EXPORT_SYMBOL(spa_last_synced_txg);
+EXPORT_SYMBOL(spa_first_txg);
+EXPORT_SYMBOL(spa_syncing_txg);
+EXPORT_SYMBOL(spa_version);
+EXPORT_SYMBOL(spa_state);
+EXPORT_SYMBOL(spa_load_state);
+EXPORT_SYMBOL(spa_freeze_txg);
+EXPORT_SYMBOL(spa_get_asize);
+EXPORT_SYMBOL(spa_get_dspace);
+EXPORT_SYMBOL(spa_update_dspace);
+EXPORT_SYMBOL(spa_deflate);
+EXPORT_SYMBOL(spa_normal_class);
+EXPORT_SYMBOL(spa_log_class);
+EXPORT_SYMBOL(spa_max_replication);
+EXPORT_SYMBOL(spa_prev_software_version);
+EXPORT_SYMBOL(spa_get_failmode);
+EXPORT_SYMBOL(spa_suspended);
+EXPORT_SYMBOL(spa_bootfs);
+EXPORT_SYMBOL(spa_delegation);
+EXPORT_SYMBOL(spa_meta_objset);
+
+/* Miscellaneous support routines */
+EXPORT_SYMBOL(spa_rename);
+EXPORT_SYMBOL(spa_guid_exists);
+EXPORT_SYMBOL(spa_strdup);
+EXPORT_SYMBOL(spa_strfree);
+EXPORT_SYMBOL(spa_get_random);
+EXPORT_SYMBOL(spa_generate_guid);
+EXPORT_SYMBOL(sprintf_blkptr);
+EXPORT_SYMBOL(spa_freeze);
+EXPORT_SYMBOL(spa_upgrade);
+EXPORT_SYMBOL(spa_evict_all);
+EXPORT_SYMBOL(spa_lookup_by_guid);
+EXPORT_SYMBOL(spa_has_spare);
+EXPORT_SYMBOL(dva_get_dsize_sync);
+EXPORT_SYMBOL(bp_get_dsize_sync);
+EXPORT_SYMBOL(bp_get_dsize);
+EXPORT_SYMBOL(spa_has_slogs);
+EXPORT_SYMBOL(spa_is_root);
+EXPORT_SYMBOL(spa_writeable);
+EXPORT_SYMBOL(spa_mode);
+
+EXPORT_SYMBOL(spa_namespace_lock);
+#endif
index 5fc086e5de6945c317b44e44c82b1c746bc86259..382a2a91c7b08b5a0c1dada5c3a0edf6cbadb15d 100644 (file)
@@ -722,3 +722,19 @@ txg_list_next(txg_list_t *tl, void *p, uint64_t txg)
 
        return (tn == NULL ? NULL : (char *)tn - tl->tl_offset);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(txg_init);
+EXPORT_SYMBOL(txg_fini);
+EXPORT_SYMBOL(txg_sync_start);
+EXPORT_SYMBOL(txg_sync_stop);
+EXPORT_SYMBOL(txg_hold_open);
+EXPORT_SYMBOL(txg_rele_to_quiesce);
+EXPORT_SYMBOL(txg_rele_to_sync);
+EXPORT_SYMBOL(txg_register_callbacks);
+EXPORT_SYMBOL(txg_delay);
+EXPORT_SYMBOL(txg_wait_synced);
+EXPORT_SYMBOL(txg_wait_open);
+EXPORT_SYMBOL(txg_stalled);
+EXPORT_SYMBOL(txg_sync_waiting);
+#endif
index 1c14c7750df2d19229d6b37df123dcf30698b9f7..4bed646b36975f994977b55649ab5a78339e4100 100644 (file)
@@ -3167,3 +3167,11 @@ vdev_split(vdev_t *vd)
        }
        vdev_propagate_state(cvd);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(vdev_fault);
+EXPORT_SYMBOL(vdev_degrade);
+EXPORT_SYMBOL(vdev_online);
+EXPORT_SYMBOL(vdev_offline);
+EXPORT_SYMBOL(vdev_clear);
+#endif
index 8f8663526ee88e4f95c571b0ed6a90ed65bb8fa8..04ef63eb90c86c1e6c39bf9e3d89b72d812c6637 100644 (file)
@@ -405,3 +405,14 @@ vdev_queue_io_done(zio_t *zio)
 
        mutex_exit(&vq->vq_lock);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+module_param(zfs_vdev_max_pending, int, 0644);
+MODULE_PARM_DESC(zfs_vdev_max_pending, "Maximum pending VDEV IO");
+
+module_param(zfs_vdev_min_pending, int, 0644);
+MODULE_PARM_DESC(zfs_vdev_min_pending, "Minimum pending VDEV IO");
+
+module_param(zfs_vdev_aggregation_limit, int, 0644);
+MODULE_PARM_DESC(zfs_vdev_aggregation_limit, "Maximum VDEV IO aggregation");
+#endif
index 04369bbc50b390f9848c53202614288cf279f944..3c214750420df4833e785c04654f1021e5199cab 100644 (file)
@@ -1454,3 +1454,19 @@ zap_count_write(objset_t *os, uint64_t zapobj, const char *name, int add,
        zap_unlockdir(zap);
        return (err);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(zap_add);
+EXPORT_SYMBOL(zap_create);
+EXPORT_SYMBOL(zap_cursor_advance);
+EXPORT_SYMBOL(zap_cursor_fini);
+EXPORT_SYMBOL(zap_cursor_init);
+EXPORT_SYMBOL(zap_cursor_init_serialized);
+EXPORT_SYMBOL(zap_cursor_move_to_key);
+EXPORT_SYMBOL(zap_cursor_retrieve);
+EXPORT_SYMBOL(zap_cursor_serialize);
+EXPORT_SYMBOL(zap_lookup);
+EXPORT_SYMBOL(zap_lookup_norm);
+EXPORT_SYMBOL(zap_remove);
+EXPORT_SYMBOL(zap_update);
+#endif
index 6048eb124525f1be1e671d931514ba562acada15..16327a2250583fdc7693642ea64605dac5e00cfb 100644 (file)
@@ -197,3 +197,9 @@ zfs_znode_byteswap(void *buf, size_t size)
                    ACE_SLOT_CNT);
        }
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(zfs_oldacl_byteswap);
+EXPORT_SYMBOL(zfs_acl_byteswap);
+EXPORT_SYMBOL(zfs_znode_byteswap);
+#endif
index 5e6bab81a183b4cbc7eb85025fcae57a506386b1..4f6185fb53eb419aefaa6616035e694efa2a3676 100644 (file)
@@ -2162,3 +2162,8 @@ zfs_obj_to_stats(objset_t *osp, uint64_t obj, zfs_stat_t *sb,
        zfs_release_sa_handle(hdl, db);
        return (error);
 }
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+EXPORT_SYMBOL(zfs_create_fs);
+EXPORT_SYMBOL(zfs_obj_to_path);
+#endif
index c7eb66103952a39c9579f05e6a546e7a2c0efef9..70d3addf5cadcbfded19a17c0586d986f0fab342 100644 (file)
@@ -74,6 +74,7 @@ kmem_cache_t *zio_cache;
 kmem_cache_t *zio_link_cache;
 kmem_cache_t *zio_buf_cache[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
 kmem_cache_t *zio_data_buf_cache[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
+int zio_bulk_flags = 0;
 
 #ifdef _KERNEL
 extern vmem_t *zio_alloc_arena;
@@ -136,12 +137,14 @@ zio_init(void)
                        (void) sprintf(name, "zio_buf_%lu", (ulong_t)size);
                        zio_buf_cache[c] = kmem_cache_create(name, size,
                            align, NULL, NULL, NULL, NULL, NULL,
-                           size > zio_buf_debug_limit ? KMC_NODEBUG : 0);
+                           (size > zio_buf_debug_limit ? KMC_NODEBUG : 0) |
+                           zio_bulk_flags);
 
                        (void) sprintf(name, "zio_data_buf_%lu", (ulong_t)size);
                        zio_data_buf_cache[c] = kmem_cache_create(name, size,
                            align, NULL, NULL, NULL, NULL, data_alloc_arena,
-                           size > zio_buf_debug_limit ? KMC_NODEBUG : 0);
+                           (size > zio_buf_debug_limit ? KMC_NODEBUG : 0) |
+                           zio_bulk_flags);
                }
        }
 
@@ -2975,3 +2978,19 @@ static zio_pipe_stage_t *zio_pipeline[] = {
        zio_checksum_verify,
        zio_done
 };
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+/* Fault injection */
+EXPORT_SYMBOL(zio_injection_enabled);
+EXPORT_SYMBOL(zio_inject_fault);
+EXPORT_SYMBOL(zio_inject_list_next);
+EXPORT_SYMBOL(zio_clear_fault);
+EXPORT_SYMBOL(zio_handle_fault_injection);
+EXPORT_SYMBOL(zio_handle_device_injection);
+EXPORT_SYMBOL(zio_handle_label_injection);
+EXPORT_SYMBOL(zio_priority_table);
+EXPORT_SYMBOL(zio_type_name);
+
+module_param(zio_bulk_flags, int, 0644);
+MODULE_PARM_DESC(zio_bulk_flags, "Additional flags to pass to bulk buffers");
+#endif