summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-09-27 14:09:25 +0300
committerDavid Sterba <dsterba@suse.com>2023-10-12 17:44:14 +0300
commitb8bf4e4d6ae9bbd485321e81b76cfaf07bf5bedd (patch)
tree29c51fe2a7a3b422bba55683b034a853b9bb8f6f /fs/btrfs
parent7bff16e3ffd92ff9021938c5d0b2e9faf1c0e7e2 (diff)
downloadlinux-b8bf4e4d6ae9bbd485321e81b76cfaf07bf5bedd.tar.xz
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ctree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 49232b526390..e1af5cc698f9 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -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