#include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/spinlock.h>
-#include <linux/compat.h>
#include <asm/uaccess.h>
#include <asm/io.h>
ctlr_info_t *h = (ctlr_info_t*)data;
drive_info_struct *drv;
unsigned long flags;
- unsigned int vol_sz, vol_sz_frac;
+ sector_t vol_sz, vol_sz_frac;
ctlr = h->ctlr;
int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg,
struct file *file)
{
- IOCTL32_Command_struct __user *arg32 =
- (IOCTL32_Command_struct __user *) arg;
+ IOCTL32_Command_struct *arg32 =
+ (IOCTL32_Command_struct *) arg;
IOCTL_Command_struct arg64;
- IOCTL_Command_struct __user *p = compat_alloc_user_space(sizeof(arg64));
+ mm_segment_t old_fs;
int err;
- u32 cp;
+ unsigned long cp;
err = 0;
err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info));
err |= get_user(arg64.buf_size, &arg32->buf_size);
err |= get_user(cp, &arg32->buf);
- arg64.buf = compat_ptr(cp);
- err |= copy_to_user(p, &arg64, sizeof(arg64));
+ arg64.buf = (BYTE *)cp;
if (err)
return -EFAULT;
- err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) p);
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) &arg64);
+ set_fs(old_fs);
if (err)
return err;
- err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
+ err |= copy_to_user(&arg32->error_info, &arg64.error_info, sizeof(&arg32->error_info));
if (err)
return -EFAULT;
return err;
}
-
int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg,
struct file *file)
{
- BIG_IOCTL32_Command_struct __user *arg32 =
- (BIG_IOCTL32_Command_struct __user *) arg;
+ BIG_IOCTL32_Command_struct *arg32 =
+ (BIG_IOCTL32_Command_struct *) arg;
BIG_IOCTL_Command_struct arg64;
- BIG_IOCTL_Command_struct __user *p = compat_alloc_user_space(sizeof(arg64));
+ mm_segment_t old_fs;
int err;
- u32 cp;
+ unsigned long cp;
err = 0;
err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
err |= get_user(arg64.buf_size, &arg32->buf_size);
err |= get_user(arg64.malloc_size, &arg32->malloc_size);
err |= get_user(cp, &arg32->buf);
- arg64.buf = compat_ptr(cp);
- err |= copy_to_user(p, &arg64, sizeof(arg64));
+ arg64.buf = (BYTE *)cp;
if (err)
return -EFAULT;
- err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) p);
+ old_fs = get_fs();
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) &arg64);
+ set_fs(old_fs);
if (err)
return err;
- err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
+ err |= copy_to_user(&arg32->error_info, &arg64.error_info, sizeof(&arg32->error_info));
if (err)
return -EFAULT;
return err;