0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef OCFS2_BLOCKCHECK_H
0011 #define OCFS2_BLOCKCHECK_H
0012
0013
0014
0015 struct ocfs2_blockcheck_stats {
0016 spinlock_t b_lock;
0017 u64 b_check_count;
0018 u64 b_failure_count;
0019 u64 b_recover_count;
0020
0021
0022
0023
0024
0025 struct dentry *b_debug_dir;
0026 };
0027
0028
0029
0030 void ocfs2_compute_meta_ecc(struct super_block *sb, void *data,
0031 struct ocfs2_block_check *bc);
0032 int ocfs2_validate_meta_ecc(struct super_block *sb, void *data,
0033 struct ocfs2_block_check *bc);
0034 void ocfs2_compute_meta_ecc_bhs(struct super_block *sb,
0035 struct buffer_head **bhs, int nr,
0036 struct ocfs2_block_check *bc);
0037 int ocfs2_validate_meta_ecc_bhs(struct super_block *sb,
0038 struct buffer_head **bhs, int nr,
0039 struct ocfs2_block_check *bc);
0040
0041
0042 void ocfs2_block_check_compute(void *data, size_t blocksize,
0043 struct ocfs2_block_check *bc);
0044 int ocfs2_block_check_validate(void *data, size_t blocksize,
0045 struct ocfs2_block_check *bc,
0046 struct ocfs2_blockcheck_stats *stats);
0047 void ocfs2_block_check_compute_bhs(struct buffer_head **bhs, int nr,
0048 struct ocfs2_block_check *bc);
0049 int ocfs2_block_check_validate_bhs(struct buffer_head **bhs, int nr,
0050 struct ocfs2_block_check *bc,
0051 struct ocfs2_blockcheck_stats *stats);
0052
0053
0054 void ocfs2_blockcheck_stats_debugfs_install(struct ocfs2_blockcheck_stats *stats,
0055 struct dentry *parent);
0056 void ocfs2_blockcheck_stats_debugfs_remove(struct ocfs2_blockcheck_stats *stats);
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 u32 ocfs2_hamming_encode(u32 parity, void *data, unsigned int d,
0076 unsigned int nr);
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 void ocfs2_hamming_fix(void *data, unsigned int d, unsigned int nr,
0088 unsigned int fix);
0089
0090
0091 extern u32 ocfs2_hamming_encode_block(void *data, unsigned int blocksize);
0092 extern void ocfs2_hamming_fix_block(void *data, unsigned int blocksize,
0093 unsigned int fix);
0094 #endif