btrfs: mark the len field in struct btrfs_ordered_sum as unsigned
authorChristoph Hellwig <hch@lst.de>
Wed, 24 May 2023 15:03:06 +0000 (17:03 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:32 +0000 (13:59 +0200)
len can't ever be negative, so mark it as an u32 instead of int.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c
fs/btrfs/ordered-data.h

index 594b69d..24b974b 100644 (file)
@@ -561,7 +561,7 @@ int btrfs_lookup_csums_list(struct btrfs_root *root, u64 start, u64 end,
                        }
 
                        sums->bytenr = start;
-                       sums->len = (int)size;
+                       sums->len = size;
 
                        offset = bytes_to_csum_size(fs_info, start - key.offset);
 
index f0f1138..2e54820 100644 (file)
@@ -20,7 +20,7 @@ struct btrfs_ordered_sum {
        /*
         * this is the length in bytes covered by the sums array below.
         */
-       int len;
+       u32 len;
        struct list_head list;
        /* last field is a variable length array of csums */
        u8 sums[];