diff options
author | Brian Behlendorf <[email protected]> | 2009-05-20 16:33:08 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-05-20 16:33:08 -0700 |
commit | 9593ef76d9ab2290a4fee7f97651dfa1f57185e6 (patch) | |
tree | fcd8b5ecbe5fbcbe835f215596281f1d77d130ba | |
parent | 124ca8a5a98a5e64e6a221b5f30c48361dac6f24 (diff) |
SLES10 Fixes (part 8)
- Add compat_ioctl() handler, by default 64-bit SLES systems build 32-bit
ELF binaries. For the 32-bit binaries to pass ioctl information to a
64-bit kernel a compatibility handler needs to be registered. In our
case no additional conversions are needed to convert 32-bit ioctl()
commands to 64-bit commands so we can just call the default handler.
-rw-r--r-- | module/splat/splat-ctl.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index 2ff62ffb0..c123f5bf9 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -460,6 +460,15 @@ splat_ioctl(struct inode *inode, struct file *file, return rc; } +#ifdef CONFIG_COMPAT +/* Compatibility handler for ioctls from 32-bit ELF binaries */ +static long +splat_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + return splat_ioctl(NULL, file, cmd, arg); +} +#endif /* CONFIG_COMPAT */ + /* I'm not sure why you would want to write in to this buffer from * user space since its principle use is to pass test status info * back to the user space, but I don't see any reason to prevent it. @@ -573,13 +582,16 @@ static loff_t splat_seek(struct file *file, loff_t offset, int origin) } static struct file_operations splat_fops = { - .owner = THIS_MODULE, - .open = splat_open, - .release = splat_release, - .ioctl = splat_ioctl, - .read = splat_read, - .write = splat_write, - .llseek = splat_seek, + .owner = THIS_MODULE, + .open = splat_open, + .release = splat_release, + .ioctl = splat_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = splat_compat_ioctl, +#endif + .read = splat_read, + .write = splat_write, + .llseek = splat_seek, }; static struct cdev splat_cdev = { |