Skip to content

Commit

Permalink
fat: switch to ->iterate_shared()
Browse files Browse the repository at this point in the history
... and make that weird ioctl lock directory only shared.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 9, 2016
1 parent d375570 commit 98d4b8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/fat/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,15 +769,15 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *file,

buf.dirent = dirent;
buf.result = 0;
inode_lock(inode);
inode_lock_shared(inode);
buf.ctx.pos = file->f_pos;
ret = -ENOENT;
if (!IS_DEADDIR(inode)) {
ret = __fat_readdir(inode, file, &buf.ctx,
short_only, both ? &buf : NULL);
file->f_pos = buf.ctx.pos;
}
inode_unlock(inode);
inode_unlock_shared(inode);
if (ret >= 0)
ret = buf.result;
return ret;
Expand Down Expand Up @@ -861,7 +861,7 @@ static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd,
const struct file_operations fat_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.iterate = fat_readdir,
.iterate_shared = fat_readdir,
.unlocked_ioctl = fat_dir_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = fat_compat_dir_ioctl,
Expand Down

0 comments on commit 98d4b8d

Please sign in to comment.