diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-05-16 19:13:47 -0400 |
---|---|---|
committer | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2010-05-16 19:16:12 -0400 |
commit | 7845bc3e132605e3e8a1f37748e29281164b65f5 (patch) | |
tree | a6437b673ed42e498fd89917ac3e0aa9a5fb678e /fs/fat/dir.c | |
parent | 1bdb6f9199def1c3538c18089e499f5df5ff1747 (diff) |
fat: convert to unlocked_ioctl
FAT does not require the BKL in its ioctl function, which is already serialized
through a mutex. Since we're already touching the ioctl code, also fix the
missing handling of FAT_IOCTL_GET_ATTRIBUTES in the compat code.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Diffstat (limited to 'fs/fat/dir.c')
-rw-r--r-- | fs/fat/dir.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 20a1b92e035e..ee42b9e0b16a 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c | |||
@@ -753,9 +753,10 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *filp, | |||
753 | return ret; | 753 | return ret; |
754 | } | 754 | } |
755 | 755 | ||
756 | static int fat_dir_ioctl(struct inode *inode, struct file *filp, | 756 | static long fat_dir_ioctl(struct file *filp, unsigned int cmd, |
757 | unsigned int cmd, unsigned long arg) | 757 | unsigned long arg) |
758 | { | 758 | { |
759 | struct inode *inode = filp->f_path.dentry->d_inode; | ||
759 | struct __fat_dirent __user *d1 = (struct __fat_dirent __user *)arg; | 760 | struct __fat_dirent __user *d1 = (struct __fat_dirent __user *)arg; |
760 | int short_only, both; | 761 | int short_only, both; |
761 | 762 | ||
@@ -769,7 +770,7 @@ static int fat_dir_ioctl(struct inode *inode, struct file *filp, | |||
769 | both = 1; | 770 | both = 1; |
770 | break; | 771 | break; |
771 | default: | 772 | default: |
772 | return fat_generic_ioctl(inode, filp, cmd, arg); | 773 | return fat_generic_ioctl(filp, cmd, arg); |
773 | } | 774 | } |
774 | 775 | ||
775 | if (!access_ok(VERIFY_WRITE, d1, sizeof(struct __fat_dirent[2]))) | 776 | if (!access_ok(VERIFY_WRITE, d1, sizeof(struct __fat_dirent[2]))) |
@@ -809,7 +810,7 @@ static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd, | |||
809 | both = 1; | 810 | both = 1; |
810 | break; | 811 | break; |
811 | default: | 812 | default: |
812 | return -ENOIOCTLCMD; | 813 | return fat_generic_ioctl(filp, cmd, (unsigned long)arg); |
813 | } | 814 | } |
814 | 815 | ||
815 | if (!access_ok(VERIFY_WRITE, d1, sizeof(struct compat_dirent[2]))) | 816 | if (!access_ok(VERIFY_WRITE, d1, sizeof(struct compat_dirent[2]))) |
@@ -831,7 +832,7 @@ const struct file_operations fat_dir_operations = { | |||
831 | .llseek = generic_file_llseek, | 832 | .llseek = generic_file_llseek, |
832 | .read = generic_read_dir, | 833 | .read = generic_read_dir, |
833 | .readdir = fat_readdir, | 834 | .readdir = fat_readdir, |
834 | .ioctl = fat_dir_ioctl, | 835 | .unlocked_ioctl = fat_dir_ioctl, |
835 | #ifdef CONFIG_COMPAT | 836 | #ifdef CONFIG_COMPAT |
836 | .compat_ioctl = fat_compat_dir_ioctl, | 837 | .compat_ioctl = fat_compat_dir_ioctl, |
837 | #endif | 838 | #endif |