]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: use SECTOR_SIZE defines in btrfs_issue_discard()
authorDavid Sterba <dsterba@suse.com>
Thu, 9 Jan 2025 10:24:07 +0000 (11:24 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Jan 2025 13:53:22 +0000 (14:53 +0100)
Use the existing define for single sector size.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index 1cb1bd45f7ec9c79b3e9b61064792f8cea3f1883..3014a1a23efdbfbe3107a447cb4ef2238c67da95 100644 (file)
@@ -1256,12 +1256,12 @@ 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 << SECTOR_SHIFT);
+       u64 aligned_start = ALIGN(start, SECTOR_SIZE);
 
        /* Adjust the range to be aligned to 512B sectors if necessary. */
        if (start != aligned_start) {
                len -= aligned_start - start;
-               len = round_down(len, 1 << SECTOR_SHIFT);
+               len = round_down(len, SECTOR_SIZE);
                start = aligned_start;
        }