diff options
author | Brian Behlendorf <[email protected]> | 2009-07-10 10:56:32 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-07-10 10:56:32 -0700 |
commit | d3126abe75a6502d55bfa2339b48d4fa263e1b02 (patch) | |
tree | 69524df2de86f7030d86687dd96f407b8d2502f4 /module/spl/spl-generic.c | |
parent | 2a734e9c266f5fd31db84153a61263b529167732 (diff) |
Add ddi_copyin/ddi_copyout support for fake kernel originated ioctls.
Diffstat (limited to 'module/spl/spl-generic.c')
-rw-r--r-- | module/spl/spl-generic.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index 568d40635..b81dabc56 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -35,6 +35,7 @@ #include <sys/proc.h> #include <sys/kstat.h> #include <sys/utsname.h> +#include <sys/file.h> #include <linux/kmod.h> #ifdef DEBUG_SUBSYSTEM @@ -226,6 +227,32 @@ EXPORT_SYMBOL(ddi_strtol); EXPORT_SYMBOL(ddi_strtoll); EXPORT_SYMBOL(ddi_strtoull); +int +ddi_copyin(const void *from, void *to, size_t len, int flags) +{ + /* Fake ioctl() issued by kernel, 'from' is a kernel address */ + if (flags & FKIOCTL) { + memcpy(to, from, len); + return 0; + } + + return copyin(from, to, len); +} +EXPORT_SYMBOL(ddi_copyin); + +int +ddi_copyout(const void *from, void *to, size_t len, int flags) +{ + /* Fake ioctl() issued by kernel, 'from' is a kernel address */ + if (flags & FKIOCTL) { + memcpy(to, from, len); + return 0; + } + + return copyout(from, to, len); +} +EXPORT_SYMBOL(ddi_copyout); + struct new_utsname *__utsname(void) { #ifdef HAVE_INIT_UTSNAME |