* [PATCH] aacraid: BKL push down
@ 2008-05-22 21:39 Alan Cox
2008-05-22 21:55 ` Randy.Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2008-05-22 21:39 UTC (permalink / raw)
To: linux-scsi, linux-kernel
The aacraid definitely needs the BKL internally right now so push the
lock take down into the driver but go no further
Signed-off-by: Alan Cox <alan@redhat.com>
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index b31faec..5e6b47f 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -111,7 +111,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H
static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
static char *twa_aen_severity_lookup(unsigned char severity_code);
static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id);
-static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
+static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
static int twa_chrdev_open(struct inode *inode, struct file *file);
static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host);
static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id);
@@ -202,7 +202,7 @@ static struct device_attribute *twa_host_attrs[] = {
/* File operations struct for character device */
static const struct file_operations twa_fops = {
.owner = THIS_MODULE,
- .ioctl = twa_chrdev_ioctl,
+ .unlocked_ioctl = twa_chrdev_ioctl,
.open = twa_chrdev_open,
.release = NULL
};
@@ -619,7 +619,7 @@ out:
} /* End twa_check_srl() */
/* This function handles ioctl for the character device */
-static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
long timeout;
unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
@@ -635,7 +635,8 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
TW_Event *event;
struct timeval current_time;
u32 current_time_ms;
- TW_Device_Extension *tw_dev = twa_device_extension_list[iminor(inode)];
+ unsigned int minor = iminor(file->f_path.dentry->d_inode);
+ TW_Device_Extension *tw_dev = twa_device_extension_list[minor];
int retval = TW_IOCTL_ERROR_OS_EFAULT;
void __user *argp = (void __user *)arg;
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 8c22329..33a6a2e 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -874,7 +874,7 @@ static int tw_allocate_memory(TW_Device_Extension *tw_dev, int size, int which)
} /* End tw_allocate_memory() */
/* This function handles ioctl for the character device */
-static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long tw_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
int request_id;
dma_addr_t dma_handle;
@@ -886,7 +886,8 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
long timeout;
TW_New_Ioctl *tw_ioctl;
TW_Passthru *passthru;
- TW_Device_Extension *tw_dev = tw_device_extension_list[iminor(inode)];
+ unsigned int minor = iminor(file->f_path.dentry->d_inode);
+ TW_Device_Extension *tw_dev = tw_device_extension_list[minor];
int retval = -EFAULT;
void __user *argp = (void __user *)arg;
@@ -1043,7 +1044,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file)
/* File operations struct for character device */
static const struct file_operations tw_fops = {
.owner = THIS_MODULE,
- .ioctl = tw_chrdev_ioctl,
+ .unlocked_ioctl = tw_chrdev_ioctl,
.open = tw_chrdev_open,
.release = NULL
};
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] aacraid: BKL push down
2008-05-22 21:39 [PATCH] aacraid: BKL push down Alan Cox
@ 2008-05-22 21:55 ` Randy.Dunlap
2008-05-22 22:18 ` Alan Cox
0 siblings, 1 reply; 3+ messages in thread
From: Randy.Dunlap @ 2008-05-22 21:55 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-scsi, linux-kernel
On Thu, 22 May 2008, Alan Cox wrote:
> The aacraid definitely needs the BKL internally right now so push the
> lock take down into the driver but go no further
>
> Signed-off-by: Alan Cox <alan@redhat.com>
Wrong patch file ??
> diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
> index b31faec..5e6b47f 100644
> --- a/drivers/scsi/3w-9xxx.c
> +++ b/drivers/scsi/3w-9xxx.c
> @@ -111,7 +111,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H
> static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
> static char *twa_aen_severity_lookup(unsigned char severity_code);
> static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id);
> -static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
> +static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
> static int twa_chrdev_open(struct inode *inode, struct file *file);
> static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host);
> static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id);
> @@ -202,7 +202,7 @@ static struct device_attribute *twa_host_attrs[] = {
> /* File operations struct for character device */
> static const struct file_operations twa_fops = {
> .owner = THIS_MODULE,
> - .ioctl = twa_chrdev_ioctl,
> + .unlocked_ioctl = twa_chrdev_ioctl,
> .open = twa_chrdev_open,
> .release = NULL
> };
> @@ -619,7 +619,7 @@ out:
> } /* End twa_check_srl() */
>
> /* This function handles ioctl for the character device */
> -static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> +static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> {
> long timeout;
> unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
> @@ -635,7 +635,8 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
> TW_Event *event;
> struct timeval current_time;
> u32 current_time_ms;
> - TW_Device_Extension *tw_dev = twa_device_extension_list[iminor(inode)];
> + unsigned int minor = iminor(file->f_path.dentry->d_inode);
> + TW_Device_Extension *tw_dev = twa_device_extension_list[minor];
> int retval = TW_IOCTL_ERROR_OS_EFAULT;
> void __user *argp = (void __user *)arg;
>
> diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
> index 8c22329..33a6a2e 100644
> --- a/drivers/scsi/3w-xxxx.c
> +++ b/drivers/scsi/3w-xxxx.c
> @@ -874,7 +874,7 @@ static int tw_allocate_memory(TW_Device_Extension *tw_dev, int size, int which)
> } /* End tw_allocate_memory() */
>
> /* This function handles ioctl for the character device */
> -static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
> +static long tw_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> {
> int request_id;
> dma_addr_t dma_handle;
> @@ -886,7 +886,8 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
> long timeout;
> TW_New_Ioctl *tw_ioctl;
> TW_Passthru *passthru;
> - TW_Device_Extension *tw_dev = tw_device_extension_list[iminor(inode)];
> + unsigned int minor = iminor(file->f_path.dentry->d_inode);
> + TW_Device_Extension *tw_dev = tw_device_extension_list[minor];
> int retval = -EFAULT;
> void __user *argp = (void __user *)arg;
>
> @@ -1043,7 +1044,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file)
> /* File operations struct for character device */
> static const struct file_operations tw_fops = {
> .owner = THIS_MODULE,
> - .ioctl = tw_chrdev_ioctl,
> + .unlocked_ioctl = tw_chrdev_ioctl,
> .open = tw_chrdev_open,
> .release = NULL
> };
> --
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] aacraid: BKL push down
2008-05-22 21:55 ` Randy.Dunlap
@ 2008-05-22 22:18 ` Alan Cox
0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2008-05-22 22:18 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: linux-scsi, linux-kernel
On Thu, 22 May 2008 14:55:20 -0700 (PDT)
"Randy.Dunlap" <rdunlap@xenotime.net> wrote:
> On Thu, 22 May 2008, Alan Cox wrote:
>
> > The aacraid definitely needs the BKL internally right now so push the
> > lock take down into the driver but go no further
> >
> > Signed-off-by: Alan Cox <alan@redhat.com>
>
> Wrong patch file ??
Correct one below
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 1f7c836..f0aaee7 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -692,12 +692,16 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
* Bugs: Needs to handle hot plugging
*/
-static int aac_cfg_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
+static long aac_cfg_ioctl(struct file *file, unsigned int cmd,
+ unsigned long arg)
{
+ long ret;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
- return aac_do_ioctl(file->private_data, cmd, (void __user *)arg);
+ lock_kernel();
+ ret = aac_do_ioctl(file->private_data, cmd, (void __user *)arg);
+ unlock_kernel();
+ return ret;
}
#ifdef CONFIG_COMPAT
@@ -1016,7 +1020,7 @@ ssize_t aac_get_serial_number(struct device *device, char *buf)
static const struct file_operations aac_cfg_fops = {
.owner = THIS_MODULE,
- .ioctl = aac_cfg_ioctl,
+ .unlocked_ioctl = aac_cfg_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = aac_compat_cfg_ioctl,
#endif
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-22 22:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 21:39 [PATCH] aacraid: BKL push down Alan Cox
2008-05-22 21:55 ` Randy.Dunlap
2008-05-22 22:18 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).