kernfs: no point locking directory around that generic_file_llseek()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Apr 2016 23:59:01 +0000 (19:59 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 May 2016 15:41:13 +0000 (11:41 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/kernfs/dir.c

index 03b688d19f6964010c27c16759520315892c780d..4f61d19cde1828f686358ad53e0b540a31dfc82b 100644 (file)
@@ -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,
 };