Commit e8fe524d authored by Qu Wenruo's avatar Qu Wenruo Committed by David Sterba
Browse files

btrfs: rename extent_map::orig_block_len to disk_num_bytes



This would make it very obvious that the member just matches
btrfs_file_extent_item::disk_num_bytes.

Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8996f61a
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -785,14 +785,14 @@ void btrfs_drop_extent_map_range(struct btrfs_inode *inode, u64 start, u64 end,
					split->block_len = em->block_len;
				else
					split->block_len = split->len;
				split->orig_block_len = max(split->block_len,
						em->orig_block_len);
				split->disk_num_bytes = max(split->block_len,
							    em->disk_num_bytes);
				split->ram_bytes = em->ram_bytes;
			} else {
				split->orig_start = split->start;
				split->block_len = 0;
				split->block_start = em->block_start;
				split->orig_block_len = 0;
				split->disk_num_bytes = 0;
				split->ram_bytes = split->len;
			}

@@ -817,8 +817,8 @@ void btrfs_drop_extent_map_range(struct btrfs_inode *inode, u64 start, u64 end,
			split->generation = gen;

			if (em->block_start < EXTENT_MAP_LAST_BYTE) {
				split->orig_block_len = max(em->block_len,
						    em->orig_block_len);
				split->disk_num_bytes = max(em->block_len,
							    em->disk_num_bytes);

				split->ram_bytes = em->ram_bytes;
				if (compressed) {
@@ -835,7 +835,7 @@ void btrfs_drop_extent_map_range(struct btrfs_inode *inode, u64 start, u64 end,
				split->ram_bytes = split->len;
				split->orig_start = split->start;
				split->block_len = 0;
				split->orig_block_len = 0;
				split->disk_num_bytes = 0;
			}

			if (extent_map_in_tree(em)) {
@@ -992,7 +992,7 @@ int split_extent_map(struct btrfs_inode *inode, u64 start, u64 len, u64 pre,
	split_pre->orig_start = split_pre->start;
	split_pre->block_start = new_logical;
	split_pre->block_len = split_pre->len;
	split_pre->orig_block_len = split_pre->block_len;
	split_pre->disk_num_bytes = split_pre->block_len;
	split_pre->ram_bytes = split_pre->len;
	split_pre->flags = flags;
	split_pre->generation = em->generation;
@@ -1010,7 +1010,7 @@ int split_extent_map(struct btrfs_inode *inode, u64 start, u64 len, u64 pre,
	split_mid->orig_start = split_mid->start;
	split_mid->block_start = em->block_start + pre;
	split_mid->block_len = split_mid->len;
	split_mid->orig_block_len = split_mid->block_len;
	split_mid->disk_num_bytes = split_mid->block_len;
	split_mid->ram_bytes = split_mid->len;
	split_mid->flags = flags;
	split_mid->generation = em->generation;
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ struct extent_map {
	 * The full on-disk extent length, matching
	 * btrfs_file_extent_item::disk_num_bytes.
	 */
	u64 orig_block_len;
	u64 disk_num_bytes;

	/*
	 * The decompressed size of the whole on-disk extent, matching
+2 −2
Original line number Diff line number Diff line
@@ -1295,7 +1295,7 @@ void btrfs_extent_item_to_extent_map(struct btrfs_inode *inode,
		em->len = btrfs_file_extent_end(path) - extent_start;
		em->orig_start = extent_start -
			btrfs_file_extent_offset(leaf, fi);
		em->orig_block_len = btrfs_file_extent_disk_num_bytes(leaf, fi);
		em->disk_num_bytes = btrfs_file_extent_disk_num_bytes(leaf, fi);
		bytenr = btrfs_file_extent_disk_bytenr(leaf, fi);
		if (bytenr == 0) {
			em->block_start = EXTENT_MAP_HOLE;
@@ -1304,7 +1304,7 @@ void btrfs_extent_item_to_extent_map(struct btrfs_inode *inode,
		if (compress_type != BTRFS_COMPRESS_NONE) {
			extent_map_set_compression(em, compress_type);
			em->block_start = bytenr;
			em->block_len = em->orig_block_len;
			em->block_len = em->disk_num_bytes;
		} else {
			bytenr += btrfs_file_extent_offset(leaf, fi);
			em->block_start = bytenr;
+1 −1
Original line number Diff line number Diff line
@@ -2350,7 +2350,7 @@ static int fill_holes(struct btrfs_trans_handle *trans,

		hole_em->block_start = EXTENT_MAP_HOLE;
		hole_em->block_len = 0;
		hole_em->orig_block_len = 0;
		hole_em->disk_num_bytes = 0;
		hole_em->generation = trans->transid;

		ret = btrfs_replace_extent_map_range(inode, hole_em, true);
+6 −6
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ static noinline int run_delalloc_cow(struct btrfs_inode *inode,
				     bool pages_dirty);
static struct extent_map *create_io_em(struct btrfs_inode *inode, u64 start,
				       u64 len, u64 orig_start, u64 block_start,
				       u64 block_len, u64 orig_block_len,
				       u64 block_len, u64 disk_num_bytes,
				       u64 ram_bytes, int compress_type,
				       int type);

@@ -5002,7 +5002,7 @@ int btrfs_cont_expand(struct btrfs_inode *inode, loff_t oldsize, loff_t size)

			hole_em->block_start = EXTENT_MAP_HOLE;
			hole_em->block_len = 0;
			hole_em->orig_block_len = 0;
			hole_em->disk_num_bytes = 0;
			hole_em->ram_bytes = hole_size;
			hole_em->generation = btrfs_get_fs_generation(fs_info);

@@ -7331,7 +7331,7 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend,
/* The callers of this must take lock_extent() */
static struct extent_map *create_io_em(struct btrfs_inode *inode, u64 start,
				       u64 len, u64 orig_start, u64 block_start,
				       u64 block_len, u64 orig_block_len,
				       u64 block_len, u64 disk_num_bytes,
				       u64 ram_bytes, int compress_type,
				       int type)
{
@@ -7363,7 +7363,7 @@ static struct extent_map *create_io_em(struct btrfs_inode *inode, u64 start,
		ASSERT(block_len == len);

		/* COW results a new extent matching our file extent size. */
		ASSERT(orig_block_len == len);
		ASSERT(disk_num_bytes == len);
		ASSERT(ram_bytes == len);

		/* Since it's a new extent, we should not have any offset. */
@@ -7390,7 +7390,7 @@ static struct extent_map *create_io_em(struct btrfs_inode *inode, u64 start,
	em->len = len;
	em->block_len = block_len;
	em->block_start = block_start;
	em->orig_block_len = orig_block_len;
	em->disk_num_bytes = disk_num_bytes;
	em->ram_bytes = ram_bytes;
	em->generation = -1;
	em->flags |= EXTENT_FLAG_PINNED;
@@ -9567,7 +9567,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
		em->len = ins.offset;
		em->block_start = ins.objectid;
		em->block_len = ins.offset;
		em->orig_block_len = ins.offset;
		em->disk_num_bytes = ins.offset;
		em->ram_bytes = ins.offset;
		em->flags |= EXTENT_FLAG_PREALLOC;
		em->generation = trans->transid;
Loading