Loading fs/btrfs/file.c +7 −8 Original line number Diff line number Diff line Loading @@ -3495,13 +3495,13 @@ static long btrfs_fallocate(struct file *file, int mode, return ret; } static loff_t find_desired_extent(struct inode *inode, loff_t offset, static loff_t find_desired_extent(struct btrfs_inode *inode, loff_t offset, int whence) { struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); struct btrfs_fs_info *fs_info = inode->root->fs_info; struct extent_map *em = NULL; struct extent_state *cached_state = NULL; loff_t i_size = inode->i_size; loff_t i_size = inode->vfs_inode.i_size; u64 lockstart; u64 lockend; u64 start; Loading @@ -3524,11 +3524,10 @@ static loff_t find_desired_extent(struct inode *inode, loff_t offset, lockend--; len = lockend - lockstart + 1; lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, &cached_state); lock_extent_bits(&inode->io_tree, lockstart, lockend, &cached_state); while (start < i_size) { em = btrfs_get_extent_fiemap(BTRFS_I(inode), start, len); em = btrfs_get_extent_fiemap(inode, start, len); if (IS_ERR(em)) { ret = PTR_ERR(em); em = NULL; Loading @@ -3550,7 +3549,7 @@ static loff_t find_desired_extent(struct inode *inode, loff_t offset, cond_resched(); } free_extent_map(em); unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, unlock_extent_cached(&inode->io_tree, lockstart, lockend, &cached_state); if (ret) { offset = ret; Loading @@ -3574,7 +3573,7 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence) case SEEK_DATA: case SEEK_HOLE: btrfs_inode_lock(inode, BTRFS_ILOCK_SHARED); offset = find_desired_extent(inode, offset, whence); offset = find_desired_extent(BTRFS_I(inode), offset, whence); btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED); break; } Loading Loading
fs/btrfs/file.c +7 −8 Original line number Diff line number Diff line Loading @@ -3495,13 +3495,13 @@ static long btrfs_fallocate(struct file *file, int mode, return ret; } static loff_t find_desired_extent(struct inode *inode, loff_t offset, static loff_t find_desired_extent(struct btrfs_inode *inode, loff_t offset, int whence) { struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); struct btrfs_fs_info *fs_info = inode->root->fs_info; struct extent_map *em = NULL; struct extent_state *cached_state = NULL; loff_t i_size = inode->i_size; loff_t i_size = inode->vfs_inode.i_size; u64 lockstart; u64 lockend; u64 start; Loading @@ -3524,11 +3524,10 @@ static loff_t find_desired_extent(struct inode *inode, loff_t offset, lockend--; len = lockend - lockstart + 1; lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, &cached_state); lock_extent_bits(&inode->io_tree, lockstart, lockend, &cached_state); while (start < i_size) { em = btrfs_get_extent_fiemap(BTRFS_I(inode), start, len); em = btrfs_get_extent_fiemap(inode, start, len); if (IS_ERR(em)) { ret = PTR_ERR(em); em = NULL; Loading @@ -3550,7 +3549,7 @@ static loff_t find_desired_extent(struct inode *inode, loff_t offset, cond_resched(); } free_extent_map(em); unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, unlock_extent_cached(&inode->io_tree, lockstart, lockend, &cached_state); if (ret) { offset = ret; Loading @@ -3574,7 +3573,7 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence) case SEEK_DATA: case SEEK_HOLE: btrfs_inode_lock(inode, BTRFS_ILOCK_SHARED); offset = find_desired_extent(inode, offset, whence); offset = find_desired_extent(BTRFS_I(inode), offset, whence); btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED); break; } Loading