|
@@ -324,6 +324,24 @@ static inline void btrfs_inode_resume_unlocked_dio(struct inode *inode)
|
|
|
&BTRFS_I(inode)->runtime_flags);
|
|
|
}
|
|
|
|
|
|
+static inline void btrfs_print_data_csum_error(struct inode *inode,
|
|
|
+ u64 logical_start, u32 csum, u32 csum_expected, int mirror_num)
|
|
|
+{
|
|
|
+ struct btrfs_root *root = BTRFS_I(inode)->root;
|
|
|
+
|
|
|
+ /* Output minus objectid, which is more meaningful */
|
|
|
+ if (root->objectid >= BTRFS_LAST_FREE_OBJECTID)
|
|
|
+ btrfs_warn_rl(root->fs_info,
|
|
|
+ "csum failed root %lld ino %lld off %llu csum 0x%08x expected csum 0x%08x mirror %d",
|
|
|
+ root->objectid, btrfs_ino(BTRFS_I(inode)),
|
|
|
+ logical_start, csum, csum_expected, mirror_num);
|
|
|
+ else
|
|
|
+ btrfs_warn_rl(root->fs_info,
|
|
|
+ "csum failed root %llu ino %llu off %llu csum 0x%08x expected csum 0x%08x mirror %d",
|
|
|
+ root->objectid, btrfs_ino(BTRFS_I(inode)),
|
|
|
+ logical_start, csum, csum_expected, mirror_num);
|
|
|
+}
|
|
|
+
|
|
|
bool btrfs_page_exists_in_range(struct inode *inode, loff_t start, loff_t end);
|
|
|
|
|
|
#endif
|