mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
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 <behlendorf1@llnl.gov>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user