diff options
| -rw-r--r-- | drivers/media/video/v4l2-dev.c | 52 | ||||
| -rw-r--r-- | drivers/staging/easycap/easycap.h | 8 | ||||
| -rw-r--r-- | drivers/staging/easycap/easycap_ioctl.c | 52 | ||||
| -rw-r--r-- | drivers/staging/easycap/easycap_main.c | 38 | ||||
| -rw-r--r-- | fs/autofs/root.c | 67 | ||||
| -rw-r--r-- | fs/autofs4/root.c | 49 | ||||
| -rw-r--r-- | fs/compat_ioctl.c | 36 | ||||
| -rw-r--r-- | fs/ncpfs/ioctl.c | 1 | ||||
| -rw-r--r-- | include/linux/auto_fs.h | 1 |
9 files changed, 180 insertions, 124 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 9e89bf617790..249af6a1d56d 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 26 | #include <linux/kmod.h> | 26 | #include <linux/kmod.h> |
| 27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 28 | #include <linux/smp_lock.h> | ||
| 28 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
| 29 | #include <asm/system.h> | 30 | #include <asm/system.h> |
| 30 | 31 | ||
| @@ -215,28 +216,24 @@ static unsigned int v4l2_poll(struct file *filp, struct poll_table_struct *poll) | |||
| 215 | return vdev->fops->poll(filp, poll); | 216 | return vdev->fops->poll(filp, poll); |
| 216 | } | 217 | } |
| 217 | 218 | ||
| 218 | static int v4l2_ioctl(struct inode *inode, struct file *filp, | 219 | static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
| 219 | unsigned int cmd, unsigned long arg) | ||
| 220 | { | 220 | { |
| 221 | struct video_device *vdev = video_devdata(filp); | 221 | struct video_device *vdev = video_devdata(filp); |
| 222 | int ret; | ||
| 222 | 223 | ||
| 223 | if (!vdev->fops->ioctl) | ||
| 224 | return -ENOTTY; | ||
| 225 | /* Allow ioctl to continue even if the device was unregistered. | 224 | /* Allow ioctl to continue even if the device was unregistered. |
| 226 | Things like dequeueing buffers might still be useful. */ | 225 | Things like dequeueing buffers might still be useful. */ |
| 227 | return vdev->fops->ioctl(filp, cmd, arg); | 226 | if (vdev->fops->unlocked_ioctl) { |
| 228 | } | 227 | ret = vdev->fops->unlocked_ioctl(filp, cmd, arg); |
| 229 | 228 | } else if (vdev->fops->ioctl) { | |
| 230 | static long v4l2_unlocked_ioctl(struct file *filp, | 229 | /* TODO: convert all drivers to unlocked_ioctl */ |
| 231 | unsigned int cmd, unsigned long arg) | 230 | lock_kernel(); |
| 232 | { | 231 | ret = vdev->fops->ioctl(filp, cmd, arg); |
| 233 | struct video_device *vdev = video_devdata(filp); | 232 | unlock_kernel(); |
| 233 | } else | ||
| 234 | ret = -ENOTTY; | ||
| 234 | 235 | ||
| 235 | if (!vdev->fops->unlocked_ioctl) | 236 | return ret; |
| 236 | return -ENOTTY; | ||
| 237 | /* Allow ioctl to continue even if the device was unregistered. | ||
| 238 | Things like dequeueing buffers might still be useful. */ | ||
| 239 | return vdev->fops->unlocked_ioctl(filp, cmd, arg); | ||
| 240 | } | 237 | } |
| 241 | 238 | ||
| 242 | #ifdef CONFIG_MMU | 239 | #ifdef CONFIG_MMU |
| @@ -307,22 +304,6 @@ static int v4l2_release(struct inode *inode, struct file *filp) | |||
| 307 | return ret; | 304 | return ret; |
| 308 | } | 305 | } |
| 309 | 306 | ||
| 310 | static const struct file_operations v4l2_unlocked_fops = { | ||
| 311 | .owner = THIS_MODULE, | ||
| 312 | .read = v4l2_read, | ||
| 313 | .write = v4l2_write, | ||
| 314 | .open = v4l2_open, | ||
| 315 | .get_unmapped_area = v4l2_get_unmapped_area, | ||
| 316 | .mmap = v4l2_mmap, | ||
| 317 | .unlocked_ioctl = v4l2_unlocked_ioctl, | ||
| 318 | #ifdef CONFIG_COMPAT | ||
| 319 | .compat_ioctl = v4l2_compat_ioctl32, | ||
| 320 | #endif | ||
| 321 | .release = v4l2_release, | ||
| 322 | .poll = v4l2_poll, | ||
| 323 | .llseek = no_llseek, | ||
| 324 | }; | ||
| 325 | |||
| 326 | static const struct file_operations v4l2_fops = { | 307 | static const struct file_operations v4l2_fops = { |
| 327 | .owner = THIS_MODULE, | 308 | .owner = THIS_MODULE, |
| 328 | .read = v4l2_read, | 309 | .read = v4l2_read, |
| @@ -330,7 +311,7 @@ static const struct file_operations v4l2_fops = { | |||
| 330 | .open = v4l2_open, | 311 | .open = v4l2_open, |
| 331 | .get_unmapped_area = v4l2_get_unmapped_area, | 312 | .get_unmapped_area = v4l2_get_unmapped_area, |
| 332 | .mmap = v4l2_mmap, | 313 | .mmap = v4l2_mmap, |
| 333 | .ioctl = v4l2_ioctl, | 314 | .unlocked_ioctl = v4l2_ioctl, |
| 334 | #ifdef CONFIG_COMPAT | 315 | #ifdef CONFIG_COMPAT |
| 335 | .compat_ioctl = v4l2_compat_ioctl32, | 316 | .compat_ioctl = v4l2_compat_ioctl32, |
| 336 | #endif | 317 | #endif |
| @@ -521,10 +502,7 @@ static int __video_register_device(struct video_device *vdev, int type, int nr, | |||
| 521 | ret = -ENOMEM; | 502 | ret = -ENOMEM; |
| 522 | goto cleanup; | 503 | goto cleanup; |
| 523 | } | 504 | } |
| 524 | if (vdev->fops->unlocked_ioctl) | 505 | vdev->cdev->ops = &v4l2_fops; |
| 525 | vdev->cdev->ops = &v4l2_unlocked_fops; | ||
| 526 | else | ||
| 527 | vdev->cdev->ops = &v4l2_fops; | ||
| 528 | vdev->cdev->owner = vdev->fops->owner; | 506 | vdev->cdev->owner = vdev->fops->owner; |
| 529 | ret = cdev_add(vdev->cdev, MKDEV(VIDEO_MAJOR, vdev->minor), 1); | 507 | ret = cdev_add(vdev->cdev, MKDEV(VIDEO_MAJOR, vdev->minor), 1); |
| 530 | if (ret < 0) { | 508 | if (ret < 0) { |
diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h index ad836d2d26fe..f3c827eb0abe 100644 --- a/drivers/staging/easycap/easycap.h +++ b/drivers/staging/easycap/easycap.h | |||
| @@ -463,15 +463,12 @@ struct data_buffer audio_buffer[]; | |||
| 463 | void easycap_complete(struct urb *); | 463 | void easycap_complete(struct urb *); |
| 464 | int easycap_open(struct inode *, struct file *); | 464 | int easycap_open(struct inode *, struct file *); |
| 465 | int easycap_release(struct inode *, struct file *); | 465 | int easycap_release(struct inode *, struct file *); |
| 466 | int easycap_ioctl(struct inode *, struct file *, \ | 466 | long easycap_ioctl(struct file *, unsigned int, unsigned long); |
| 467 | unsigned int, unsigned long); | ||
| 468 | 467 | ||
| 469 | /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ | 468 | /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ |
| 470 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) | 469 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) |
| 471 | int easycap_open_noinode(struct file *); | 470 | int easycap_open_noinode(struct file *); |
| 472 | int easycap_release_noinode(struct file *); | 471 | int easycap_release_noinode(struct file *); |
| 473 | long easycap_ioctl_noinode(struct file *, \ | ||
| 474 | unsigned int, unsigned long); | ||
| 475 | int videodev_release(struct video_device *); | 472 | int videodev_release(struct video_device *); |
| 476 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ | 473 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ |
| 477 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ | 474 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ |
| @@ -515,8 +512,7 @@ void easysnd_complete(struct urb *); | |||
| 515 | ssize_t easysnd_read(struct file *, char __user *, size_t, loff_t *); | 512 | ssize_t easysnd_read(struct file *, char __user *, size_t, loff_t *); |
| 516 | int easysnd_open(struct inode *, struct file *); | 513 | int easysnd_open(struct inode *, struct file *); |
| 517 | int easysnd_release(struct inode *, struct file *); | 514 | int easysnd_release(struct inode *, struct file *); |
| 518 | int easysnd_ioctl(struct inode *, struct file *, \ | 515 | long easysnd_ioctl(struct file *, unsigned int, unsigned long); |
| 519 | unsigned int, unsigned long); | ||
| 520 | unsigned int easysnd_poll(struct file *, poll_table *); | 516 | unsigned int easysnd_poll(struct file *, poll_table *); |
| 521 | void easysnd_delete(struct kref *); | 517 | void easysnd_delete(struct kref *); |
| 522 | int submit_audio_urbs(struct easycap *); | 518 | int submit_audio_urbs(struct easycap *); |
diff --git a/drivers/staging/easycap/easycap_ioctl.c b/drivers/staging/easycap/easycap_ioctl.c index 276b63dfe27e..9a42ae02cd5d 100644 --- a/drivers/staging/easycap/easycap_ioctl.c +++ b/drivers/staging/easycap/easycap_ioctl.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | */ | 25 | */ |
| 26 | /*****************************************************************************/ | 26 | /*****************************************************************************/ |
| 27 | 27 | ||
| 28 | #include <linux/smp_lock.h> | ||
| 28 | #include "easycap.h" | 29 | #include "easycap.h" |
| 29 | #include "easycap_debug.h" | 30 | #include "easycap_debug.h" |
| 30 | #include "easycap_standard.h" | 31 | #include "easycap_standard.h" |
| @@ -773,19 +774,10 @@ while (0xFFFFFFFF != easycap_control[i1].id) { | |||
| 773 | SAY("WARNING: failed to adjust mute: control not found\n"); | 774 | SAY("WARNING: failed to adjust mute: control not found\n"); |
| 774 | return -ENOENT; | 775 | return -ENOENT; |
| 775 | } | 776 | } |
| 776 | /****************************************************************************/ | 777 | |
| 777 | /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ | ||
| 778 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) | ||
| 779 | long | ||
| 780 | easycap_ioctl_noinode(struct file *file, unsigned int cmd, unsigned long arg)\ | ||
| 781 | { | ||
| 782 | return easycap_ioctl((struct inode *)NULL, file, cmd, arg); | ||
| 783 | } | ||
| 784 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ | ||
| 785 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ | ||
| 786 | /*--------------------------------------------------------------------------*/ | 778 | /*--------------------------------------------------------------------------*/ |
| 787 | int easycap_ioctl(struct inode *inode, struct file *file, \ | 779 | static int easycap_ioctl_bkl(struct inode *inode, struct file *file, |
| 788 | unsigned int cmd, unsigned long arg) | 780 | unsigned int cmd, unsigned long arg) |
| 789 | { | 781 | { |
| 790 | static struct easycap *peasycap; | 782 | static struct easycap *peasycap; |
| 791 | static struct usb_device *p; | 783 | static struct usb_device *p; |
| @@ -1956,19 +1948,22 @@ default: { | |||
| 1956 | } | 1948 | } |
| 1957 | return 0; | 1949 | return 0; |
| 1958 | } | 1950 | } |
| 1959 | /****************************************************************************/ | 1951 | |
| 1960 | /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ | 1952 | long easycap_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
| 1961 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) | ||
| 1962 | long | ||
| 1963 | easysnd_ioctl_noinode(struct file *file, unsigned int cmd, unsigned long arg) | ||
| 1964 | { | 1953 | { |
| 1965 | return easysnd_ioctl((struct inode *)NULL, file, cmd, arg); | 1954 | struct inode *inode = file->f_dentry->d_inode; |
| 1955 | long ret; | ||
| 1956 | |||
| 1957 | lock_kernel(); | ||
| 1958 | ret = easycap_ioctl_bkl(inode, file, cmd, arg); | ||
| 1959 | unlock_kernel(); | ||
| 1960 | |||
| 1961 | return ret; | ||
| 1966 | } | 1962 | } |
| 1967 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ | 1963 | |
| 1968 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ | ||
| 1969 | /*--------------------------------------------------------------------------*/ | 1964 | /*--------------------------------------------------------------------------*/ |
| 1970 | int easysnd_ioctl(struct inode *inode, struct file *file, \ | 1965 | static int easysnd_ioctl_bkl(struct inode *inode, struct file *file, |
| 1971 | unsigned int cmd, unsigned long arg) | 1966 | unsigned int cmd, unsigned long arg) |
| 1972 | { | 1967 | { |
| 1973 | struct easycap *peasycap; | 1968 | struct easycap *peasycap; |
| 1974 | struct usb_device *p; | 1969 | struct usb_device *p; |
| @@ -2158,6 +2153,19 @@ default: { | |||
| 2158 | } | 2153 | } |
| 2159 | return 0; | 2154 | return 0; |
| 2160 | } | 2155 | } |
| 2156 | |||
| 2157 | long easysnd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
| 2158 | { | ||
| 2159 | struct inode *inode = file->f_dentry->d_inode; | ||
| 2160 | long ret; | ||
| 2161 | |||
| 2162 | lock_kernel(); | ||
| 2163 | ret = easysnd_ioctl_bkl(inode, file, cmd, arg); | ||
| 2164 | unlock_kernel(); | ||
| 2165 | |||
| 2166 | return ret; | ||
| 2167 | } | ||
| 2168 | |||
| 2161 | /*****************************************************************************/ | 2169 | /*****************************************************************************/ |
| 2162 | int explain_ioctl(__u32 wot) | 2170 | int explain_ioctl(__u32 wot) |
| 2163 | { | 2171 | { |
diff --git a/drivers/staging/easycap/easycap_main.c b/drivers/staging/easycap/easycap_main.c index 09c194ce10a3..5a4bbd9b453f 100644 --- a/drivers/staging/easycap/easycap_main.c +++ b/drivers/staging/easycap/easycap_main.c | |||
| @@ -60,13 +60,13 @@ struct usb_driver easycap_usb_driver = { | |||
| 60 | */ | 60 | */ |
| 61 | /*---------------------------------------------------------------------------*/ | 61 | /*---------------------------------------------------------------------------*/ |
| 62 | const struct file_operations easycap_fops = { | 62 | const struct file_operations easycap_fops = { |
| 63 | .owner = THIS_MODULE, | 63 | .owner = THIS_MODULE, |
| 64 | .open = easycap_open, | 64 | .open = easycap_open, |
| 65 | .release = easycap_release, | 65 | .release = easycap_release, |
| 66 | .ioctl = easycap_ioctl, | 66 | .unlocked_ioctl = easycap_ioctl, |
| 67 | .poll = easycap_poll, | 67 | .poll = easycap_poll, |
| 68 | .mmap = easycap_mmap, | 68 | .mmap = easycap_mmap, |
| 69 | .llseek = no_llseek, | 69 | .llseek = no_llseek, |
| 70 | }; | 70 | }; |
| 71 | struct vm_operations_struct easycap_vm_ops = { | 71 | struct vm_operations_struct easycap_vm_ops = { |
| 72 | .open = easycap_vma_open, | 72 | .open = easycap_vma_open, |
| @@ -83,12 +83,12 @@ struct usb_class_driver easycap_class = { | |||
| 83 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) | 83 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) |
| 84 | #if defined(EASYCAP_NEEDS_V4L2_FOPS) | 84 | #if defined(EASYCAP_NEEDS_V4L2_FOPS) |
| 85 | const struct v4l2_file_operations v4l2_fops = { | 85 | const struct v4l2_file_operations v4l2_fops = { |
| 86 | .owner = THIS_MODULE, | 86 | .owner = THIS_MODULE, |
| 87 | .open = easycap_open_noinode, | 87 | .open = easycap_open_noinode, |
| 88 | .release = easycap_release_noinode, | 88 | .release = easycap_release_noinode, |
| 89 | .ioctl = easycap_ioctl_noinode, | 89 | .unlocked_ioctl = easycap_ioctl, |
| 90 | .poll = easycap_poll, | 90 | .poll = easycap_poll, |
| 91 | .mmap = easycap_mmap, | 91 | .mmap = easycap_mmap, |
| 92 | }; | 92 | }; |
| 93 | #endif /*EASYCAP_NEEDS_V4L2_FOPS*/ | 93 | #endif /*EASYCAP_NEEDS_V4L2_FOPS*/ |
| 94 | int video_device_many /*=0*/; | 94 | int video_device_many /*=0*/; |
| @@ -102,12 +102,12 @@ struct video_device *pvideo_array[VIDEO_DEVICE_MANY], *pvideo_device; | |||
| 102 | */ | 102 | */ |
| 103 | /*--------------------------------------------------------------------------*/ | 103 | /*--------------------------------------------------------------------------*/ |
| 104 | const struct file_operations easysnd_fops = { | 104 | const struct file_operations easysnd_fops = { |
| 105 | .owner = THIS_MODULE, | 105 | .owner = THIS_MODULE, |
| 106 | .open = easysnd_open, | 106 | .open = easysnd_open, |
| 107 | .release = easysnd_release, | 107 | .release = easysnd_release, |
| 108 | .ioctl = easysnd_ioctl, | 108 | .unlocked_ioctl = easysnd_ioctl, |
| 109 | .read = easysnd_read, | 109 | .read = easysnd_read, |
| 110 | .llseek = no_llseek, | 110 | .llseek = no_llseek, |
| 111 | }; | 111 | }; |
| 112 | struct usb_class_driver easysnd_class = { | 112 | struct usb_class_driver easysnd_class = { |
| 113 | .name = "usb/easysnd%d", | 113 | .name = "usb/easysnd%d", |
diff --git a/fs/autofs/root.c b/fs/autofs/root.c index 9a0520b50663..11b1ea786d00 100644 --- a/fs/autofs/root.c +++ b/fs/autofs/root.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
| 17 | #include <linux/param.h> | 17 | #include <linux/param.h> |
| 18 | #include <linux/time.h> | 18 | #include <linux/time.h> |
| 19 | #include <linux/compat.h> | ||
| 19 | #include <linux/smp_lock.h> | 20 | #include <linux/smp_lock.h> |
| 20 | #include "autofs_i.h" | 21 | #include "autofs_i.h" |
| 21 | 22 | ||
| @@ -25,13 +26,17 @@ static int autofs_root_symlink(struct inode *,struct dentry *,const char *); | |||
| 25 | static int autofs_root_unlink(struct inode *,struct dentry *); | 26 | static int autofs_root_unlink(struct inode *,struct dentry *); |
| 26 | static int autofs_root_rmdir(struct inode *,struct dentry *); | 27 | static int autofs_root_rmdir(struct inode *,struct dentry *); |
| 27 | static int autofs_root_mkdir(struct inode *,struct dentry *,int); | 28 | static int autofs_root_mkdir(struct inode *,struct dentry *,int); |
| 28 | static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long); | 29 | static long autofs_root_ioctl(struct file *,unsigned int,unsigned long); |
| 30 | static long autofs_root_compat_ioctl(struct file *,unsigned int,unsigned long); | ||
| 29 | 31 | ||
| 30 | const struct file_operations autofs_root_operations = { | 32 | const struct file_operations autofs_root_operations = { |
| 31 | .llseek = generic_file_llseek, | 33 | .llseek = generic_file_llseek, |
| 32 | .read = generic_read_dir, | 34 | .read = generic_read_dir, |
| 33 | .readdir = autofs_root_readdir, | 35 | .readdir = autofs_root_readdir, |
| 34 | .ioctl = autofs_root_ioctl, | 36 | .unlocked_ioctl = autofs_root_ioctl, |
| 37 | #ifdef CONFIG_COMPAT | ||
| 38 | .compat_ioctl = autofs_root_compat_ioctl, | ||
| 39 | #endif | ||
| 35 | }; | 40 | }; |
| 36 | 41 | ||
| 37 | const struct inode_operations autofs_root_inode_operations = { | 42 | const struct inode_operations autofs_root_inode_operations = { |
| @@ -492,6 +497,25 @@ static int autofs_root_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
| 492 | } | 497 | } |
| 493 | 498 | ||
| 494 | /* Get/set timeout ioctl() operation */ | 499 | /* Get/set timeout ioctl() operation */ |
| 500 | #ifdef CONFIG_COMPAT | ||
| 501 | static inline int autofs_compat_get_set_timeout(struct autofs_sb_info *sbi, | ||
| 502 | unsigned int __user *p) | ||
| 503 | { | ||
| 504 | unsigned long ntimeout; | ||
| 505 | |||
| 506 | if (get_user(ntimeout, p) || | ||
| 507 | put_user(sbi->exp_timeout / HZ, p)) | ||
| 508 | return -EFAULT; | ||
| 509 | |||
| 510 | if (ntimeout > UINT_MAX/HZ) | ||
| 511 | sbi->exp_timeout = 0; | ||
| 512 | else | ||
| 513 | sbi->exp_timeout = ntimeout * HZ; | ||
| 514 | |||
| 515 | return 0; | ||
| 516 | } | ||
| 517 | #endif | ||
| 518 | |||
| 495 | static inline int autofs_get_set_timeout(struct autofs_sb_info *sbi, | 519 | static inline int autofs_get_set_timeout(struct autofs_sb_info *sbi, |
| 496 | unsigned long __user *p) | 520 | unsigned long __user *p) |
| 497 | { | 521 | { |
| @@ -546,7 +570,7 @@ static inline int autofs_expire_run(struct super_block *sb, | |||
| 546 | * ioctl()'s on the root directory is the chief method for the daemon to | 570 | * ioctl()'s on the root directory is the chief method for the daemon to |
| 547 | * generate kernel reactions | 571 | * generate kernel reactions |
| 548 | */ | 572 | */ |
| 549 | static int autofs_root_ioctl(struct inode *inode, struct file *filp, | 573 | static int autofs_do_root_ioctl(struct inode *inode, struct file *filp, |
| 550 | unsigned int cmd, unsigned long arg) | 574 | unsigned int cmd, unsigned long arg) |
| 551 | { | 575 | { |
| 552 | struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb); | 576 | struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb); |
| @@ -571,6 +595,10 @@ static int autofs_root_ioctl(struct inode *inode, struct file *filp, | |||
| 571 | return 0; | 595 | return 0; |
| 572 | case AUTOFS_IOC_PROTOVER: /* Get protocol version */ | 596 | case AUTOFS_IOC_PROTOVER: /* Get protocol version */ |
| 573 | return autofs_get_protover(argp); | 597 | return autofs_get_protover(argp); |
| 598 | #ifdef CONFIG_COMPAT | ||
| 599 | case AUTOFS_IOC_SETTIMEOUT32: | ||
| 600 | return autofs_compat_get_set_timeout(sbi, argp); | ||
| 601 | #endif | ||
| 574 | case AUTOFS_IOC_SETTIMEOUT: | 602 | case AUTOFS_IOC_SETTIMEOUT: |
| 575 | return autofs_get_set_timeout(sbi, argp); | 603 | return autofs_get_set_timeout(sbi, argp); |
| 576 | case AUTOFS_IOC_EXPIRE: | 604 | case AUTOFS_IOC_EXPIRE: |
| @@ -579,4 +607,37 @@ static int autofs_root_ioctl(struct inode *inode, struct file *filp, | |||
| 579 | default: | 607 | default: |
| 580 | return -ENOSYS; | 608 | return -ENOSYS; |
| 581 | } | 609 | } |
| 610 | |||
| 611 | } | ||
| 612 | |||
| 613 | static long autofs_root_ioctl(struct file *filp, | ||
| 614 | unsigned int cmd, unsigned long arg) | ||
| 615 | { | ||
| 616 | int ret; | ||
| 617 | |||
| 618 | lock_kernel(); | ||
| 619 | ret = autofs_do_root_ioctl(filp->f_path.dentry->d_inode, | ||
| 620 | filp, cmd, arg); | ||
| 621 | unlock_kernel(); | ||
| 622 | |||
| 623 | return ret; | ||
| 624 | } | ||
| 625 | |||
| 626 | #ifdef CONFIG_COMPAT | ||
| 627 | static long autofs_root_compat_ioctl(struct file *filp, | ||
| 628 | unsigned int cmd, unsigned long arg) | ||
| 629 | { | ||
| 630 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
| 631 | int ret; | ||
| 632 | |||
| 633 | lock_kernel(); | ||
| 634 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) | ||
| 635 | ret = autofs_do_root_ioctl(inode, filp, cmd, arg); | ||
| 636 | else | ||
| 637 | ret = autofs_do_root_ioctl(inode, filp, cmd, | ||
| 638 | (unsigned long)compat_ptr(arg)); | ||
| 639 | unlock_kernel(); | ||
| 640 | |||
| 641 | return ret; | ||
| 582 | } | 642 | } |
| 643 | #endif | ||
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index db4117ed7803..48e056e70fd6 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
| @@ -18,7 +18,9 @@ | |||
| 18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
| 19 | #include <linux/param.h> | 19 | #include <linux/param.h> |
| 20 | #include <linux/time.h> | 20 | #include <linux/time.h> |
| 21 | #include <linux/compat.h> | ||
| 21 | #include <linux/smp_lock.h> | 22 | #include <linux/smp_lock.h> |
| 23 | |||
| 22 | #include "autofs_i.h" | 24 | #include "autofs_i.h" |
| 23 | 25 | ||
| 24 | static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *); | 26 | static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *); |
| @@ -26,6 +28,7 @@ static int autofs4_dir_unlink(struct inode *,struct dentry *); | |||
| 26 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); | 28 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); |
| 27 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); | 29 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); |
| 28 | static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); | 30 | static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); |
| 31 | static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long); | ||
| 29 | static int autofs4_dir_open(struct inode *inode, struct file *file); | 32 | static int autofs4_dir_open(struct inode *inode, struct file *file); |
| 30 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); | 33 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); |
| 31 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); | 34 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); |
| @@ -40,6 +43,9 @@ const struct file_operations autofs4_root_operations = { | |||
| 40 | .readdir = dcache_readdir, | 43 | .readdir = dcache_readdir, |
| 41 | .llseek = dcache_dir_lseek, | 44 | .llseek = dcache_dir_lseek, |
| 42 | .unlocked_ioctl = autofs4_root_ioctl, | 45 | .unlocked_ioctl = autofs4_root_ioctl, |
| 46 | #ifdef CONFIG_COMPAT | ||
| 47 | .compat_ioctl = autofs4_root_compat_ioctl, | ||
| 48 | #endif | ||
| 43 | }; | 49 | }; |
| 44 | 50 | ||
| 45 | const struct file_operations autofs4_dir_operations = { | 51 | const struct file_operations autofs4_dir_operations = { |
| @@ -840,6 +846,26 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
| 840 | } | 846 | } |
| 841 | 847 | ||
| 842 | /* Get/set timeout ioctl() operation */ | 848 | /* Get/set timeout ioctl() operation */ |
| 849 | #ifdef CONFIG_COMPAT | ||
| 850 | static inline int autofs4_compat_get_set_timeout(struct autofs_sb_info *sbi, | ||
| 851 | compat_ulong_t __user *p) | ||
| 852 | { | ||
| 853 | int rv; | ||
| 854 | unsigned long ntimeout; | ||
| 855 | |||
| 856 | if ((rv = get_user(ntimeout, p)) || | ||
| 857 | (rv = put_user(sbi->exp_timeout/HZ, p))) | ||
| 858 | return rv; | ||
| 859 | |||
| 860 | if (ntimeout > UINT_MAX/HZ) | ||
| 861 | sbi->exp_timeout = 0; | ||
| 862 | else | ||
| 863 | sbi->exp_timeout = ntimeout * HZ; | ||
| 864 | |||
| 865 | return 0; | ||
| 866 | } | ||
| 867 | #endif | ||
| 868 | |||
| 843 | static inline int autofs4_get_set_timeout(struct autofs_sb_info *sbi, | 869 | static inline int autofs4_get_set_timeout(struct autofs_sb_info *sbi, |
| 844 | unsigned long __user *p) | 870 | unsigned long __user *p) |
| 845 | { | 871 | { |
| @@ -933,6 +959,10 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp, | |||
| 933 | return autofs4_get_protosubver(sbi, p); | 959 | return autofs4_get_protosubver(sbi, p); |
| 934 | case AUTOFS_IOC_SETTIMEOUT: | 960 | case AUTOFS_IOC_SETTIMEOUT: |
| 935 | return autofs4_get_set_timeout(sbi, p); | 961 | return autofs4_get_set_timeout(sbi, p); |
| 962 | #ifdef CONFIG_COMPAT | ||
| 963 | case AUTOFS_IOC_SETTIMEOUT32: | ||
| 964 | return autofs4_compat_get_set_timeout(sbi, p); | ||
| 965 | #endif | ||
| 936 | 966 | ||
| 937 | case AUTOFS_IOC_ASKUMOUNT: | 967 | case AUTOFS_IOC_ASKUMOUNT: |
| 938 | return autofs4_ask_umount(filp->f_path.mnt, p); | 968 | return autofs4_ask_umount(filp->f_path.mnt, p); |
| @@ -961,3 +991,22 @@ static long autofs4_root_ioctl(struct file *filp, | |||
| 961 | 991 | ||
| 962 | return ret; | 992 | return ret; |
| 963 | } | 993 | } |
| 994 | |||
| 995 | #ifdef CONFIG_COMPAT | ||
| 996 | static long autofs4_root_compat_ioctl(struct file *filp, | ||
| 997 | unsigned int cmd, unsigned long arg) | ||
| 998 | { | ||
| 999 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
| 1000 | int ret; | ||
| 1001 | |||
| 1002 | lock_kernel(); | ||
| 1003 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) | ||
| 1004 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | ||
| 1005 | else | ||
| 1006 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, | ||
| 1007 | (unsigned long)compat_ptr(arg)); | ||
| 1008 | unlock_kernel(); | ||
| 1009 | |||
| 1010 | return ret; | ||
| 1011 | } | ||
| 1012 | #endif | ||
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 63ae85831464..5d9b936c458b 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
| @@ -131,23 +131,6 @@ static int w_long(unsigned int fd, unsigned int cmd, | |||
| 131 | return err; | 131 | return err; |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | static int rw_long(unsigned int fd, unsigned int cmd, | ||
| 135 | compat_ulong_t __user *argp) | ||
| 136 | { | ||
| 137 | mm_segment_t old_fs = get_fs(); | ||
| 138 | int err; | ||
| 139 | unsigned long val; | ||
| 140 | |||
| 141 | if(get_user(val, argp)) | ||
| 142 | return -EFAULT; | ||
| 143 | set_fs (KERNEL_DS); | ||
| 144 | err = sys_ioctl(fd, cmd, (unsigned long)&val); | ||
| 145 | set_fs (old_fs); | ||
| 146 | if (!err && put_user(val, argp)) | ||
| 147 | return -EFAULT; | ||
| 148 | return err; | ||
| 149 | } | ||
| 150 | |||
| 151 | struct compat_video_event { | 134 | struct compat_video_event { |
| 152 | int32_t type; | 135 | int32_t type; |
| 153 | compat_time_t timestamp; | 136 | compat_time_t timestamp; |
| @@ -594,12 +577,6 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, | |||
| 594 | return err; | 577 | return err; |
| 595 | } | 578 | } |
| 596 | 579 | ||
| 597 | static int ioc_settimeout(unsigned int fd, unsigned int cmd, | ||
| 598 | compat_ulong_t __user *argp) | ||
| 599 | { | ||
| 600 | return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, argp); | ||
| 601 | } | ||
| 602 | |||
| 603 | /* Bluetooth ioctls */ | 580 | /* Bluetooth ioctls */ |
| 604 | #define HCIUARTSETPROTO _IOW('U', 200, int) | 581 | #define HCIUARTSETPROTO _IOW('U', 200, int) |
| 605 | #define HCIUARTGETPROTO _IOR('U', 201, int) | 582 | #define HCIUARTGETPROTO _IOR('U', 201, int) |
| @@ -1284,13 +1261,6 @@ COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5) | |||
| 1284 | COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS) | 1261 | COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS) |
| 1285 | COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS) | 1262 | COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS) |
| 1286 | COMPATIBLE_IOCTL(OSS_GETVERSION) | 1263 | COMPATIBLE_IOCTL(OSS_GETVERSION) |
| 1287 | /* AUTOFS */ | ||
| 1288 | COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC) | ||
| 1289 | COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER) | ||
| 1290 | COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE) | ||
| 1291 | COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI) | ||
| 1292 | COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER) | ||
| 1293 | COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT) | ||
| 1294 | /* Raw devices */ | 1264 | /* Raw devices */ |
| 1295 | COMPATIBLE_IOCTL(RAW_SETBIND) | 1265 | COMPATIBLE_IOCTL(RAW_SETBIND) |
| 1296 | COMPATIBLE_IOCTL(RAW_GETBIND) | 1266 | COMPATIBLE_IOCTL(RAW_GETBIND) |
| @@ -1557,9 +1527,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd, | |||
| 1557 | case RAW_GETBIND: | 1527 | case RAW_GETBIND: |
| 1558 | return raw_ioctl(fd, cmd, argp); | 1528 | return raw_ioctl(fd, cmd, argp); |
| 1559 | #endif | 1529 | #endif |
| 1560 | #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int) | ||
| 1561 | case AUTOFS_IOC_SETTIMEOUT32: | ||
| 1562 | return ioc_settimeout(fd, cmd, argp); | ||
| 1563 | /* One SMB ioctl needs translations. */ | 1530 | /* One SMB ioctl needs translations. */ |
| 1564 | #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) | 1531 | #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) |
| 1565 | case SMB_IOC_GETMOUNTUID_32: | 1532 | case SMB_IOC_GETMOUNTUID_32: |
| @@ -1614,9 +1581,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd, | |||
| 1614 | case KDSKBMETA: | 1581 | case KDSKBMETA: |
| 1615 | case KDSKBLED: | 1582 | case KDSKBLED: |
| 1616 | case KDSETLED: | 1583 | case KDSETLED: |
| 1617 | /* AUTOFS */ | ||
| 1618 | case AUTOFS_IOC_READY: | ||
| 1619 | case AUTOFS_IOC_FAIL: | ||
| 1620 | /* NBD */ | 1584 | /* NBD */ |
| 1621 | case NBD_SET_SOCK: | 1585 | case NBD_SET_SOCK: |
| 1622 | case NBD_SET_BLKSIZE: | 1586 | case NBD_SET_BLKSIZE: |
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 023c03d02070..84a8cfc4e38e 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/smp_lock.h> | 20 | #include <linux/smp_lock.h> |
| 21 | #include <linux/vmalloc.h> | 21 | #include <linux/vmalloc.h> |
| 22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
| 23 | #include <linux/smp_lock.h> | ||
| 24 | 23 | ||
| 25 | #include <linux/ncp_fs.h> | 24 | #include <linux/ncp_fs.h> |
| 26 | 25 | ||
diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h index 7b09c8348fd3..da64e15004b6 100644 --- a/include/linux/auto_fs.h +++ b/include/linux/auto_fs.h | |||
| @@ -79,6 +79,7 @@ struct autofs_packet_expire { | |||
| 79 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) | 79 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) |
| 80 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) | 80 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) |
| 81 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) | 81 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) |
| 82 | #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t) | ||
| 82 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) | 83 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) |
| 83 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) | 84 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) |
| 84 | 85 | ||
