Commit 66240ab1 authored by David Sterba's avatar David Sterba

btrfs: open code set_extent_delalloc

The helper is used once in fs code and a few times in the self test
code.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent dc5646c1
...@@ -193,15 +193,6 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, ...@@ -193,15 +193,6 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
u32 bits, u32 clear_bits, u32 bits, u32 clear_bits,
struct extent_state **cached_state); struct extent_state **cached_state);
static inline int set_extent_delalloc(struct extent_io_tree *tree, u64 start,
u64 end, u32 extra_bits,
struct extent_state **cached_state)
{
return set_extent_bit(tree, start, end,
EXTENT_DELALLOC | extra_bits,
cached_state, GFP_NOFS);
}
static inline int set_extent_new(struct extent_io_tree *tree, u64 start, static inline int set_extent_new(struct extent_io_tree *tree, u64 start,
u64 end) u64 end)
{ {
......
...@@ -2922,8 +2922,8 @@ int btrfs_set_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end, ...@@ -2922,8 +2922,8 @@ int btrfs_set_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
return ret; return ret;
} }
return set_extent_delalloc(&inode->io_tree, start, end, extra_bits, return set_extent_bit(&inode->io_tree, start, end,
cached_state); EXTENT_DELALLOC | extra_bits, cached_state, GFP_NOFS);
} }
/* see btrfs_writepage_start_hook for details on why this is required */ /* see btrfs_writepage_start_hook for details on why this is required */
......
...@@ -159,7 +159,7 @@ static int test_find_delalloc(u32 sectorsize) ...@@ -159,7 +159,7 @@ static int test_find_delalloc(u32 sectorsize)
* |--- delalloc ---| * |--- delalloc ---|
* |--- search ---| * |--- search ---|
*/ */
set_extent_delalloc(tmp, 0, sectorsize - 1, 0, NULL); set_extent_bit(tmp, 0, sectorsize - 1, EXTENT_DELALLOC, NULL, GFP_NOFS);
start = 0; start = 0;
end = start + PAGE_SIZE - 1; end = start + PAGE_SIZE - 1;
found = find_lock_delalloc_range(inode, locked_page, &start, found = find_lock_delalloc_range(inode, locked_page, &start,
...@@ -190,7 +190,7 @@ static int test_find_delalloc(u32 sectorsize) ...@@ -190,7 +190,7 @@ static int test_find_delalloc(u32 sectorsize)
test_err("couldn't find the locked page"); test_err("couldn't find the locked page");
goto out_bits; goto out_bits;
} }
set_extent_delalloc(tmp, sectorsize, max_bytes - 1, 0, NULL); set_extent_bit(tmp, sectorsize, max_bytes - 1, EXTENT_DELALLOC, NULL, GFP_NOFS);
start = test_start; start = test_start;
end = start + PAGE_SIZE - 1; end = start + PAGE_SIZE - 1;
found = find_lock_delalloc_range(inode, locked_page, &start, found = find_lock_delalloc_range(inode, locked_page, &start,
...@@ -245,7 +245,7 @@ static int test_find_delalloc(u32 sectorsize) ...@@ -245,7 +245,7 @@ static int test_find_delalloc(u32 sectorsize)
* *
* We are re-using our test_start from above since it works out well. * We are re-using our test_start from above since it works out well.
*/ */
set_extent_delalloc(tmp, max_bytes, total_dirty - 1, 0, NULL); set_extent_bit(tmp, max_bytes, total_dirty - 1, EXTENT_DELALLOC, NULL, GFP_NOFS);
start = test_start; start = test_start;
end = start + PAGE_SIZE - 1; end = start + PAGE_SIZE - 1;
found = find_lock_delalloc_range(inode, locked_page, &start, found = find_lock_delalloc_range(inode, locked_page, &start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment