zfs/module/spl
Brian Behlendorf 51a727e90f Set cwd to '/' for the process executing insmod.
Ricardo has pointed out that under Solaris the cwd is set to '/'
during module load, while under Linux it is set to the callers cwd.
To handle this cleanly I've reworked the module *_init()/_exit()
macros so they call a *_setup()/_cleanup() function when any SPL
dependent module is loaded or unloaded.  This gives us a chance to
perform any needed modification of the process, in this case changing
the cwd.  It also handily provides a way to avoid creating wrapper
init()/exit() functions because the Solaris and Linux prototypes
differ slightly.  All dependent modules should now call the spl
helper macros spl_module_{init,exit}() instead of the native linux
versions.

Unfortunately, it appears that under Linux there has been no consistent
API in the kernel to set the cwd in a module.  Because of this I have
had to add more autoconf magic than I'd like.  However, what I have
done is correct and has been tested on RHEL5, SLES11, FC11, and CHAOS
kernels.

In addition, I have change the rootdir type from a 'void *' to the
correct 'vnode_t *' type.  And I've set rootdir to a non-NULL value.
2009-10-01 16:06:15 -07:00
..
Makefile.in Add basic credential support and splat tests. 2009-07-27 17:18:59 -07:00
spl-atomic.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-condvar.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-cred.c Remove get/put_task_struct as they are not available for SLES11 2009-07-28 15:04:21 -07:00
spl-debug.c Add basic credential support and splat tests. 2009-07-27 17:18:59 -07:00
spl-err.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-generic.c Set cwd to '/' for the process executing insmod. 2009-10-01 16:06:15 -07:00
spl-kmem.c Update global_page_state() support for 2.6.29 kernels. 2009-07-28 15:06:42 -07:00
spl-kobj.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-kstat.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-module.c Positive Solaris ioctl return codes need to be negated for use by libc 2009-07-23 16:14:52 -07:00
spl-mutex.c Reimplement mutexs for Linux lock profiling/analysis 2009-09-25 14:47:01 -07:00
spl-proc.c Reimplement mutexs for Linux lock profiling/analysis 2009-09-25 14:47:01 -07:00
spl-rwlock.c Update rwlocks to track owner to ensure correct semantics 2009-09-25 14:14:35 -07:00
spl-taskq.c Add basic support for TASKQ_THREADS_CPU_PCT taskq flag which is 2009-07-09 10:07:52 -07:00
spl-thread.c Rename modules to module and update references 2009-01-15 10:44:54 -08:00
spl-time.c Prevent integer overflow after ~164 days of uptime. 2009-07-14 15:23:25 -07:00
spl-vnode.c Set cwd to '/' for the process executing insmod. 2009-10-01 16:06:15 -07:00
spl-xdr.c Minor bug fix in XDR code introduced in last minute change before landing. 2009-03-11 16:27:35 -07:00