* [PATCH] Convert megaraid2 to compat_ioctl
@ 2005-01-18 11:17 Andi Kleen
0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2005-01-18 11:17 UTC (permalink / raw)
To: James.Bottomley, linux-scsi
Convert megaraid2 driver to new compat_ioctl entry points.
I don't have easy access to hardware, so only compile tested.
Signed-off-by: Andi Kleen <ak@muc.de>
diff -u linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c
--- linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o 2005-01-04 12:13:06.000000000 +0100
+++ linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c 2005-01-18 06:28:34.000000000 +0100
@@ -16,6 +16,7 @@
*/
#include "megaraid_mm.h"
+#include <linux/smp_lock.h>
// Entry points for char node driver
@@ -43,8 +44,7 @@
static void mraid_mm_teardown_dma_pools(mraid_mmadp_t *);
#ifdef CONFIG_COMPAT
-static int mraid_mm_compat_ioctl(unsigned int, unsigned int, unsigned long,
- struct file *);
+static long mraid_mm_compat_ioctl(struct file *, unsigned int, unsigned long);
#endif
MODULE_AUTHOR("LSI Logic Corporation");
@@ -70,6 +70,9 @@
static struct file_operations lsi_fops = {
.open = mraid_mm_open,
.ioctl = mraid_mm_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = mraid_mm_compat_ioctl,
+#endif
.owner = THIS_MODULE,
};
@@ -1180,8 +1183,6 @@
INIT_LIST_HEAD(&adapters_list_g);
- register_ioctl32_conversion(MEGAIOCCMD, mraid_mm_compat_ioctl);
-
return 0;
}
@@ -1190,13 +1191,15 @@
* mraid_mm_compat_ioctl : 32bit to 64bit ioctl conversion routine
*/
#ifdef CONFIG_COMPAT
-static int
-mraid_mm_compat_ioctl(unsigned int fd, unsigned int cmd,
- unsigned long arg, struct file *filep)
-{
- struct inode *inode = filep->f_dentry->d_inode;
-
- return mraid_mm_ioctl(inode, filep, cmd, arg);
+static long
+mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd,
+ unsigned long arg)
+{
+ int err;
+ lock_kernel();
+ err = mraid_mm_ioctl(NULL, filep, cmd, arg);
+ unlock_kernel();
+ return err;
}
#endif
@@ -1209,7 +1212,6 @@
con_log(CL_DLEVEL1 , ("exiting common mod\n"));
unregister_chrdev(majorno, "megadev");
- unregister_ioctl32_conversion(MEGAIOCCMD);
}
module_init(mraid_mm_init);
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [PATCH] Convert megaraid2 to compat_ioctl
@ 2005-02-03 16:01 Ju, Seokmann
2005-02-03 21:12 ` Andi Kleen
0 siblings, 1 reply; 6+ messages in thread
From: Ju, Seokmann @ 2005-02-03 16:01 UTC (permalink / raw)
To: 'Andi Kleen', James.Bottomley, linux-scsi
On Tuesday, January 18, 2005 6:17 AM, Andi wrote:
> Convert megaraid2 driver to new compat_ioctl entry points.
>
> I don't have easy access to hardware, so only compile tested.
Thanks for your feedback and appreciate changes you've made.
The changes look great to me.
One question, though, any reason to have 'lock_kernel'?
Isn't it too huge to use, here?
It could lead system hung if ioctl goes to sleep for some reason.
Thanks,
Seokmann
LSI Logic Co.
> -----Original Message-----
> From: Andi Kleen [mailto:ak@muc.de]
> Sent: Tuesday, January 18, 2005 6:17 AM
> To: James.Bottomley@HansenPartnership.com; linux-scsi@vger.kernel.org
> Subject: [PATCH] Convert megaraid2 to compat_ioctl
>
> Convert megaraid2 driver to new compat_ioctl entry points.
>
> I don't have easy access to hardware, so only compile tested.
>
> Signed-off-by: Andi Kleen <ak@muc.de>
>
> diff -u linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o linux-
> 2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c
> --- linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o
2005-01-
> 04 12:13:06.000000000 +0100
> +++ linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c 2005-01-
> 18 06:28:34.000000000 +0100
> @@ -16,6 +16,7 @@
> */
>
> #include "megaraid_mm.h"
> +#include <linux/smp_lock.h>
>
>
> // Entry points for char node driver
> @@ -43,8 +44,7 @@
> static void mraid_mm_teardown_dma_pools(mraid_mmadp_t *);
>
> #ifdef CONFIG_COMPAT
> -static int mraid_mm_compat_ioctl(unsigned int, unsigned int, unsigned
> long,
> - struct file *);
> +static long mraid_mm_compat_ioctl(struct file *, unsigned int, unsigned
> long);
> #endif
>
> MODULE_AUTHOR("LSI Logic Corporation");
> @@ -70,6 +70,9 @@
> static struct file_operations lsi_fops = {
> .open = mraid_mm_open,
> .ioctl = mraid_mm_ioctl,
> +#ifdef CONFIG_COMPAT
> + .compat_ioctl = mraid_mm_compat_ioctl,
> +#endif
> .owner = THIS_MODULE,
> };
>
> @@ -1180,8 +1183,6 @@
>
> INIT_LIST_HEAD(&adapters_list_g);
>
> - register_ioctl32_conversion(MEGAIOCCMD, mraid_mm_compat_ioctl);
> -
> return 0;
> }
>
> @@ -1190,13 +1191,15 @@
> * mraid_mm_compat_ioctl : 32bit to 64bit ioctl conversion routine
> */
> #ifdef CONFIG_COMPAT
> -static int
> -mraid_mm_compat_ioctl(unsigned int fd, unsigned int cmd,
> - unsigned long arg, struct file *filep)
> -{
> - struct inode *inode = filep->f_dentry->d_inode;
> -
> - return mraid_mm_ioctl(inode, filep, cmd, arg);
> +static long
> +mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd,
> + unsigned long arg)
> +{
> + int err;
> + lock_kernel();
> + err = mraid_mm_ioctl(NULL, filep, cmd, arg);
> + unlock_kernel();
> + return err;
> }
> #endif
>
> @@ -1209,7 +1212,6 @@
> con_log(CL_DLEVEL1 , ("exiting common mod\n"));
>
> unregister_chrdev(majorno, "megadev");
> - unregister_ioctl32_conversion(MEGAIOCCMD);
> }
>
> module_init(mraid_mm_init);
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Convert megaraid2 to compat_ioctl
2005-02-03 16:01 Ju, Seokmann
@ 2005-02-03 21:12 ` Andi Kleen
0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2005-02-03 21:12 UTC (permalink / raw)
To: Ju, Seokmann; +Cc: James.Bottomley, linux-scsi
On Thu, Feb 03, 2005 at 11:01:39AM -0500, Ju, Seokmann wrote:
> On Tuesday, January 18, 2005 6:17 AM, Andi wrote:
> > Convert megaraid2 driver to new compat_ioctl entry points.
> >
> > I don't have easy access to hardware, so only compile tested.
>
> Thanks for your feedback and appreciate changes you've made.
> The changes look great to me.
> One question, though, any reason to have 'lock_kernel'?
It was hold before and I didn't want to audit all the code
to make sure it was safe to not hold it.
> Isn't it too huge to use, here?
Probably yes. If you're audited the code and feel confident
that it doesn't need it feel free to drop.
> It could lead system hung if ioctl goes to sleep for some reason.
No, lock_kernel is magically dropped on sleeps.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] Convert megaraid2 to compat_ioctl
@ 2005-02-07 21:01 Ju, Seokmann
2005-02-07 21:07 ` Matthew Wilcox
0 siblings, 1 reply; 6+ messages in thread
From: Ju, Seokmann @ 2005-02-07 21:01 UTC (permalink / raw)
To: 'Andi Kleen', James.Bottomley, linux-scsi, Ju, Seokmann
On Tuesday, January 18, 2005 6:17 AM, Andi wrote:
> Convert megaraid2 driver to new compat_ioctl entry points.
>
> I don't have easy access to hardware, so only compile tested.
Hi,
I've applied your patch to the driver and getting compilation error as
follow.
/var/lib/dkms/megaraid/v2.20.4.6/build/megaraid_mm.c:74: error: unknown
field `compat_ioctl' specified in initializer
/var/lib/dkms/megaraid/v2.20.4.6/build/megaraid_mm.c:74: warning:
initialization from incompatible pointer type
The kernel that I'm using is 2.6.9 and there is NO entry 'compat_ioctl' on
file_operations structure which is defined in <linux/fs.h>.
Please correct me know if there is anything that I've missed.
Thanks,
Seokmann
LSI Logic Corporation.
> -----Original Message-----
> From: Andi Kleen [mailto:ak@muc.de]
> Sent: Tuesday, January 18, 2005 6:17 AM
> To: James.Bottomley@HansenPartnership.com; linux-scsi@vger.kernel.org
> Subject: [PATCH] Convert megaraid2 to compat_ioctl
>
> Convert megaraid2 driver to new compat_ioctl entry points.
>
> I don't have easy access to hardware, so only compile tested.
>
> Signed-off-by: Andi Kleen <ak@muc.de>
>
> diff -u linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o linux-
> 2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c
> --- linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o
2005-01-
> 04 12:13:06.000000000 +0100
> +++ linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c 2005-01-
> 18 06:28:34.000000000 +0100
> @@ -16,6 +16,7 @@
> */
>
> #include "megaraid_mm.h"
> +#include <linux/smp_lock.h>
>
>
> // Entry points for char node driver
> @@ -43,8 +44,7 @@
> static void mraid_mm_teardown_dma_pools(mraid_mmadp_t *);
>
> #ifdef CONFIG_COMPAT
> -static int mraid_mm_compat_ioctl(unsigned int, unsigned int, unsigned
> long,
> - struct file *);
> +static long mraid_mm_compat_ioctl(struct file *, unsigned int, unsigned
> long);
> #endif
>
> MODULE_AUTHOR("LSI Logic Corporation");
> @@ -70,6 +70,9 @@
> static struct file_operations lsi_fops = {
> .open = mraid_mm_open,
> .ioctl = mraid_mm_ioctl,
> +#ifdef CONFIG_COMPAT
> + .compat_ioctl = mraid_mm_compat_ioctl,
> +#endif
> .owner = THIS_MODULE,
> };
>
> @@ -1180,8 +1183,6 @@
>
> INIT_LIST_HEAD(&adapters_list_g);
>
> - register_ioctl32_conversion(MEGAIOCCMD, mraid_mm_compat_ioctl);
> -
> return 0;
> }
>
> @@ -1190,13 +1191,15 @@
> * mraid_mm_compat_ioctl : 32bit to 64bit ioctl conversion routine
> */
> #ifdef CONFIG_COMPAT
> -static int
> -mraid_mm_compat_ioctl(unsigned int fd, unsigned int cmd,
> - unsigned long arg, struct file *filep)
> -{
> - struct inode *inode = filep->f_dentry->d_inode;
> -
> - return mraid_mm_ioctl(inode, filep, cmd, arg);
> +static long
> +mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd,
> + unsigned long arg)
> +{
> + int err;
> + lock_kernel();
> + err = mraid_mm_ioctl(NULL, filep, cmd, arg);
> + unlock_kernel();
> + return err;
> }
> #endif
>
> @@ -1209,7 +1212,6 @@
> con_log(CL_DLEVEL1 , ("exiting common mod\n"));
>
> unregister_chrdev(majorno, "megadev");
> - unregister_ioctl32_conversion(MEGAIOCCMD);
> }
>
> module_init(mraid_mm_init);
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Convert megaraid2 to compat_ioctl
2005-02-07 21:01 Ju, Seokmann
@ 2005-02-07 21:07 ` Matthew Wilcox
2005-02-07 21:12 ` James Bottomley
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Wilcox @ 2005-02-07 21:07 UTC (permalink / raw)
To: Ju, Seokmann; +Cc: 'Andi Kleen', James.Bottomley, linux-scsi
On Mon, Feb 07, 2005 at 04:01:11PM -0500, Ju, Seokmann wrote:
> The kernel that I'm using is 2.6.9 and there is NO entry 'compat_ioctl' on
> file_operations structure which is defined in <linux/fs.h>.
You need to use 2.6.11-rc3 (maybe the patches were in -rc1 or -rc2 as well).
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Convert megaraid2 to compat_ioctl
2005-02-07 21:07 ` Matthew Wilcox
@ 2005-02-07 21:12 ` James Bottomley
0 siblings, 0 replies; 6+ messages in thread
From: James Bottomley @ 2005-02-07 21:12 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Ju, Seokmann, 'Andi Kleen', SCSI Mailing List
On Mon, 2005-02-07 at 21:07 +0000, Matthew Wilcox wrote:
> On Mon, Feb 07, 2005 at 04:01:11PM -0500, Ju, Seokmann wrote:
> > The kernel that I'm using is 2.6.9 and there is NO entry 'compat_ioctl' on
> > file_operations structure which is defined in <linux/fs.h>.
>
> You need to use 2.6.11-rc3 (maybe the patches were in -rc1 or -rc2 as well).
Actually, if you could just try
bk://linux-scsi.bkbits.net/scsi-misc-2.6
which is where I've put all the compat_ioctl conversions
The diffs (against -rc2 or -rc3) are in
http://parisc-linux.org/~jejb/scsi_diffs/
James
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-02-07 21:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-18 11:17 [PATCH] Convert megaraid2 to compat_ioctl Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2005-02-03 16:01 Ju, Seokmann
2005-02-03 21:12 ` Andi Kleen
2005-02-07 21:01 Ju, Seokmann
2005-02-07 21:07 ` Matthew Wilcox
2005-02-07 21:12 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox