diff options
author | Anand Jain <anand.jain@oracle.com> | 2023-04-15 19:32:38 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-06-19 13:59:23 +0200 |
commit | adbe7e388e4239d9c1754d475aea791136927137 (patch) | |
tree | 5982561946cd7bb905be3b1fcc156455f330a917 /fs/btrfs/extent-tree.c | |
parent | 29e70be261d92829af26fda16769784710f45503 (diff) |
btrfs: use SECTOR_SHIFT to convert LBA to physical offset
Using SECTOR_SHIFT to convert LBA to physical address makes it more
readable.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3a4c6ab80403..581ddb24e113 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -1203,11 +1203,11 @@ static int btrfs_issue_discard(struct block_device *bdev, u64 start, u64 len, { int j, ret = 0; u64 bytes_left, end; - u64 aligned_start = ALIGN(start, 1 << 9); + u64 aligned_start = ALIGN(start, 1 << SECTOR_SHIFT); if (WARN_ON(start != aligned_start)) { len -= aligned_start - start; - len = round_down(len, 1 << 9); + len = round_down(len, 1 << SECTOR_SHIFT); start = aligned_start; } |