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