mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
btrfs: rename set_extent_bit() to include a btrfs prefix
This is an exported function so it should have a 'btrfs_' prefix by convention, to make it clear it's btrfs specific and to avoid collisions with functions from elsewhere in the kernel. So rename it to btrfs_set_extent_bit(). Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
9d222562b4
commit
791b3455ac
|
|
@ -2216,9 +2216,9 @@ static int exclude_super_stripes(struct btrfs_block_group *cache)
|
|||
if (cache->start < BTRFS_SUPER_INFO_OFFSET) {
|
||||
stripe_len = BTRFS_SUPER_INFO_OFFSET - cache->start;
|
||||
cache->bytes_super += stripe_len;
|
||||
ret = set_extent_bit(&fs_info->excluded_extents, cache->start,
|
||||
cache->start + stripe_len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
ret = btrfs_set_extent_bit(&fs_info->excluded_extents, cache->start,
|
||||
cache->start + stripe_len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2244,9 +2244,9 @@ static int exclude_super_stripes(struct btrfs_block_group *cache)
|
|||
cache->start + cache->length - logical[nr]);
|
||||
|
||||
cache->bytes_super += len;
|
||||
ret = set_extent_bit(&fs_info->excluded_extents, logical[nr],
|
||||
logical[nr] + len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
ret = btrfs_set_extent_bit(&fs_info->excluded_extents,
|
||||
logical[nr], logical[nr] + len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
if (ret) {
|
||||
kfree(logical);
|
||||
return ret;
|
||||
|
|
@ -3736,8 +3736,8 @@ int btrfs_update_block_group(struct btrfs_trans_handle *trans,
|
|||
spin_unlock(&cache->lock);
|
||||
spin_unlock(&space_info->lock);
|
||||
|
||||
set_extent_bit(&trans->transaction->pinned_extents, bytenr,
|
||||
bytenr + num_bytes - 1, EXTENT_DIRTY, NULL);
|
||||
btrfs_set_extent_bit(&trans->transaction->pinned_extents, bytenr,
|
||||
bytenr + num_bytes - 1, EXTENT_DIRTY, NULL);
|
||||
}
|
||||
|
||||
spin_lock(&trans->transaction->dirty_bgs_lock);
|
||||
|
|
|
|||
|
|
@ -1173,8 +1173,8 @@ static int defrag_one_locked_target(struct btrfs_inode *inode,
|
|||
btrfs_clear_extent_bit(&inode->io_tree, start, start + len - 1,
|
||||
EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING |
|
||||
EXTENT_DEFRAG, cached_state);
|
||||
set_extent_bit(&inode->io_tree, start, start + len - 1,
|
||||
EXTENT_DELALLOC | EXTENT_DEFRAG, cached_state);
|
||||
btrfs_set_extent_bit(&inode->io_tree, start, start + len - 1,
|
||||
EXTENT_DELALLOC | EXTENT_DEFRAG, cached_state);
|
||||
|
||||
/* Update the page status */
|
||||
for (i = start_index - first_index; i <= last_index - first_index; i++) {
|
||||
|
|
|
|||
|
|
@ -797,8 +797,8 @@ static int btrfs_set_target_alloc_state(struct btrfs_device *srcdev,
|
|||
while (find_first_extent_bit(&srcdev->alloc_state, start,
|
||||
&found_start, &found_end,
|
||||
CHUNK_ALLOCATED, &cached_state)) {
|
||||
ret = set_extent_bit(&tgtdev->alloc_state, found_start,
|
||||
found_end, CHUNK_ALLOCATED, NULL);
|
||||
ret = btrfs_set_extent_bit(&tgtdev->alloc_state, found_start,
|
||||
found_end, CHUNK_ALLOCATED, NULL);
|
||||
if (ret)
|
||||
break;
|
||||
start = found_end + 1;
|
||||
|
|
|
|||
|
|
@ -1256,8 +1256,8 @@ static int __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
|
|||
|
||||
}
|
||||
|
||||
int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
|
||||
u32 bits, struct extent_state **cached_state)
|
||||
int btrfs_set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
|
||||
u32 bits, struct extent_state **cached_state)
|
||||
{
|
||||
return __set_extent_bit(tree, start, end, bits, NULL, NULL,
|
||||
cached_state, NULL);
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ static inline int btrfs_clear_extent_bits(struct extent_io_tree *tree, u64 start
|
|||
|
||||
int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
|
||||
u32 bits, struct extent_changeset *changeset);
|
||||
int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
|
||||
u32 bits, struct extent_state **cached_state);
|
||||
int btrfs_set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
|
||||
u32 bits, struct extent_state **cached_state);
|
||||
|
||||
static inline int btrfs_clear_extent_dirty(struct extent_io_tree *tree, u64 start,
|
||||
u64 end, struct extent_state **cached)
|
||||
|
|
|
|||
|
|
@ -2598,8 +2598,8 @@ static int pin_down_extent(struct btrfs_trans_handle *trans,
|
|||
spin_unlock(&cache->lock);
|
||||
spin_unlock(&cache->space_info->lock);
|
||||
|
||||
set_extent_bit(&trans->transaction->pinned_extents, bytenr,
|
||||
bytenr + num_bytes - 1, EXTENT_DIRTY, NULL);
|
||||
btrfs_set_extent_bit(&trans->transaction->pinned_extents, bytenr,
|
||||
bytenr + num_bytes - 1, EXTENT_DIRTY, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -5065,17 +5065,17 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
|||
* EXTENT bit to differentiate dirty pages.
|
||||
*/
|
||||
if (buf->log_index == 0)
|
||||
set_extent_bit(&root->dirty_log_pages, buf->start,
|
||||
buf->start + buf->len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
btrfs_set_extent_bit(&root->dirty_log_pages, buf->start,
|
||||
buf->start + buf->len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
else
|
||||
set_extent_bit(&root->dirty_log_pages, buf->start,
|
||||
buf->start + buf->len - 1,
|
||||
EXTENT_NEW, NULL);
|
||||
btrfs_set_extent_bit(&root->dirty_log_pages, buf->start,
|
||||
buf->start + buf->len - 1,
|
||||
EXTENT_NEW, NULL);
|
||||
} else {
|
||||
buf->log_index = -1;
|
||||
set_extent_bit(&trans->transaction->dirty_pages, buf->start,
|
||||
buf->start + buf->len - 1, EXTENT_DIRTY, NULL);
|
||||
btrfs_set_extent_bit(&trans->transaction->dirty_pages, buf->start,
|
||||
buf->start + buf->len - 1, EXTENT_DIRTY, NULL);
|
||||
}
|
||||
/* this returns a buffer locked for blocking */
|
||||
return buf;
|
||||
|
|
@ -6430,8 +6430,8 @@ static int btrfs_trim_free_extents(struct btrfs_device *device, u64 *trimmed)
|
|||
ret = btrfs_issue_discard(device->bdev, start, len,
|
||||
&bytes);
|
||||
if (!ret)
|
||||
set_extent_bit(&device->alloc_state, start,
|
||||
start + bytes - 1, CHUNK_TRIMMED, NULL);
|
||||
btrfs_set_extent_bit(&device->alloc_state, start,
|
||||
start + bytes - 1, CHUNK_TRIMMED, NULL);
|
||||
mutex_unlock(&fs_info->chunk_mutex);
|
||||
|
||||
if (ret)
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ int btrfs_inode_set_file_extent_range(struct btrfs_inode *inode, u64 start,
|
|||
|
||||
ASSERT(IS_ALIGNED(start + len, inode->root->fs_info->sectorsize));
|
||||
|
||||
return set_extent_bit(inode->file_extent_tree, start, start + len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
return btrfs_set_extent_bit(inode->file_extent_tree, start, start + len - 1,
|
||||
EXTENT_DIRTY, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -430,9 +430,9 @@ blk_status_t btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
|
|||
if (btrfs_root_id(inode->root) == BTRFS_DATA_RELOC_TREE_OBJECTID) {
|
||||
u64 file_offset = bbio->file_offset + bio_offset;
|
||||
|
||||
set_extent_bit(&inode->io_tree, file_offset,
|
||||
file_offset + sectorsize - 1,
|
||||
EXTENT_NODATASUM, NULL);
|
||||
btrfs_set_extent_bit(&inode->io_tree, file_offset,
|
||||
file_offset + sectorsize - 1,
|
||||
EXTENT_NODATASUM, NULL);
|
||||
} else {
|
||||
btrfs_warn_rl(fs_info,
|
||||
"csum hole found for disk bytenr range [%llu, %llu)",
|
||||
|
|
|
|||
|
|
@ -2682,9 +2682,9 @@ static int btrfs_find_new_delalloc_bytes(struct btrfs_inode *inode,
|
|||
if (em_len > search_len)
|
||||
em_len = search_len;
|
||||
|
||||
ret = set_extent_bit(&inode->io_tree, search_start,
|
||||
search_start + em_len - 1,
|
||||
EXTENT_DELALLOC_NEW, cached_state);
|
||||
ret = btrfs_set_extent_bit(&inode->io_tree, search_start,
|
||||
search_start + em_len - 1,
|
||||
EXTENT_DELALLOC_NEW, cached_state);
|
||||
next:
|
||||
search_start = extent_map_end(em);
|
||||
free_extent_map(em);
|
||||
|
|
@ -2717,8 +2717,8 @@ int btrfs_set_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
|
|||
return ret;
|
||||
}
|
||||
|
||||
return set_extent_bit(&inode->io_tree, start, end,
|
||||
EXTENT_DELALLOC | extra_bits, cached_state);
|
||||
return btrfs_set_extent_bit(&inode->io_tree, start, end,
|
||||
EXTENT_DELALLOC | extra_bits, cached_state);
|
||||
}
|
||||
|
||||
/* see btrfs_writepage_start_hook for details on why this is required */
|
||||
|
|
@ -4901,8 +4901,8 @@ int btrfs_truncate_block(struct btrfs_inode *inode, loff_t from, loff_t len,
|
|||
btrfs_unlock_extent(io_tree, block_start, block_end, &cached_state);
|
||||
|
||||
if (only_release_metadata)
|
||||
set_extent_bit(&inode->io_tree, block_start, block_end,
|
||||
EXTENT_NORESERVE, NULL);
|
||||
btrfs_set_extent_bit(&inode->io_tree, block_start, block_end,
|
||||
EXTENT_NORESERVE, NULL);
|
||||
|
||||
out_unlock:
|
||||
if (ret) {
|
||||
|
|
|
|||
|
|
@ -178,8 +178,9 @@ static void mark_block_processed(struct reloc_control *rc,
|
|||
in_range(node->bytenr, rc->block_group->start,
|
||||
rc->block_group->length)) {
|
||||
blocksize = rc->extent_root->fs_info->nodesize;
|
||||
set_extent_bit(&rc->processed_blocks, node->bytenr,
|
||||
node->bytenr + blocksize - 1, EXTENT_DIRTY, NULL);
|
||||
btrfs_set_extent_bit(&rc->processed_blocks, node->bytenr,
|
||||
node->bytenr + blocksize - 1, EXTENT_DIRTY,
|
||||
NULL);
|
||||
}
|
||||
node->processed = 1;
|
||||
}
|
||||
|
|
@ -2929,9 +2930,9 @@ static int relocate_one_folio(struct reloc_control *rc,
|
|||
u64 boundary_end = boundary_start +
|
||||
fs_info->sectorsize - 1;
|
||||
|
||||
set_extent_bit(&BTRFS_I(inode)->io_tree,
|
||||
boundary_start, boundary_end,
|
||||
EXTENT_BOUNDARY, NULL);
|
||||
btrfs_set_extent_bit(&BTRFS_I(inode)->io_tree,
|
||||
boundary_start, boundary_end,
|
||||
EXTENT_BOUNDARY, NULL);
|
||||
}
|
||||
btrfs_unlock_extent(&BTRFS_I(inode)->io_tree, clamped_start, clamped_end,
|
||||
&cached_state);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ static int test_find_delalloc(u32 sectorsize, u32 nodesize)
|
|||
* |--- delalloc ---|
|
||||
* |--- search ---|
|
||||
*/
|
||||
set_extent_bit(tmp, 0, sectorsize - 1, EXTENT_DELALLOC, NULL);
|
||||
btrfs_set_extent_bit(tmp, 0, sectorsize - 1, EXTENT_DELALLOC, NULL);
|
||||
start = 0;
|
||||
end = start + PAGE_SIZE - 1;
|
||||
found = find_lock_delalloc_range(inode, page_folio(locked_page), &start,
|
||||
|
|
@ -207,7 +207,7 @@ static int test_find_delalloc(u32 sectorsize, u32 nodesize)
|
|||
test_err("couldn't find the locked page");
|
||||
goto out_bits;
|
||||
}
|
||||
set_extent_bit(tmp, sectorsize, max_bytes - 1, EXTENT_DELALLOC, NULL);
|
||||
btrfs_set_extent_bit(tmp, sectorsize, max_bytes - 1, EXTENT_DELALLOC, NULL);
|
||||
start = test_start;
|
||||
end = start + PAGE_SIZE - 1;
|
||||
found = find_lock_delalloc_range(inode, page_folio(locked_page), &start,
|
||||
|
|
@ -262,7 +262,7 @@ static int test_find_delalloc(u32 sectorsize, u32 nodesize)
|
|||
*
|
||||
* We are re-using our test_start from above since it works out well.
|
||||
*/
|
||||
set_extent_bit(tmp, max_bytes, total_dirty - 1, EXTENT_DELALLOC, NULL);
|
||||
btrfs_set_extent_bit(tmp, max_bytes, total_dirty - 1, EXTENT_DELALLOC, NULL);
|
||||
start = test_start;
|
||||
end = start + PAGE_SIZE - 1;
|
||||
found = find_lock_delalloc_range(inode, page_folio(locked_page), &start,
|
||||
|
|
@ -578,8 +578,8 @@ static int test_find_first_clear_extent_bit(void)
|
|||
* Set 1M-4M alloc/discard and 32M-64M thus leaving a hole between
|
||||
* 4M-32M
|
||||
*/
|
||||
set_extent_bit(&tree, SZ_1M, SZ_4M - 1,
|
||||
CHUNK_TRIMMED | CHUNK_ALLOCATED, NULL);
|
||||
btrfs_set_extent_bit(&tree, SZ_1M, SZ_4M - 1,
|
||||
CHUNK_TRIMMED | CHUNK_ALLOCATED, NULL);
|
||||
|
||||
find_first_clear_extent_bit(&tree, SZ_512K, &start, &end,
|
||||
CHUNK_TRIMMED | CHUNK_ALLOCATED);
|
||||
|
|
@ -591,8 +591,8 @@ static int test_find_first_clear_extent_bit(void)
|
|||
}
|
||||
|
||||
/* Now add 32M-64M so that we have a hole between 4M-32M */
|
||||
set_extent_bit(&tree, SZ_32M, SZ_64M - 1,
|
||||
CHUNK_TRIMMED | CHUNK_ALLOCATED, NULL);
|
||||
btrfs_set_extent_bit(&tree, SZ_32M, SZ_64M - 1,
|
||||
CHUNK_TRIMMED | CHUNK_ALLOCATED, NULL);
|
||||
|
||||
/*
|
||||
* Request first hole starting at 12M, we should get 4M-32M
|
||||
|
|
@ -623,7 +623,7 @@ static int test_find_first_clear_extent_bit(void)
|
|||
* Set 64M-72M with CHUNK_ALLOC flag, then search for CHUNK_TRIMMED flag
|
||||
* being unset in this range, we should get the entry in range 64M-72M
|
||||
*/
|
||||
set_extent_bit(&tree, SZ_64M, SZ_64M + SZ_8M - 1, CHUNK_ALLOCATED, NULL);
|
||||
btrfs_set_extent_bit(&tree, SZ_64M, SZ_64M + SZ_8M - 1, CHUNK_ALLOCATED, NULL);
|
||||
find_first_clear_extent_bit(&tree, SZ_64M + SZ_1M, &start, &end,
|
||||
CHUNK_TRIMMED);
|
||||
|
||||
|
|
|
|||
|
|
@ -5407,9 +5407,9 @@ static void chunk_map_device_set_bits(struct btrfs_chunk_map *map, unsigned int
|
|||
struct btrfs_io_stripe *stripe = &map->stripes[i];
|
||||
struct btrfs_device *device = stripe->dev;
|
||||
|
||||
set_extent_bit(&device->alloc_state, stripe->physical,
|
||||
stripe->physical + map->stripe_size - 1,
|
||||
bits | EXTENT_NOWAIT, NULL);
|
||||
btrfs_set_extent_bit(&device->alloc_state, stripe->physical,
|
||||
stripe->physical + map->stripe_size - 1,
|
||||
bits | EXTENT_NOWAIT, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user