Skip to content

Commit

Permalink
kernfs: no point locking directory around that generic_file_llseek()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 9, 2016
1 parent a01b300 commit 8cb0d2c
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions fs/kernfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1643,22 +1643,9 @@ static int kernfs_fop_readdir(struct file *file, struct dir_context *ctx)
return 0;
}

static loff_t kernfs_dir_fop_llseek(struct file *file, loff_t offset,
int whence)
{
struct inode *inode = file_inode(file);
loff_t ret;

inode_lock(inode);
ret = generic_file_llseek(file, offset, whence);
inode_unlock(inode);

return ret;
}

const struct file_operations kernfs_dir_fops = {
.read = generic_read_dir,
.iterate = kernfs_fop_readdir,
.iterate_shared = kernfs_fop_readdir,
.release = kernfs_dir_fop_release,
.llseek = kernfs_dir_fop_llseek,
.llseek = generic_file_llseek,
};

0 comments on commit 8cb0d2c

Please sign in to comment.