1
2
3
4
5
6
7
8
9
10#ifndef OCFS2_BLOCKCHECK_H
11#define OCFS2_BLOCKCHECK_H
12
13
14
15struct ocfs2_blockcheck_stats {
16 spinlock_t b_lock;
17 u64 b_check_count;
18 u64 b_failure_count;
19 u64 b_recover_count;
20
21
22
23
24
25 struct dentry *b_debug_dir;
26};
27
28
29
30void ocfs2_compute_meta_ecc(struct super_block *sb, void *data,
31 struct ocfs2_block_check *bc);
32int ocfs2_validate_meta_ecc(struct super_block *sb, void *data,
33 struct ocfs2_block_check *bc);
34void ocfs2_compute_meta_ecc_bhs(struct super_block *sb,
35 struct buffer_head **bhs, int nr,
36 struct ocfs2_block_check *bc);
37int ocfs2_validate_meta_ecc_bhs(struct super_block *sb,
38 struct buffer_head **bhs, int nr,
39 struct ocfs2_block_check *bc);
40
41
42void ocfs2_block_check_compute(void *data, size_t blocksize,
43 struct ocfs2_block_check *bc);
44int ocfs2_block_check_validate(void *data, size_t blocksize,
45 struct ocfs2_block_check *bc,
46 struct ocfs2_blockcheck_stats *stats);
47void ocfs2_block_check_compute_bhs(struct buffer_head **bhs, int nr,
48 struct ocfs2_block_check *bc);
49int ocfs2_block_check_validate_bhs(struct buffer_head **bhs, int nr,
50 struct ocfs2_block_check *bc,
51 struct ocfs2_blockcheck_stats *stats);
52
53
54void ocfs2_blockcheck_stats_debugfs_install(struct ocfs2_blockcheck_stats *stats,
55 struct dentry *parent);
56void ocfs2_blockcheck_stats_debugfs_remove(struct ocfs2_blockcheck_stats *stats);
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75u32 ocfs2_hamming_encode(u32 parity, void *data, unsigned int d,
76 unsigned int nr);
77
78
79
80
81
82
83
84
85
86
87void ocfs2_hamming_fix(void *data, unsigned int d, unsigned int nr,
88 unsigned int fix);
89
90
91extern u32 ocfs2_hamming_encode_block(void *data, unsigned int blocksize);
92extern void ocfs2_hamming_fix_block(void *data, unsigned int blocksize,
93 unsigned int fix);
94#endif
95