[opensuse-kernel] 2.6.36-rc3-9-desktop and ioctl
When trying to build the nvidia drivers and virtualbox drivers I'm getting an error about on unknown field 'ioctl' specified in initializer. Is this a regression, or does everyone just need to catch up with this kernel? Thanks, Stephen -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
* Stephen Shaw (sshaw@decriptor.com) [20100903 17:18]:
When trying to build the nvidia drivers and virtualbox drivers I'm getting an error about on unknown field 'ioctl' specified in initializer.
Yes, seems that struct file_operations has changed in 2.6.36. Philipp -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
At Fri, 3 Sep 2010 09:18:01 -0600, Stephen Shaw wrote:
When trying to build the nvidia drivers and virtualbox drivers I'm getting an error about on unknown field 'ioctl' specified in initializer.
Is this a regression, or does everyone just need to catch up with this kernel?
The ioctl ops in struct file_operations is deprecated on 2.6.36. You need to convert it to unlocked_ioctl ops. If you are lucky, just changing the second argument (struct file*) and the return type of the old ioctl function from int to long might make things working (supposing no BKL is needed). Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
At Fri, 03 Sep 2010 17:52:06 +0200, 私 wrote:
At Fri, 3 Sep 2010 09:18:01 -0600, Stephen Shaw wrote:
When trying to build the nvidia drivers and virtualbox drivers I'm getting an error about on unknown field 'ioctl' specified in initializer.
Is this a regression, or does everyone just need to catch up with this kernel?
The ioctl ops in struct file_operations is deprecated on 2.6.36. You need to convert it to unlocked_ioctl ops.
If you are lucky, just changing the second argument (struct file*) and the return type of the old ioctl function from int to long might make things working (supposing no BKL is needed).
That is, suppose the function below static int foo_ioctl(struct inode *in, struct file *filp, unisgned int cmd, unsigned long arg) { ... } this should be converted like: static long foo_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { } If BKL matters, you can wrap it like: /* keep the original */ static int foo_ioctl(struct inode *in, struct file *filp, unisgned int cmd, unsigned long arg) { ... } /* wrap the above with BKL */ static long foo_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { long ret; lock_kernel(); ret = foo_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); unlock_kernel(); return ret; } The first argument (filp->f_path.dentry->d_inode) can be NULL in most cases, too. In both cases, replace the corresponding entry such as static const struct file_operations foo_fops = { .open = foo_open, ... .ioctl = foo_ioctl, with .unlocked_ioctl = foo_ioctl, HTH, Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
participants (3)
-
Philipp Thomas
-
Stephen Shaw
-
Takashi Iwai