Commit b8bf4e4d authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

btrfs: use round_down() to align block offset at btrfs_cow_block()



At btrfs_cow_block() we can use round_down() to align the extent buffer's
logical offset to the start offset of a metadata block group, instead of
the less easy to read set of bitwise operations (two plus one subtraction).
So replace the bitwise operations with a round_down() call.

Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 7bff16e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -718,7 +718,7 @@ int btrfs_cow_block(struct btrfs_trans_handle *trans,
		return 0;
	}

	search_start = buf->start & ~((u64)SZ_1G - 1);
	search_start = round_down(buf->start, SZ_1G);

	/*
	 * Before CoWing this block for later modification, check if it's