]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: move btrfs_csum_ptr to inode.c
authorJosef Bacik <josef@toxicpanda.com>
Wed, 14 Sep 2022 23:04:45 +0000 (19:04 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2022 10:28:06 +0000 (12:28 +0200)
This helper is only used in inode.c, move it locally to that file
instead of defining it in ctree.h.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/inode.c

index 0196be9b9303fe1b978aca117acc09d58e270598..5ac69fcbdcbe85d244c2649d55abd3faad06ec1a 100644 (file)
@@ -2797,14 +2797,6 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb,
                                     enum btrfs_inline_ref_type is_data);
 u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset);
 
-static inline u8 *btrfs_csum_ptr(const struct btrfs_fs_info *fs_info, u8 *csums,
-                                u64 offset)
-{
-       u64 offset_in_sectors = offset >> fs_info->sectorsize_bits;
-
-       return csums + offset_in_sectors * fs_info->csum_size;
-}
-
 /*
  * Take the number of bytes to be checksummed and figure out how many leaves
  * it would require to store the csums for that many bytes.
index 6fde13f62c1d833a19b7db4afed0065801ee98a5..feccb36eb919f71d249e88545676b44bd9c66130 100644 (file)
@@ -3436,6 +3436,13 @@ int btrfs_check_sector_csum(struct btrfs_fs_info *fs_info, struct page *page,
        return 0;
 }
 
+static u8 *btrfs_csum_ptr(const struct btrfs_fs_info *fs_info, u8 *csums, u64 offset)
+{
+       u64 offset_in_sectors = offset >> fs_info->sectorsize_bits;
+
+       return csums + offset_in_sectors * fs_info->csum_size;
+}
+
 /*
  * check_data_csum - verify checksum of one sector of uncompressed data
  * @inode:     inode