summaryrefslogtreecommitdiffstats
path: root/module/spl/spl-generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/spl/spl-generic.c')
-rw-r--r--module/spl/spl-generic.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c
index 8bf97e0cf..dc0ac21d0 100644
--- a/module/spl/spl-generic.c
+++ b/module/spl/spl-generic.c
@@ -358,7 +358,8 @@ set_kallsyms_lookup_name(void)
}
#endif
-static int __init spl_init(void)
+static int
+__init spl_init(void)
{
int rc = 0;
@@ -421,7 +422,8 @@ out1:
return rc;
}
-static void spl_fini(void)
+static void
+spl_fini(void)
{
ENTRY;
@@ -436,6 +438,26 @@ static void spl_fini(void)
debug_fini();
}
+/* Called when a dependent module is loaded */
+void
+spl_setup(void)
+{
+ /*
+ * At module load time the pwd is set to '/' on a Solaris system.
+ * On a Linux system will be set to whatever directory the caller
+ * was in when executing insmod/modprobe.
+ */
+ vn_set_pwd("/");
+}
+EXPORT_SYMBOL(spl_setup);
+
+/* Called when a dependent module is unloaded */
+void
+spl_cleanup(void)
+{
+}
+EXPORT_SYMBOL(spl_cleanup);
+
module_init(spl_init);
module_exit(spl_fini);