mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
btrfs: make btrfs_lookup_first_ordered_extent take btrfs_inode
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b79b724969
commit
6d072c8e29
@ -2541,7 +2541,8 @@ static int btrfs_punch_hole_lock_range(struct inode *inode,
|
||||
|
||||
lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend,
|
||||
cached_state);
|
||||
ordered = btrfs_lookup_first_ordered_extent(inode, lockend);
|
||||
ordered = btrfs_lookup_first_ordered_extent(BTRFS_I(inode),
|
||||
lockend);
|
||||
|
||||
/*
|
||||
* We need to make sure we have no ordered extents in this range
|
||||
@ -3400,7 +3401,8 @@ static long btrfs_fallocate(struct file *file, int mode,
|
||||
*/
|
||||
lock_extent_bits(&BTRFS_I(inode)->io_tree, alloc_start,
|
||||
locked_end, &cached_state);
|
||||
ordered = btrfs_lookup_first_ordered_extent(inode, locked_end);
|
||||
ordered = btrfs_lookup_first_ordered_extent(BTRFS_I(inode),
|
||||
locked_end);
|
||||
|
||||
if (ordered &&
|
||||
ordered->file_offset + ordered->num_bytes > alloc_start &&
|
||||
|
@ -8672,7 +8672,8 @@ void btrfs_destroy_inode(struct inode *inode)
|
||||
return;
|
||||
|
||||
while (1) {
|
||||
ordered = btrfs_lookup_first_ordered_extent(inode, (u64)-1);
|
||||
ordered = btrfs_lookup_first_ordered_extent(BTRFS_I(inode),
|
||||
(u64)-1);
|
||||
if (!ordered)
|
||||
break;
|
||||
else {
|
||||
|
@ -710,7 +710,7 @@ int btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len)
|
||||
|
||||
end = orig_end;
|
||||
while (1) {
|
||||
ordered = btrfs_lookup_first_ordered_extent(inode, end);
|
||||
ordered = btrfs_lookup_first_ordered_extent(BTRFS_I(inode), end);
|
||||
if (!ordered)
|
||||
break;
|
||||
if (ordered->file_offset > orig_end) {
|
||||
@ -838,13 +838,13 @@ void btrfs_get_ordered_extents_for_logging(struct btrfs_inode *inode,
|
||||
* if none is found
|
||||
*/
|
||||
struct btrfs_ordered_extent *
|
||||
btrfs_lookup_first_ordered_extent(struct inode *inode, u64 file_offset)
|
||||
btrfs_lookup_first_ordered_extent(struct btrfs_inode *inode, u64 file_offset)
|
||||
{
|
||||
struct btrfs_ordered_inode_tree *tree;
|
||||
struct rb_node *node;
|
||||
struct btrfs_ordered_extent *entry = NULL;
|
||||
|
||||
tree = &BTRFS_I(inode)->ordered_tree;
|
||||
tree = &inode->ordered_tree;
|
||||
spin_lock_irq(&tree->lock);
|
||||
node = tree_search(tree, file_offset);
|
||||
if (!node)
|
||||
|
@ -178,7 +178,7 @@ void btrfs_start_ordered_extent(struct inode *inode,
|
||||
struct btrfs_ordered_extent *entry, int wait);
|
||||
int btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len);
|
||||
struct btrfs_ordered_extent *
|
||||
btrfs_lookup_first_ordered_extent(struct inode * inode, u64 file_offset);
|
||||
btrfs_lookup_first_ordered_extent(struct btrfs_inode *inode, u64 file_offset);
|
||||
struct btrfs_ordered_extent *btrfs_lookup_ordered_range(
|
||||
struct btrfs_inode *inode,
|
||||
u64 file_offset,
|
||||
|
Loading…
Reference in New Issue
Block a user