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: 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:
committed by
David Sterba
parent
7bff16e3ff
commit
b8bf4e4d6a
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user