diff mbox series

[09/15] btrfs: move btrfs_csum_ptr to inode.c

Message ID c3cc874650f6266c390ff3d3631b7220001e21ae.1663196541.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs: strip out btrfs_fs_info dependencies | expand

Commit Message

Josef Bacik Sept. 14, 2022, 11:04 p.m. UTC
This helper is only used in inode.c, move it locally to that file
instead of defining it in ctree.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 8 --------
 fs/btrfs/inode.c | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

Anand Jain Sept. 15, 2022, 10:47 a.m. UTC | #1
On 15/09/2022 07:04, Josef Bacik wrote:
> This helper is only used in inode.c, move it locally to that file
> instead of defining it in ctree.h.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Johannes Thumshirn Sept. 15, 2022, 2:47 p.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 05eb0e994e68..0da52e8b78e9 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1173,14 +1173,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.
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ca6fa9b01785..62dc3dcf835b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3459,6 +3459,14 @@  int btrfs_check_sector_csum(struct btrfs_fs_info *fs_info, struct page *page,
 	return 0;
 }
 
+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;
+}
+
 /*
  * check_data_csum - verify checksum of one sector of uncompressed data
  * @inode:	inode