summaryrefslogtreecommitdiffstats
path: root/module/zcommon
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 11:49:16 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 13:41:58 -0700
commitc28b227942b421ebdc03c9df9a012642fb517223 (patch)
treeec584e21d6fbc819353792d54a7dffb454029111 /module/zcommon
parent00b46022c676e402e3f33ce93ee2983bbad2c46f (diff)
Add linux kernel module support
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 <[email protected]>
Diffstat (limited to 'module/zcommon')
-rw-r--r--module/zcommon/zfs_comutil.c8
-rw-r--r--module/zcommon/zfs_deleg.c6
-rw-r--r--module/zcommon/zfs_fletcher.c9
-rw-r--r--module/zcommon/zfs_namecheck.c6
-rw-r--r--module/zcommon/zfs_prop.c35
-rw-r--r--module/zcommon/zpool_prop.c16
-rw-r--r--module/zcommon/zprop_common.c18
7 files changed, 98 insertions, 0 deletions
diff --git a/module/zcommon/zfs_comutil.c b/module/zcommon/zfs_comutil.c
index ed9b67ea3..ccf169be6 100644
--- a/module/zcommon/zfs_comutil.c
+++ b/module/zcommon/zfs_comutil.c
@@ -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
diff --git a/module/zcommon/zfs_deleg.c b/module/zcommon/zfs_deleg.c
index a4aa77adb..6754ab84b 100644
--- a/module/zcommon/zfs_deleg.c
+++ b/module/zcommon/zfs_deleg.c
@@ -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
diff --git a/module/zcommon/zfs_fletcher.c b/module/zcommon/zfs_fletcher.c
index fa43ce6bd..edd0cbe6c 100644
--- a/module/zcommon/zfs_fletcher.c
+++ b/module/zcommon/zfs_fletcher.c
@@ -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
diff --git a/module/zcommon/zfs_namecheck.c b/module/zcommon/zfs_namecheck.c
index 2398c2755..8508bc734 100644
--- a/module/zcommon/zfs_namecheck.c
+++ b/module/zcommon/zfs_namecheck.c
@@ -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
diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c
index f29bcf627..ce03a498c 100644
--- a/module/zcommon/zfs_prop.c
+++ b/module/zcommon/zfs_prop.c
@@ -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
diff --git a/module/zcommon/zpool_prop.c b/module/zcommon/zpool_prop.c
index 988d05de6..37d977f47 100644
--- a/module/zcommon/zpool_prop.c
+++ b/module/zcommon/zpool_prop.c
@@ -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
diff --git a/module/zcommon/zprop_common.c b/module/zcommon/zprop_common.c
index df2fdeab8..ab5b4662b 100644
--- a/module/zcommon/zprop_common.c
+++ b/module/zcommon/zprop_common.c
@@ -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