Rename 'free' and also 'used' for consistency.
Signed-off-by: David Sterba <dsterba@suse.com>
int make_convert_btrfs(int fd, struct btrfs_mkfs_config *cfg,
struct btrfs_convert_context *cctx)
{
- struct cache_tree *free = &cctx->free;
- struct cache_tree *used = &cctx->used;
+ struct cache_tree *free_space = &cctx->free_space;
+ struct cache_tree *used_space = &cctx->used_space;
u64 sys_chunk_start;
u64 meta_chunk_start;
/* chunk tree bytenr, in system chunk */
int ret;
/* Shouldn't happen */
- BUG_ON(cache_tree_empty(used));
+ BUG_ON(cache_tree_empty(used_space));
/*
* reserve space for temporary superblock first
* Here we allocate a little larger space, to keep later
* free space will be STRIPE_LEN aligned
*/
- ret = reserve_free_space(free, BTRFS_STRIPE_LEN,
+ ret = reserve_free_space(free_space, BTRFS_STRIPE_LEN,
&cfg->super_bytenr);
if (ret < 0)
goto out;
* If using current 4M, it can only handle less than one TB for
* worst case and then run out of sys space.
*/
- ret = reserve_free_space(free, BTRFS_MKFS_SYSTEM_GROUP_SIZE,
+ ret = reserve_free_space(free_space, BTRFS_MKFS_SYSTEM_GROUP_SIZE,
&sys_chunk_start);
if (ret < 0)
goto out;
- ret = reserve_free_space(free, BTRFS_CONVERT_META_GROUP_SIZE,
+ ret = reserve_free_space(free_space, BTRFS_CONVERT_META_GROUP_SIZE,
&meta_chunk_start);
if (ret < 0)
goto out;
const struct btrfs_convert_operations *convert_ops;
/* The accurate used space of old filesystem */
- struct cache_tree used;
+ struct cache_tree used_space;
/* Batched ranges which must be covered by data chunks */
struct cache_tree data_chunks;
/* Free space which is not covered by data_chunks */
- struct cache_tree free;
+ struct cache_tree free_space;
void *fs_data;
};
static int calculate_available_space(struct btrfs_convert_context *cctx)
{
- struct cache_tree *used = &cctx->used;
+ struct cache_tree *used = &cctx->used_space;
struct cache_tree *data_chunks = &cctx->data_chunks;
- struct cache_tree *free = &cctx->free;
+ struct cache_tree *free = &cctx->free_space;
struct cache_extent *cache;
u64 cur_off = 0;
/*
* Create a new used space cache, which doesn't contain the reserved
* range
*/
- for (cache = first_cache_extent(&cctx->used); cache;
+ for (cache = first_cache_extent(&cctx->used_space); cache;
cache = next_cache_extent(cache)) {
ret = add_cache_extent(&used_tmp, cache->start, cache->size);
if (ret < 0)
cur += len;
}
/* Handle the reserved ranges */
- ret = migrate_reserved_ranges(trans, root, &cctx->used, &buf, fd, ino,
- cfg->num_bytes, convert_flags);
+ ret = migrate_reserved_ranges(trans, root, &cctx->used_space, &buf, fd,
+ ino, cfg->num_bytes, convert_flags);
key.objectid = ino;
key.type = BTRFS_INODE_ITEM_KEY;
{
ext2_filsys fs = (ext2_filsys)cctx->fs_data;
blk64_t blk_itr = EXT2FS_B2C(fs, fs->super->s_first_data_block);
- struct cache_tree *used_tree = &cctx->used;
+ struct cache_tree *used_tree = &cctx->used_space;
char *block_bitmap = NULL;
unsigned long i;
int block_nbytes;
{
memset(cctx, 0, sizeof(*cctx));
- cache_tree_init(&cctx->used);
+ cache_tree_init(&cctx->used_space);
cache_tree_init(&cctx->data_chunks);
- cache_tree_init(&cctx->free);
+ cache_tree_init(&cctx->free_space);
}
void clean_convert_context(struct btrfs_convert_context *cctx)
{
- free_extent_cache_tree(&cctx->used);
+ free_extent_cache_tree(&cctx->used_space);
free_extent_cache_tree(&cctx->data_chunks);
- free_extent_cache_tree(&cctx->free);
+ free_extent_cache_tree(&cctx->free_space);
}
int block_iterate_proc(u64 disk_block, u64 file_block,