summaryrefslogtreecommitdiffstats
path: root/fs/fat/dir.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-05-17 08:13:47 +0900
committerOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2010-05-17 08:16:12 +0900
commit7845bc3e132605e3e8a1f37748e29281164b65f5 (patch)
treea6437b673ed42e498fd89917ac3e0aa9a5fb678e /fs/fat/dir.c
parent1bdb6f9199def1c3538c18089e499f5df5ff1747 (diff)
downloadlinux-7845bc3e132605e3e8a1f37748e29281164b65f5.tar.bz2
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.c11
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,
return ret;
}
-static int fat_dir_ioctl(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
+static long fat_dir_ioctl(struct file *filp, unsigned int cmd,
+ unsigned long arg)
{
+ struct inode *inode = filp->f_path.dentry->d_inode;
struct __fat_dirent __user *d1 = (struct __fat_dirent __user *)arg;
int short_only, both;
@@ -769,7 +770,7 @@ static int fat_dir_ioctl(struct inode *inode, struct file *filp,
both = 1;
break;
default:
- return fat_generic_ioctl(inode, filp, cmd, arg);
+ return fat_generic_ioctl(filp, cmd, arg);
}
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,
both = 1;
break;
default:
- return -ENOIOCTLCMD;
+ return fat_generic_ioctl(filp, cmd, (unsigned long)arg);
}
if (!access_ok(VERIFY_WRITE, d1, sizeof(struct compat_dirent[2])))
@@ -831,7 +832,7 @@ const struct file_operations fat_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.readdir = fat_readdir,
- .ioctl = fat_dir_ioctl,
+ .unlocked_ioctl = fat_dir_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = fat_compat_dir_ioctl,
#endif