diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-08-31 14:42:39 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-10-07 12:12:17 +0200 |
commit | 6d072c8e291f4127a7a40addb7ef553f9490a600 (patch) | |
tree | f87fd624bfb356664bda1683bc35be2cc91257d3 | |
parent | b79b724969ad5e5a01548c75f30fc14c893e825b (diff) | |
download | lwn-6d072c8e291f4127a7a40addb7ef553f9490a600.tar.gz lwn-6d072c8e291f4127a7a40addb7ef553f9490a600.zip |
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>
-rw-r--r-- | fs/btrfs/file.c | 6 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 3 | ||||
-rw-r--r-- | fs/btrfs/ordered-data.c | 6 | ||||
-rw-r--r-- | fs/btrfs/ordered-data.h | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 4bf15846efdc..7c37a43cc2e3 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -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 && diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2306fbaafb28..93063edc2d7b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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 { diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 4732c5b89460..5a7e9c5872d3 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -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) diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h index 644258a7dfb1..b287a2a403e6 100644 --- a/fs/btrfs/ordered-data.h +++ b/fs/btrfs/ordered-data.h @@ -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, |