Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1170862d authored by Timofey Titovets's avatar Timofey Titovets Committed by David Sterba
Browse files

Btrfs: compress_file_range remove dead variable num_bytes



Remove dead assigment of num_bytes.

Also as num_bytes only used in the will_compress block as copy of
total_in just replace that with total_in and drop num_bytes entirely.

Signed-off-by: default avatarTimofey Titovets <nefelim4ag@gmail.com>
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent a7e3c5f2
Loading
Loading
Loading
Loading
+3 −7
Original line number Original line Diff line number Diff line
@@ -458,7 +458,6 @@ static noinline void compress_file_range(struct inode *inode,
{
{
	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
	struct btrfs_root *root = BTRFS_I(inode)->root;
	struct btrfs_root *root = BTRFS_I(inode)->root;
	u64 num_bytes;
	u64 blocksize = fs_info->sectorsize;
	u64 blocksize = fs_info->sectorsize;
	u64 actual_end;
	u64 actual_end;
	u64 isize = i_size_read(inode);
	u64 isize = i_size_read(inode);
@@ -508,8 +507,6 @@ static noinline void compress_file_range(struct inode *inode,


	total_compressed = min_t(unsigned long, total_compressed,
	total_compressed = min_t(unsigned long, total_compressed,
			BTRFS_MAX_UNCOMPRESSED);
			BTRFS_MAX_UNCOMPRESSED);
	num_bytes = ALIGN(end - start + 1, blocksize);
	num_bytes = max(blocksize,  num_bytes);
	total_in = 0;
	total_in = 0;
	ret = 0;
	ret = 0;


@@ -625,7 +622,6 @@ static noinline void compress_file_range(struct inode *inode,
		 */
		 */
		total_in = ALIGN(total_in, PAGE_SIZE);
		total_in = ALIGN(total_in, PAGE_SIZE);
		if (total_compressed + blocksize <= total_in) {
		if (total_compressed + blocksize <= total_in) {
			num_bytes = total_in;
			*num_added += 1;
			*num_added += 1;


			/*
			/*
@@ -633,12 +629,12 @@ static noinline void compress_file_range(struct inode *inode,
			 * allocation on disk for these compressed pages, and
			 * allocation on disk for these compressed pages, and
			 * will submit them to the elevator.
			 * will submit them to the elevator.
			 */
			 */
			add_async_extent(async_cow, start, num_bytes,
			add_async_extent(async_cow, start, total_in,
					total_compressed, pages, nr_pages,
					total_compressed, pages, nr_pages,
					compress_type);
					compress_type);


			if (start + num_bytes < end) {
			if (start + total_in < end) {
				start += num_bytes;
				start += total_in;
				pages = NULL;
				pages = NULL;
				cond_resched();
				cond_resched();
				goto again;
				goto again;