Commit 98d4b8d8 authored by Al Viro's avatar Al Viro

fat: switch to ->iterate_shared()

... and make that weird ioctl lock directory only shared.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent d375570f
...@@ -769,7 +769,7 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *file, ...@@ -769,7 +769,7 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *file,
buf.dirent = dirent; buf.dirent = dirent;
buf.result = 0; buf.result = 0;
inode_lock(inode); inode_lock_shared(inode);
buf.ctx.pos = file->f_pos; buf.ctx.pos = file->f_pos;
ret = -ENOENT; ret = -ENOENT;
if (!IS_DEADDIR(inode)) { if (!IS_DEADDIR(inode)) {
...@@ -777,7 +777,7 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *file, ...@@ -777,7 +777,7 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *file,
short_only, both ? &buf : NULL); short_only, both ? &buf : NULL);
file->f_pos = buf.ctx.pos; file->f_pos = buf.ctx.pos;
} }
inode_unlock(inode); inode_unlock_shared(inode);
if (ret >= 0) if (ret >= 0)
ret = buf.result; ret = buf.result;
return ret; return ret;
...@@ -861,7 +861,7 @@ static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd, ...@@ -861,7 +861,7 @@ static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd,
const struct file_operations fat_dir_operations = { const struct file_operations fat_dir_operations = {
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
.read = generic_read_dir, .read = generic_read_dir,
.iterate = fat_readdir, .iterate_shared = fat_readdir,
.unlocked_ioctl = fat_dir_ioctl, .unlocked_ioctl = fat_dir_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = fat_compat_dir_ioctl, .compat_ioctl = fat_compat_dir_ioctl,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment