diff options
Diffstat (limited to 'fs/reiserfs/procfs.c')
-rw-r--r-- | fs/reiserfs/procfs.c | 695 |
1 files changed, 337 insertions, 358 deletions
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index e242ebc7f6f6..fc2f43c75df4 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c | |||
@@ -33,28 +33,27 @@ | |||
33 | static int show_version(struct seq_file *m, struct super_block *sb) | 33 | static int show_version(struct seq_file *m, struct super_block *sb) |
34 | { | 34 | { |
35 | char *format; | 35 | char *format; |
36 | 36 | ||
37 | if ( REISERFS_SB(sb)->s_properties & (1 << REISERFS_3_6) ) { | 37 | if (REISERFS_SB(sb)->s_properties & (1 << REISERFS_3_6)) { |
38 | format = "3.6"; | 38 | format = "3.6"; |
39 | } else if ( REISERFS_SB(sb)->s_properties & (1 << REISERFS_3_5) ) { | 39 | } else if (REISERFS_SB(sb)->s_properties & (1 << REISERFS_3_5)) { |
40 | format = "3.5"; | 40 | format = "3.5"; |
41 | } else { | 41 | } else { |
42 | format = "unknown"; | 42 | format = "unknown"; |
43 | } | 43 | } |
44 | 44 | ||
45 | seq_printf(m, "%s format\twith checks %s\n", | 45 | seq_printf(m, "%s format\twith checks %s\n", format, |
46 | format, | ||
47 | #if defined( CONFIG_REISERFS_CHECK ) | 46 | #if defined( CONFIG_REISERFS_CHECK ) |
48 | "on" | 47 | "on" |
49 | #else | 48 | #else |
50 | "off" | 49 | "off" |
51 | #endif | 50 | #endif |
52 | ); | 51 | ); |
53 | return 0; | 52 | return 0; |
54 | } | 53 | } |
55 | 54 | ||
56 | int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset, | 55 | int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, |
57 | int count, int *eof, void *data ) | 56 | int count, int *eof, void *data) |
58 | { | 57 | { |
59 | *start = buffer; | 58 | *start = buffer; |
60 | *eof = 1; | 59 | *eof = 1; |
@@ -79,87 +78,68 @@ int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset, | |||
79 | 78 | ||
80 | #define DJF( x ) le32_to_cpu( rs -> x ) | 79 | #define DJF( x ) le32_to_cpu( rs -> x ) |
81 | #define DJV( x ) le32_to_cpu( s_v1 -> x ) | 80 | #define DJV( x ) le32_to_cpu( s_v1 -> x ) |
82 | #define DJP( x ) le32_to_cpu( jp -> x ) | 81 | #define DJP( x ) le32_to_cpu( jp -> x ) |
83 | #define JF( x ) ( r -> s_journal -> x ) | 82 | #define JF( x ) ( r -> s_journal -> x ) |
84 | 83 | ||
85 | static int show_super(struct seq_file *m, struct super_block *sb) | 84 | static int show_super(struct seq_file *m, struct super_block *sb) |
86 | { | 85 | { |
87 | struct reiserfs_sb_info *r = REISERFS_SB(sb); | 86 | struct reiserfs_sb_info *r = REISERFS_SB(sb); |
88 | 87 | ||
89 | seq_printf(m, "state: \t%s\n" | 88 | seq_printf(m, "state: \t%s\n" |
90 | "mount options: \t%s%s%s%s%s%s%s%s%s%s%s\n" | 89 | "mount options: \t%s%s%s%s%s%s%s%s%s%s%s\n" |
91 | "gen. counter: \t%i\n" | 90 | "gen. counter: \t%i\n" |
92 | "s_kmallocs: \t%i\n" | 91 | "s_kmallocs: \t%i\n" |
93 | "s_disk_reads: \t%i\n" | 92 | "s_disk_reads: \t%i\n" |
94 | "s_disk_writes: \t%i\n" | 93 | "s_disk_writes: \t%i\n" |
95 | "s_fix_nodes: \t%i\n" | 94 | "s_fix_nodes: \t%i\n" |
96 | "s_do_balance: \t%i\n" | 95 | "s_do_balance: \t%i\n" |
97 | "s_unneeded_left_neighbor: \t%i\n" | 96 | "s_unneeded_left_neighbor: \t%i\n" |
98 | "s_good_search_by_key_reada: \t%i\n" | 97 | "s_good_search_by_key_reada: \t%i\n" |
99 | "s_bmaps: \t%i\n" | 98 | "s_bmaps: \t%i\n" |
100 | "s_bmaps_without_search: \t%i\n" | 99 | "s_bmaps_without_search: \t%i\n" |
101 | "s_direct2indirect: \t%i\n" | 100 | "s_direct2indirect: \t%i\n" |
102 | "s_indirect2direct: \t%i\n" | 101 | "s_indirect2direct: \t%i\n" |
103 | "\n" | 102 | "\n" |
104 | "max_hash_collisions: \t%i\n" | 103 | "max_hash_collisions: \t%i\n" |
105 | 104 | "breads: \t%lu\n" | |
106 | "breads: \t%lu\n" | 105 | "bread_misses: \t%lu\n" |
107 | "bread_misses: \t%lu\n" | 106 | "search_by_key: \t%lu\n" |
108 | 107 | "search_by_key_fs_changed: \t%lu\n" | |
109 | "search_by_key: \t%lu\n" | 108 | "search_by_key_restarted: \t%lu\n" |
110 | "search_by_key_fs_changed: \t%lu\n" | 109 | "insert_item_restarted: \t%lu\n" |
111 | "search_by_key_restarted: \t%lu\n" | 110 | "paste_into_item_restarted: \t%lu\n" |
112 | 111 | "cut_from_item_restarted: \t%lu\n" | |
113 | "insert_item_restarted: \t%lu\n" | 112 | "delete_solid_item_restarted: \t%lu\n" |
114 | "paste_into_item_restarted: \t%lu\n" | 113 | "delete_item_restarted: \t%lu\n" |
115 | "cut_from_item_restarted: \t%lu\n" | 114 | "leaked_oid: \t%lu\n" |
116 | "delete_solid_item_restarted: \t%lu\n" | 115 | "leaves_removable: \t%lu\n", |
117 | "delete_item_restarted: \t%lu\n" | 116 | SF(s_mount_state) == REISERFS_VALID_FS ? |
118 | 117 | "REISERFS_VALID_FS" : "REISERFS_ERROR_FS", | |
119 | "leaked_oid: \t%lu\n" | 118 | reiserfs_r5_hash(sb) ? "FORCE_R5 " : "", |
120 | "leaves_removable: \t%lu\n", | 119 | reiserfs_rupasov_hash(sb) ? "FORCE_RUPASOV " : "", |
121 | 120 | reiserfs_tea_hash(sb) ? "FORCE_TEA " : "", | |
122 | SF( s_mount_state ) == REISERFS_VALID_FS ? | 121 | reiserfs_hash_detect(sb) ? "DETECT_HASH " : "", |
123 | "REISERFS_VALID_FS" : "REISERFS_ERROR_FS", | 122 | reiserfs_no_border(sb) ? "NO_BORDER " : "BORDER ", |
124 | reiserfs_r5_hash( sb ) ? "FORCE_R5 " : "", | 123 | reiserfs_no_unhashed_relocation(sb) ? |
125 | reiserfs_rupasov_hash( sb ) ? "FORCE_RUPASOV " : "", | 124 | "NO_UNHASHED_RELOCATION " : "", |
126 | reiserfs_tea_hash( sb ) ? "FORCE_TEA " : "", | 125 | reiserfs_hashed_relocation(sb) ? "UNHASHED_RELOCATION " : "", |
127 | reiserfs_hash_detect( sb ) ? "DETECT_HASH " : "", | 126 | reiserfs_test4(sb) ? "TEST4 " : "", |
128 | reiserfs_no_border( sb ) ? "NO_BORDER " : "BORDER ", | 127 | have_large_tails(sb) ? "TAILS " : have_small_tails(sb) ? |
129 | reiserfs_no_unhashed_relocation( sb ) ? "NO_UNHASHED_RELOCATION " : "", | 128 | "SMALL_TAILS " : "NO_TAILS ", |
130 | reiserfs_hashed_relocation( sb ) ? "UNHASHED_RELOCATION " : "", | 129 | replay_only(sb) ? "REPLAY_ONLY " : "", |
131 | reiserfs_test4( sb ) ? "TEST4 " : "", | 130 | convert_reiserfs(sb) ? "CONV " : "", |
132 | have_large_tails( sb ) ? "TAILS " : have_small_tails(sb)?"SMALL_TAILS ":"NO_TAILS ", | 131 | atomic_read(&r->s_generation_counter), SF(s_kmallocs), |
133 | replay_only( sb ) ? "REPLAY_ONLY " : "", | 132 | SF(s_disk_reads), SF(s_disk_writes), SF(s_fix_nodes), |
134 | convert_reiserfs( sb ) ? "CONV " : "", | 133 | SF(s_do_balance), SF(s_unneeded_left_neighbor), |
135 | 134 | SF(s_good_search_by_key_reada), SF(s_bmaps), | |
136 | atomic_read( &r -> s_generation_counter ), | 135 | SF(s_bmaps_without_search), SF(s_direct2indirect), |
137 | SF( s_kmallocs ), | 136 | SF(s_indirect2direct), SFP(max_hash_collisions), SFP(breads), |
138 | SF( s_disk_reads ), | 137 | SFP(bread_miss), SFP(search_by_key), |
139 | SF( s_disk_writes ), | 138 | SFP(search_by_key_fs_changed), SFP(search_by_key_restarted), |
140 | SF( s_fix_nodes ), | 139 | SFP(insert_item_restarted), SFP(paste_into_item_restarted), |
141 | SF( s_do_balance ), | 140 | SFP(cut_from_item_restarted), |
142 | SF( s_unneeded_left_neighbor ), | 141 | SFP(delete_solid_item_restarted), SFP(delete_item_restarted), |
143 | SF( s_good_search_by_key_reada ), | 142 | SFP(leaked_oid), SFP(leaves_removable)); |
144 | SF( s_bmaps ), | ||
145 | SF( s_bmaps_without_search ), | ||
146 | SF( s_direct2indirect ), | ||
147 | SF( s_indirect2direct ), | ||
148 | SFP( max_hash_collisions ), | ||
149 | SFP( breads ), | ||
150 | SFP( bread_miss ), | ||
151 | SFP( search_by_key ), | ||
152 | SFP( search_by_key_fs_changed ), | ||
153 | SFP( search_by_key_restarted ), | ||
154 | |||
155 | SFP( insert_item_restarted ), | ||
156 | SFP( paste_into_item_restarted ), | ||
157 | SFP( cut_from_item_restarted ), | ||
158 | SFP( delete_solid_item_restarted ), | ||
159 | SFP( delete_item_restarted ), | ||
160 | |||
161 | SFP( leaked_oid ), | ||
162 | SFP( leaves_removable ) ); | ||
163 | 143 | ||
164 | return 0; | 144 | return 0; |
165 | } | 145 | } |
@@ -169,61 +149,55 @@ static int show_per_level(struct seq_file *m, struct super_block *sb) | |||
169 | struct reiserfs_sb_info *r = REISERFS_SB(sb); | 149 | struct reiserfs_sb_info *r = REISERFS_SB(sb); |
170 | int level; | 150 | int level; |
171 | 151 | ||
172 | seq_printf(m, "level\t" | 152 | seq_printf(m, "level\t" |
173 | " balances" | 153 | " balances" |
174 | " [sbk: reads" | 154 | " [sbk: reads" |
175 | " fs_changed" | 155 | " fs_changed" |
176 | " restarted]" | 156 | " restarted]" |
177 | " free space" | 157 | " free space" |
178 | " items" | 158 | " items" |
179 | " can_remove" | 159 | " can_remove" |
180 | " lnum" | 160 | " lnum" |
181 | " rnum" | 161 | " rnum" |
182 | " lbytes" | 162 | " lbytes" |
183 | " rbytes" | 163 | " rbytes" |
184 | " get_neig" | 164 | " get_neig" |
185 | " get_neig_res" | 165 | " get_neig_res" " need_l_neig" " need_r_neig" "\n"); |
186 | " need_l_neig" | 166 | |
187 | " need_r_neig" | 167 | for (level = 0; level < MAX_HEIGHT; ++level) { |
188 | "\n" | 168 | seq_printf(m, "%i\t" |
189 | 169 | " %12lu" | |
190 | ); | 170 | " %12lu" |
191 | 171 | " %12lu" | |
192 | for( level = 0 ; level < MAX_HEIGHT ; ++ level ) { | 172 | " %12lu" |
193 | seq_printf(m, "%i\t" | 173 | " %12lu" |
194 | " %12lu" | 174 | " %12lu" |
195 | " %12lu" | 175 | " %12lu" |
196 | " %12lu" | 176 | " %12li" |
197 | " %12lu" | 177 | " %12li" |
198 | " %12lu" | 178 | " %12li" |
199 | " %12lu" | 179 | " %12li" |
200 | " %12lu" | 180 | " %12lu" |
201 | " %12li" | 181 | " %12lu" |
202 | " %12li" | 182 | " %12lu" |
203 | " %12li" | 183 | " %12lu" |
204 | " %12li" | 184 | "\n", |
205 | " %12lu" | 185 | level, |
206 | " %12lu" | 186 | SFPL(balance_at), |
207 | " %12lu" | 187 | SFPL(sbk_read_at), |
208 | " %12lu" | 188 | SFPL(sbk_fs_changed), |
209 | "\n", | 189 | SFPL(sbk_restarted), |
210 | level, | 190 | SFPL(free_at), |
211 | SFPL( balance_at ), | 191 | SFPL(items_at), |
212 | SFPL( sbk_read_at ), | 192 | SFPL(can_node_be_removed), |
213 | SFPL( sbk_fs_changed ), | 193 | SFPL(lnum), |
214 | SFPL( sbk_restarted ), | 194 | SFPL(rnum), |
215 | SFPL( free_at ), | 195 | SFPL(lbytes), |
216 | SFPL( items_at ), | 196 | SFPL(rbytes), |
217 | SFPL( can_node_be_removed ), | 197 | SFPL(get_neighbors), |
218 | SFPL( lnum ), | 198 | SFPL(get_neighbors_restart), |
219 | SFPL( rnum ), | 199 | SFPL(need_l_neighbor), SFPL(need_r_neighbor) |
220 | SFPL( lbytes ), | 200 | ); |
221 | SFPL( rbytes ), | ||
222 | SFPL( get_neighbors ), | ||
223 | SFPL( get_neighbors_restart ), | ||
224 | SFPL( need_l_neighbor ), | ||
225 | SFPL( need_r_neighbor ) | ||
226 | ); | ||
227 | } | 201 | } |
228 | return 0; | 202 | return 0; |
229 | } | 203 | } |
@@ -232,31 +206,30 @@ static int show_bitmap(struct seq_file *m, struct super_block *sb) | |||
232 | { | 206 | { |
233 | struct reiserfs_sb_info *r = REISERFS_SB(sb); | 207 | struct reiserfs_sb_info *r = REISERFS_SB(sb); |
234 | 208 | ||
235 | seq_printf(m, "free_block: %lu\n" | 209 | seq_printf(m, "free_block: %lu\n" |
236 | " scan_bitmap:" | 210 | " scan_bitmap:" |
237 | " wait" | 211 | " wait" |
238 | " bmap" | 212 | " bmap" |
239 | " retry" | 213 | " retry" |
240 | " stolen" | 214 | " stolen" |
241 | " journal_hint" | 215 | " journal_hint" |
242 | "journal_nohint" | 216 | "journal_nohint" |
243 | "\n" | 217 | "\n" |
244 | " %14lu" | 218 | " %14lu" |
245 | " %14lu" | 219 | " %14lu" |
246 | " %14lu" | 220 | " %14lu" |
247 | " %14lu" | 221 | " %14lu" |
248 | " %14lu" | 222 | " %14lu" |
249 | " %14lu" | 223 | " %14lu" |
250 | " %14lu" | 224 | " %14lu" |
251 | "\n", | 225 | "\n", |
252 | SFP( free_block ), | 226 | SFP(free_block), |
253 | SFPF( call ), | 227 | SFPF(call), |
254 | SFPF( wait ), | 228 | SFPF(wait), |
255 | SFPF( bmap ), | 229 | SFPF(bmap), |
256 | SFPF( retry ), | 230 | SFPF(retry), |
257 | SFPF( stolen ), | 231 | SFPF(stolen), |
258 | SFPF( in_journal_hint ), | 232 | SFPF(in_journal_hint), SFPF(in_journal_nohint)); |
259 | SFPF( in_journal_nohint ) ); | ||
260 | 233 | ||
261 | return 0; | 234 | return 0; |
262 | } | 235 | } |
@@ -264,46 +237,42 @@ static int show_bitmap(struct seq_file *m, struct super_block *sb) | |||
264 | static int show_on_disk_super(struct seq_file *m, struct super_block *sb) | 237 | static int show_on_disk_super(struct seq_file *m, struct super_block *sb) |
265 | { | 238 | { |
266 | struct reiserfs_sb_info *sb_info = REISERFS_SB(sb); | 239 | struct reiserfs_sb_info *sb_info = REISERFS_SB(sb); |
267 | struct reiserfs_super_block *rs = sb_info -> s_rs; | 240 | struct reiserfs_super_block *rs = sb_info->s_rs; |
268 | int hash_code = DFL( s_hash_function_code ); | 241 | int hash_code = DFL(s_hash_function_code); |
269 | __u32 flags = DJF( s_flags ); | 242 | __u32 flags = DJF(s_flags); |
270 | 243 | ||
271 | seq_printf(m, "block_count: \t%i\n" | 244 | seq_printf(m, "block_count: \t%i\n" |
272 | "free_blocks: \t%i\n" | 245 | "free_blocks: \t%i\n" |
273 | "root_block: \t%i\n" | 246 | "root_block: \t%i\n" |
274 | "blocksize: \t%i\n" | 247 | "blocksize: \t%i\n" |
275 | "oid_maxsize: \t%i\n" | 248 | "oid_maxsize: \t%i\n" |
276 | "oid_cursize: \t%i\n" | 249 | "oid_cursize: \t%i\n" |
277 | "umount_state: \t%i\n" | 250 | "umount_state: \t%i\n" |
278 | "magic: \t%10.10s\n" | 251 | "magic: \t%10.10s\n" |
279 | "fs_state: \t%i\n" | 252 | "fs_state: \t%i\n" |
280 | "hash: \t%s\n" | 253 | "hash: \t%s\n" |
281 | "tree_height: \t%i\n" | 254 | "tree_height: \t%i\n" |
282 | "bmap_nr: \t%i\n" | 255 | "bmap_nr: \t%i\n" |
283 | "version: \t%i\n" | 256 | "version: \t%i\n" |
284 | "flags: \t%x[%s]\n" | 257 | "flags: \t%x[%s]\n" |
285 | "reserved_for_journal: \t%i\n", | 258 | "reserved_for_journal: \t%i\n", |
286 | 259 | DFL(s_block_count), | |
287 | DFL( s_block_count ), | 260 | DFL(s_free_blocks), |
288 | DFL( s_free_blocks ), | 261 | DFL(s_root_block), |
289 | DFL( s_root_block ), | 262 | DF(s_blocksize), |
290 | DF( s_blocksize ), | 263 | DF(s_oid_maxsize), |
291 | DF( s_oid_maxsize ), | 264 | DF(s_oid_cursize), |
292 | DF( s_oid_cursize ), | 265 | DF(s_umount_state), |
293 | DF( s_umount_state ), | 266 | rs->s_v1.s_magic, |
294 | rs -> s_v1.s_magic, | 267 | DF(s_fs_state), |
295 | DF( s_fs_state ), | 268 | hash_code == TEA_HASH ? "tea" : |
296 | hash_code == TEA_HASH ? "tea" : | 269 | (hash_code == YURA_HASH) ? "rupasov" : |
297 | ( hash_code == YURA_HASH ) ? "rupasov" : | 270 | (hash_code == R5_HASH) ? "r5" : |
298 | ( hash_code == R5_HASH ) ? "r5" : | 271 | (hash_code == UNSET_HASH) ? "unset" : "unknown", |
299 | ( hash_code == UNSET_HASH ) ? "unset" : "unknown", | 272 | DF(s_tree_height), |
300 | DF( s_tree_height ), | 273 | DF(s_bmap_nr), |
301 | DF( s_bmap_nr ), | 274 | DF(s_version), flags, (flags & reiserfs_attrs_cleared) |
302 | DF( s_version ), | 275 | ? "attrs_cleared" : "", DF(s_reserved_for_journal)); |
303 | flags, | ||
304 | ( flags & reiserfs_attrs_cleared ) | ||
305 | ? "attrs_cleared" : "", | ||
306 | DF (s_reserved_for_journal)); | ||
307 | 276 | ||
308 | return 0; | 277 | return 0; |
309 | } | 278 | } |
@@ -311,131 +280,122 @@ static int show_on_disk_super(struct seq_file *m, struct super_block *sb) | |||
311 | static int show_oidmap(struct seq_file *m, struct super_block *sb) | 280 | static int show_oidmap(struct seq_file *m, struct super_block *sb) |
312 | { | 281 | { |
313 | struct reiserfs_sb_info *sb_info = REISERFS_SB(sb); | 282 | struct reiserfs_sb_info *sb_info = REISERFS_SB(sb); |
314 | struct reiserfs_super_block *rs = sb_info -> s_rs; | 283 | struct reiserfs_super_block *rs = sb_info->s_rs; |
315 | unsigned int mapsize = le16_to_cpu( rs -> s_v1.s_oid_cursize ); | 284 | unsigned int mapsize = le16_to_cpu(rs->s_v1.s_oid_cursize); |
316 | unsigned long total_used = 0; | 285 | unsigned long total_used = 0; |
317 | int i; | 286 | int i; |
318 | 287 | ||
319 | for( i = 0 ; i < mapsize ; ++i ) { | 288 | for (i = 0; i < mapsize; ++i) { |
320 | __u32 right; | 289 | __u32 right; |
321 | 290 | ||
322 | right = ( i == mapsize - 1 ) ? MAX_KEY_OBJECTID : MAP( i + 1 ); | 291 | right = (i == mapsize - 1) ? MAX_KEY_OBJECTID : MAP(i + 1); |
323 | seq_printf(m, "%s: [ %x .. %x )\n", | 292 | seq_printf(m, "%s: [ %x .. %x )\n", |
324 | ( i & 1 ) ? "free" : "used", MAP( i ), right ); | 293 | (i & 1) ? "free" : "used", MAP(i), right); |
325 | if( ! ( i & 1 ) ) { | 294 | if (!(i & 1)) { |
326 | total_used += right - MAP( i ); | 295 | total_used += right - MAP(i); |
327 | } | 296 | } |
328 | } | 297 | } |
329 | #if defined( REISERFS_USE_OIDMAPF ) | 298 | #if defined( REISERFS_USE_OIDMAPF ) |
330 | if( sb_info -> oidmap.use_file && ( sb_info -> oidmap.mapf != NULL ) ) { | 299 | if (sb_info->oidmap.use_file && (sb_info->oidmap.mapf != NULL)) { |
331 | loff_t size = sb_info->oidmap.mapf->f_dentry->d_inode->i_size; | 300 | loff_t size = sb_info->oidmap.mapf->f_dentry->d_inode->i_size; |
332 | total_used += size / sizeof( reiserfs_oidinterval_d_t ); | 301 | total_used += size / sizeof(reiserfs_oidinterval_d_t); |
333 | } | 302 | } |
334 | #endif | 303 | #endif |
335 | seq_printf(m, "total: \t%i [%i/%i] used: %lu [exact]\n", | 304 | seq_printf(m, "total: \t%i [%i/%i] used: %lu [exact]\n", |
336 | mapsize, | 305 | mapsize, |
337 | mapsize, le16_to_cpu( rs -> s_v1.s_oid_maxsize ), | 306 | mapsize, le16_to_cpu(rs->s_v1.s_oid_maxsize), total_used); |
338 | total_used); | ||
339 | return 0; | 307 | return 0; |
340 | } | 308 | } |
341 | 309 | ||
342 | static int show_journal(struct seq_file *m, struct super_block *sb) | 310 | static int show_journal(struct seq_file *m, struct super_block *sb) |
343 | { | 311 | { |
344 | struct reiserfs_sb_info *r = REISERFS_SB(sb); | 312 | struct reiserfs_sb_info *r = REISERFS_SB(sb); |
345 | struct reiserfs_super_block *rs = r -> s_rs; | 313 | struct reiserfs_super_block *rs = r->s_rs; |
346 | struct journal_params *jp = &rs->s_v1.s_journal; | 314 | struct journal_params *jp = &rs->s_v1.s_journal; |
347 | char b[BDEVNAME_SIZE]; | 315 | char b[BDEVNAME_SIZE]; |
348 | 316 | ||
349 | 317 | seq_printf(m, /* on-disk fields */ | |
350 | seq_printf(m, /* on-disk fields */ | 318 | "jp_journal_1st_block: \t%i\n" |
351 | "jp_journal_1st_block: \t%i\n" | 319 | "jp_journal_dev: \t%s[%x]\n" |
352 | "jp_journal_dev: \t%s[%x]\n" | 320 | "jp_journal_size: \t%i\n" |
353 | "jp_journal_size: \t%i\n" | 321 | "jp_journal_trans_max: \t%i\n" |
354 | "jp_journal_trans_max: \t%i\n" | 322 | "jp_journal_magic: \t%i\n" |
355 | "jp_journal_magic: \t%i\n" | 323 | "jp_journal_max_batch: \t%i\n" |
356 | "jp_journal_max_batch: \t%i\n" | 324 | "jp_journal_max_commit_age: \t%i\n" |
357 | "jp_journal_max_commit_age: \t%i\n" | 325 | "jp_journal_max_trans_age: \t%i\n" |
358 | "jp_journal_max_trans_age: \t%i\n" | 326 | /* incore fields */ |
359 | /* incore fields */ | 327 | "j_1st_reserved_block: \t%i\n" |
360 | "j_1st_reserved_block: \t%i\n" | 328 | "j_state: \t%li\n" |
361 | "j_state: \t%li\n" | 329 | "j_trans_id: \t%lu\n" |
362 | "j_trans_id: \t%lu\n" | 330 | "j_mount_id: \t%lu\n" |
363 | "j_mount_id: \t%lu\n" | 331 | "j_start: \t%lu\n" |
364 | "j_start: \t%lu\n" | 332 | "j_len: \t%lu\n" |
365 | "j_len: \t%lu\n" | 333 | "j_len_alloc: \t%lu\n" |
366 | "j_len_alloc: \t%lu\n" | 334 | "j_wcount: \t%i\n" |
367 | "j_wcount: \t%i\n" | 335 | "j_bcount: \t%lu\n" |
368 | "j_bcount: \t%lu\n" | 336 | "j_first_unflushed_offset: \t%lu\n" |
369 | "j_first_unflushed_offset: \t%lu\n" | 337 | "j_last_flush_trans_id: \t%lu\n" |
370 | "j_last_flush_trans_id: \t%lu\n" | 338 | "j_trans_start_time: \t%li\n" |
371 | "j_trans_start_time: \t%li\n" | 339 | "j_list_bitmap_index: \t%i\n" |
372 | "j_list_bitmap_index: \t%i\n" | 340 | "j_must_wait: \t%i\n" |
373 | "j_must_wait: \t%i\n" | 341 | "j_next_full_flush: \t%i\n" |
374 | "j_next_full_flush: \t%i\n" | 342 | "j_next_async_flush: \t%i\n" |
375 | "j_next_async_flush: \t%i\n" | 343 | "j_cnode_used: \t%i\n" "j_cnode_free: \t%i\n" "\n" |
376 | "j_cnode_used: \t%i\n" | 344 | /* reiserfs_proc_info_data_t.journal fields */ |
377 | "j_cnode_free: \t%i\n" | 345 | "in_journal: \t%12lu\n" |
378 | "\n" | 346 | "in_journal_bitmap: \t%12lu\n" |
379 | /* reiserfs_proc_info_data_t.journal fields */ | 347 | "in_journal_reusable: \t%12lu\n" |
380 | "in_journal: \t%12lu\n" | 348 | "lock_journal: \t%12lu\n" |
381 | "in_journal_bitmap: \t%12lu\n" | 349 | "lock_journal_wait: \t%12lu\n" |
382 | "in_journal_reusable: \t%12lu\n" | 350 | "journal_begin: \t%12lu\n" |
383 | "lock_journal: \t%12lu\n" | 351 | "journal_relock_writers: \t%12lu\n" |
384 | "lock_journal_wait: \t%12lu\n" | 352 | "journal_relock_wcount: \t%12lu\n" |
385 | "journal_begin: \t%12lu\n" | 353 | "mark_dirty: \t%12lu\n" |
386 | "journal_relock_writers: \t%12lu\n" | 354 | "mark_dirty_already: \t%12lu\n" |
387 | "journal_relock_wcount: \t%12lu\n" | 355 | "mark_dirty_notjournal: \t%12lu\n" |
388 | "mark_dirty: \t%12lu\n" | 356 | "restore_prepared: \t%12lu\n" |
389 | "mark_dirty_already: \t%12lu\n" | 357 | "prepare: \t%12lu\n" |
390 | "mark_dirty_notjournal: \t%12lu\n" | 358 | "prepare_retry: \t%12lu\n", |
391 | "restore_prepared: \t%12lu\n" | 359 | DJP(jp_journal_1st_block), |
392 | "prepare: \t%12lu\n" | 360 | bdevname(SB_JOURNAL(sb)->j_dev_bd, b), |
393 | "prepare_retry: \t%12lu\n", | 361 | DJP(jp_journal_dev), |
394 | 362 | DJP(jp_journal_size), | |
395 | DJP( jp_journal_1st_block ), | 363 | DJP(jp_journal_trans_max), |
396 | bdevname(SB_JOURNAL(sb)->j_dev_bd, b), | 364 | DJP(jp_journal_magic), |
397 | DJP( jp_journal_dev ), | 365 | DJP(jp_journal_max_batch), |
398 | DJP( jp_journal_size ), | 366 | SB_JOURNAL(sb)->j_max_commit_age, |
399 | DJP( jp_journal_trans_max ), | 367 | DJP(jp_journal_max_trans_age), |
400 | DJP( jp_journal_magic ), | 368 | JF(j_1st_reserved_block), |
401 | DJP( jp_journal_max_batch ), | 369 | JF(j_state), |
402 | SB_JOURNAL(sb)->j_max_commit_age, | 370 | JF(j_trans_id), |
403 | DJP( jp_journal_max_trans_age ), | 371 | JF(j_mount_id), |
404 | 372 | JF(j_start), | |
405 | JF( j_1st_reserved_block ), | 373 | JF(j_len), |
406 | JF( j_state ), | 374 | JF(j_len_alloc), |
407 | JF( j_trans_id ), | 375 | atomic_read(&r->s_journal->j_wcount), |
408 | JF( j_mount_id ), | 376 | JF(j_bcount), |
409 | JF( j_start ), | 377 | JF(j_first_unflushed_offset), |
410 | JF( j_len ), | 378 | JF(j_last_flush_trans_id), |
411 | JF( j_len_alloc ), | 379 | JF(j_trans_start_time), |
412 | atomic_read( & r -> s_journal -> j_wcount ), | 380 | JF(j_list_bitmap_index), |
413 | JF( j_bcount ), | 381 | JF(j_must_wait), |
414 | JF( j_first_unflushed_offset ), | 382 | JF(j_next_full_flush), |
415 | JF( j_last_flush_trans_id ), | 383 | JF(j_next_async_flush), |
416 | JF( j_trans_start_time ), | 384 | JF(j_cnode_used), |
417 | JF( j_list_bitmap_index ), | 385 | JF(j_cnode_free), |
418 | JF( j_must_wait ), | 386 | SFPJ(in_journal), |
419 | JF( j_next_full_flush ), | 387 | SFPJ(in_journal_bitmap), |
420 | JF( j_next_async_flush ), | 388 | SFPJ(in_journal_reusable), |
421 | JF( j_cnode_used ), | 389 | SFPJ(lock_journal), |
422 | JF( j_cnode_free ), | 390 | SFPJ(lock_journal_wait), |
423 | 391 | SFPJ(journal_being), | |
424 | SFPJ( in_journal ), | 392 | SFPJ(journal_relock_writers), |
425 | SFPJ( in_journal_bitmap ), | 393 | SFPJ(journal_relock_wcount), |
426 | SFPJ( in_journal_reusable ), | 394 | SFPJ(mark_dirty), |
427 | SFPJ( lock_journal ), | 395 | SFPJ(mark_dirty_already), |
428 | SFPJ( lock_journal_wait ), | 396 | SFPJ(mark_dirty_notjournal), |
429 | SFPJ( journal_being ), | 397 | SFPJ(restore_prepared), SFPJ(prepare), SFPJ(prepare_retry) |
430 | SFPJ( journal_relock_writers ), | 398 | ); |
431 | SFPJ( journal_relock_wcount ), | ||
432 | SFPJ( mark_dirty ), | ||
433 | SFPJ( mark_dirty_already ), | ||
434 | SFPJ( mark_dirty_notjournal ), | ||
435 | SFPJ( restore_prepared ), | ||
436 | SFPJ( prepare ), | ||
437 | SFPJ( prepare_retry ) | ||
438 | ); | ||
439 | return 0; | 399 | return 0; |
440 | } | 400 | } |
441 | 401 | ||
@@ -450,7 +410,7 @@ static int set_sb(struct super_block *sb, void *data) | |||
450 | return -ENOENT; | 410 | return -ENOENT; |
451 | } | 411 | } |
452 | 412 | ||
453 | static void *r_start(struct seq_file *m, loff_t *pos) | 413 | static void *r_start(struct seq_file *m, loff_t * pos) |
454 | { | 414 | { |
455 | struct proc_dir_entry *de = m->private; | 415 | struct proc_dir_entry *de = m->private; |
456 | struct super_block *s = de->parent->data; | 416 | struct super_block *s = de->parent->data; |
@@ -472,7 +432,7 @@ static void *r_start(struct seq_file *m, loff_t *pos) | |||
472 | return s; | 432 | return s; |
473 | } | 433 | } |
474 | 434 | ||
475 | static void *r_next(struct seq_file *m, void *v, loff_t *pos) | 435 | static void *r_next(struct seq_file *m, void *v, loff_t * pos) |
476 | { | 436 | { |
477 | ++*pos; | 437 | ++*pos; |
478 | if (v) | 438 | if (v) |
@@ -489,7 +449,7 @@ static void r_stop(struct seq_file *m, void *v) | |||
489 | static int r_show(struct seq_file *m, void *v) | 449 | static int r_show(struct seq_file *m, void *v) |
490 | { | 450 | { |
491 | struct proc_dir_entry *de = m->private; | 451 | struct proc_dir_entry *de = m->private; |
492 | int (*show)(struct seq_file *, struct super_block *) = de->data; | 452 | int (*show) (struct seq_file *, struct super_block *) = de->data; |
493 | return show(m, v); | 453 | return show(m, v); |
494 | } | 454 | } |
495 | 455 | ||
@@ -512,17 +472,17 @@ static int r_open(struct inode *inode, struct file *file) | |||
512 | } | 472 | } |
513 | 473 | ||
514 | static struct file_operations r_file_operations = { | 474 | static struct file_operations r_file_operations = { |
515 | .open = r_open, | 475 | .open = r_open, |
516 | .read = seq_read, | 476 | .read = seq_read, |
517 | .llseek = seq_lseek, | 477 | .llseek = seq_lseek, |
518 | .release = seq_release, | 478 | .release = seq_release, |
519 | }; | 479 | }; |
520 | 480 | ||
521 | static struct proc_dir_entry *proc_info_root = NULL; | 481 | static struct proc_dir_entry *proc_info_root = NULL; |
522 | static const char proc_info_root_name[] = "fs/reiserfs"; | 482 | static const char proc_info_root_name[] = "fs/reiserfs"; |
523 | 483 | ||
524 | static void add_file(struct super_block *sb, char *name, | 484 | static void add_file(struct super_block *sb, char *name, |
525 | int (*func)(struct seq_file *, struct super_block *)) | 485 | int (*func) (struct seq_file *, struct super_block *)) |
526 | { | 486 | { |
527 | struct proc_dir_entry *de; | 487 | struct proc_dir_entry *de; |
528 | de = create_proc_entry(name, 0, REISERFS_SB(sb)->procdir); | 488 | de = create_proc_entry(name, 0, REISERFS_SB(sb)->procdir); |
@@ -532,11 +492,12 @@ static void add_file(struct super_block *sb, char *name, | |||
532 | } | 492 | } |
533 | } | 493 | } |
534 | 494 | ||
535 | int reiserfs_proc_info_init( struct super_block *sb ) | 495 | int reiserfs_proc_info_init(struct super_block *sb) |
536 | { | 496 | { |
537 | spin_lock_init( & __PINFO( sb ).lock ); | 497 | spin_lock_init(&__PINFO(sb).lock); |
538 | REISERFS_SB(sb)->procdir = proc_mkdir(reiserfs_bdevname (sb), proc_info_root); | 498 | REISERFS_SB(sb)->procdir = |
539 | if( REISERFS_SB(sb)->procdir ) { | 499 | proc_mkdir(reiserfs_bdevname(sb), proc_info_root); |
500 | if (REISERFS_SB(sb)->procdir) { | ||
540 | REISERFS_SB(sb)->procdir->owner = THIS_MODULE; | 501 | REISERFS_SB(sb)->procdir->owner = THIS_MODULE; |
541 | REISERFS_SB(sb)->procdir->data = sb; | 502 | REISERFS_SB(sb)->procdir->data = sb; |
542 | add_file(sb, "version", show_version); | 503 | add_file(sb, "version", show_version); |
@@ -549,11 +510,11 @@ int reiserfs_proc_info_init( struct super_block *sb ) | |||
549 | return 0; | 510 | return 0; |
550 | } | 511 | } |
551 | reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", | 512 | reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", |
552 | proc_info_root_name, reiserfs_bdevname (sb) ); | 513 | proc_info_root_name, reiserfs_bdevname(sb)); |
553 | return 1; | 514 | return 1; |
554 | } | 515 | } |
555 | 516 | ||
556 | int reiserfs_proc_info_done( struct super_block *sb ) | 517 | int reiserfs_proc_info_done(struct super_block *sb) |
557 | { | 518 | { |
558 | struct proc_dir_entry *de = REISERFS_SB(sb)->procdir; | 519 | struct proc_dir_entry *de = REISERFS_SB(sb)->procdir; |
559 | if (de) { | 520 | if (de) { |
@@ -565,48 +526,48 @@ int reiserfs_proc_info_done( struct super_block *sb ) | |||
565 | remove_proc_entry("super", de); | 526 | remove_proc_entry("super", de); |
566 | remove_proc_entry("version", de); | 527 | remove_proc_entry("version", de); |
567 | } | 528 | } |
568 | spin_lock( & __PINFO( sb ).lock ); | 529 | spin_lock(&__PINFO(sb).lock); |
569 | __PINFO( sb ).exiting = 1; | 530 | __PINFO(sb).exiting = 1; |
570 | spin_unlock( & __PINFO( sb ).lock ); | 531 | spin_unlock(&__PINFO(sb).lock); |
571 | if ( proc_info_root ) { | 532 | if (proc_info_root) { |
572 | remove_proc_entry( reiserfs_bdevname (sb), proc_info_root ); | 533 | remove_proc_entry(reiserfs_bdevname(sb), proc_info_root); |
573 | REISERFS_SB(sb)->procdir = NULL; | 534 | REISERFS_SB(sb)->procdir = NULL; |
574 | } | 535 | } |
575 | return 0; | 536 | return 0; |
576 | } | 537 | } |
577 | 538 | ||
578 | struct proc_dir_entry *reiserfs_proc_register_global( char *name, | 539 | struct proc_dir_entry *reiserfs_proc_register_global(char *name, |
579 | read_proc_t *func ) | 540 | read_proc_t * func) |
580 | { | 541 | { |
581 | return ( proc_info_root ) ? create_proc_read_entry( name, 0, | 542 | return (proc_info_root) ? create_proc_read_entry(name, 0, |
582 | proc_info_root, | 543 | proc_info_root, |
583 | func, NULL ) : NULL; | 544 | func, NULL) : NULL; |
584 | } | 545 | } |
585 | 546 | ||
586 | void reiserfs_proc_unregister_global( const char *name ) | 547 | void reiserfs_proc_unregister_global(const char *name) |
587 | { | 548 | { |
588 | remove_proc_entry( name, proc_info_root ); | 549 | remove_proc_entry(name, proc_info_root); |
589 | } | 550 | } |
590 | 551 | ||
591 | int reiserfs_proc_info_global_init( void ) | 552 | int reiserfs_proc_info_global_init(void) |
592 | { | 553 | { |
593 | if( proc_info_root == NULL ) { | 554 | if (proc_info_root == NULL) { |
594 | proc_info_root = proc_mkdir(proc_info_root_name, NULL); | 555 | proc_info_root = proc_mkdir(proc_info_root_name, NULL); |
595 | if( proc_info_root ) { | 556 | if (proc_info_root) { |
596 | proc_info_root -> owner = THIS_MODULE; | 557 | proc_info_root->owner = THIS_MODULE; |
597 | } else { | 558 | } else { |
598 | reiserfs_warning (NULL, | 559 | reiserfs_warning(NULL, |
599 | "reiserfs: cannot create /proc/%s", | 560 | "reiserfs: cannot create /proc/%s", |
600 | proc_info_root_name ); | 561 | proc_info_root_name); |
601 | return 1; | 562 | return 1; |
602 | } | 563 | } |
603 | } | 564 | } |
604 | return 0; | 565 | return 0; |
605 | } | 566 | } |
606 | 567 | ||
607 | int reiserfs_proc_info_global_done( void ) | 568 | int reiserfs_proc_info_global_done(void) |
608 | { | 569 | { |
609 | if ( proc_info_root != NULL ) { | 570 | if (proc_info_root != NULL) { |
610 | proc_info_root = NULL; | 571 | proc_info_root = NULL; |
611 | remove_proc_entry(proc_info_root_name, NULL); | 572 | remove_proc_entry(proc_info_root_name, NULL); |
612 | } | 573 | } |
@@ -616,22 +577,40 @@ int reiserfs_proc_info_global_done( void ) | |||
616 | /* REISERFS_PROC_INFO */ | 577 | /* REISERFS_PROC_INFO */ |
617 | #else | 578 | #else |
618 | 579 | ||
619 | int reiserfs_proc_info_init( struct super_block *sb ) { return 0; } | 580 | int reiserfs_proc_info_init(struct super_block *sb) |
620 | int reiserfs_proc_info_done( struct super_block *sb ) { return 0; } | 581 | { |
582 | return 0; | ||
583 | } | ||
584 | int reiserfs_proc_info_done(struct super_block *sb) | ||
585 | { | ||
586 | return 0; | ||
587 | } | ||
621 | 588 | ||
622 | struct proc_dir_entry *reiserfs_proc_register_global( char *name, | 589 | struct proc_dir_entry *reiserfs_proc_register_global(char *name, |
623 | read_proc_t *func ) | 590 | read_proc_t * func) |
624 | { return NULL; } | 591 | { |
592 | return NULL; | ||
593 | } | ||
625 | 594 | ||
626 | void reiserfs_proc_unregister_global( const char *name ) {;} | 595 | void reiserfs_proc_unregister_global(const char *name) |
596 | {; | ||
597 | } | ||
627 | 598 | ||
628 | int reiserfs_proc_info_global_init( void ) { return 0; } | 599 | int reiserfs_proc_info_global_init(void) |
629 | int reiserfs_proc_info_global_done( void ) { return 0; } | 600 | { |
601 | return 0; | ||
602 | } | ||
603 | int reiserfs_proc_info_global_done(void) | ||
604 | { | ||
605 | return 0; | ||
606 | } | ||
630 | 607 | ||
631 | int reiserfs_global_version_in_proc( char *buffer, char **start, | 608 | int reiserfs_global_version_in_proc(char *buffer, char **start, |
632 | off_t offset, | 609 | off_t offset, |
633 | int count, int *eof, void *data ) | 610 | int count, int *eof, void *data) |
634 | { return 0; } | 611 | { |
612 | return 0; | ||
613 | } | ||
635 | 614 | ||
636 | /* REISERFS_PROC_INFO */ | 615 | /* REISERFS_PROC_INFO */ |
637 | #endif | 616 | #endif |