11 #include <linux/module.h>
12 #include <linux/time.h>
14 #include <asm/uaccess.h>
30 if (REISERFS_SB(sb)->s_properties & (1 <<
REISERFS_3_6)) {
32 }
else if (REISERFS_SB(sb)->s_properties & (1 <<
REISERFS_3_5)) {
38 seq_printf(m,
"%s format\twith checks %s\n", format,
39 #
if defined( CONFIG_REISERFS_CHECK )
48 #define SF( x ) ( r -> x )
49 #define SFP( x ) SF( s_proc_info_data.x )
50 #define SFPL( x ) SFP( x[ level ] )
51 #define SFPF( x ) SFP( scan_bitmap.x )
52 #define SFPJ( x ) SFP( journal.x )
54 #define D2C( x ) le16_to_cpu( x )
55 #define D4C( x ) le32_to_cpu( x )
56 #define DF( x ) D2C( rs -> s_v1.x )
57 #define DFL( x ) D4C( rs -> s_v1.x )
59 #define objectid_map( s, rs ) (old_format_only (s) ? \
60 (__le32 *)((struct reiserfs_super_block_v1 *)rs + 1) : \
62 #define MAP( i ) D4C( objectid_map( sb, rs )[ i ] )
64 #define DJF( x ) le32_to_cpu( rs -> x )
65 #define DJV( x ) le32_to_cpu( s_v1 -> x )
66 #define DJP( x ) le32_to_cpu( jp -> x )
67 #define JF( x ) ( r -> s_journal -> x )
74 "mount options: \t%s%s%s%s%s%s%s%s%s%s%s\n"
75 "gen. counter: \t%i\n"
76 "s_disk_reads: \t%i\n"
77 "s_disk_writes: \t%i\n"
79 "s_do_balance: \t%i\n"
80 "s_unneeded_left_neighbor: \t%i\n"
81 "s_good_search_by_key_reada: \t%i\n"
83 "s_bmaps_without_search: \t%i\n"
84 "s_direct2indirect: \t%i\n"
85 "s_indirect2direct: \t%i\n"
87 "max_hash_collisions: \t%i\n"
89 "bread_misses: \t%lu\n"
90 "search_by_key: \t%lu\n"
91 "search_by_key_fs_changed: \t%lu\n"
92 "search_by_key_restarted: \t%lu\n"
93 "insert_item_restarted: \t%lu\n"
94 "paste_into_item_restarted: \t%lu\n"
95 "cut_from_item_restarted: \t%lu\n"
96 "delete_solid_item_restarted: \t%lu\n"
97 "delete_item_restarted: \t%lu\n"
99 "leaves_removable: \t%lu\n",
101 "REISERFS_VALID_FS" :
"REISERFS_ERROR_FS",
108 "NO_UNHASHED_RELOCATION " :
"",
112 "SMALL_TAILS " :
"NO_TAILS ",
122 SFP(search_by_key_fs_changed),
SFP(search_by_key_restarted),
123 SFP(insert_item_restarted),
SFP(paste_into_item_restarted),
124 SFP(cut_from_item_restarted),
125 SFP(delete_solid_item_restarted),
SFP(delete_item_restarted),
126 SFP(leaked_oid),
SFP(leaves_removable));
149 " get_neig_res" " need_l_neig" " need_r_neig" "\n");
172 SFPL(sbk_fs_changed),
176 SFPL(can_node_be_removed),
182 SFPL(get_neighbors_restart),
183 SFPL(need_l_neighbor),
SFPL(need_r_neighbor)
216 SFPF(in_journal_hint),
SFPF(in_journal_nohint));
229 "free_blocks: \t%i\n"
232 "oid_maxsize: \t%i\n"
233 "oid_cursize: \t%i\n"
234 "umount_state: \t%i\n"
238 "tree_height: \t%i\n"
242 "reserved_for_journal: \t%i\n",
254 (hash_code ==
R5_HASH) ?
"r5" :
255 (hash_code ==
UNSET_HASH) ?
"unset" :
"unknown",
269 unsigned long total_used = 0;
272 for (i = 0; i < mapsize; ++
i) {
277 (i & 1) ?
"free" :
"used",
MAP(i), right);
279 total_used += right -
MAP(i);
282 #if defined( REISERFS_USE_OIDMAPF )
283 if (sb_info->oidmap.use_file && (sb_info->oidmap.mapf !=
NULL)) {
284 loff_t
size = sb_info->oidmap.mapf->f_path.dentry->d_inode->i_size;
285 total_used += size /
sizeof(reiserfs_oidinterval_d_t);
288 seq_printf(m,
"total: \t%i [%i/%i] used: %lu [exact]\n",
302 "jp_journal_1st_block: \t%i\n"
303 "jp_journal_dev: \t%s[%x]\n"
304 "jp_journal_size: \t%i\n"
305 "jp_journal_trans_max: \t%i\n"
306 "jp_journal_magic: \t%i\n"
307 "jp_journal_max_batch: \t%i\n"
308 "jp_journal_max_commit_age: \t%i\n"
309 "jp_journal_max_trans_age: \t%i\n"
311 "j_1st_reserved_block: \t%i\n"
314 "j_mount_id: \t%lu\n"
317 "j_len_alloc: \t%lu\n"
320 "j_first_unflushed_offset: \t%lu\n"
321 "j_last_flush_trans_id: \t%u\n"
322 "j_trans_start_time: \t%li\n"
323 "j_list_bitmap_index: \t%i\n"
324 "j_must_wait: \t%i\n"
325 "j_next_full_flush: \t%i\n"
326 "j_next_async_flush: \t%i\n"
327 "j_cnode_used: \t%i\n" "j_cnode_free: \t%i\n" "\n"
329 "in_journal: \t%12lu\n"
330 "in_journal_bitmap: \t%12lu\n"
331 "in_journal_reusable: \t%12lu\n"
332 "lock_journal: \t%12lu\n"
333 "lock_journal_wait: \t%12lu\n"
334 "journal_begin: \t%12lu\n"
335 "journal_relock_writers: \t%12lu\n"
336 "journal_relock_wcount: \t%12lu\n"
337 "mark_dirty: \t%12lu\n"
338 "mark_dirty_already: \t%12lu\n"
339 "mark_dirty_notjournal: \t%12lu\n"
340 "restore_prepared: \t%12lu\n"
342 "prepare_retry: \t%12lu\n",
352 JF(j_1st_reserved_block),
361 JF(j_first_unflushed_offset),
362 JF(j_last_flush_trans_id),
363 JF(j_trans_start_time),
364 JF(j_list_bitmap_index),
366 JF(j_next_full_flush),
367 JF(j_next_async_flush),
371 SFPJ(in_journal_bitmap),
372 SFPJ(in_journal_reusable),
374 SFPJ(lock_journal_wait),
376 SFPJ(journal_relock_writers),
377 SFPJ(journal_relock_wcount),
379 SFPJ(mark_dirty_already),
380 SFPJ(mark_dirty_notjournal),
381 SFPJ(restore_prepared),
SFPJ(prepare),
SFPJ(prepare_retry)
397 static void *r_start(
struct seq_file *m, loff_t *
pos)
413 static void *r_next(
struct seq_file *m,
void *
v, loff_t * pos)
421 static void r_stop(
struct seq_file *m,
void *v)
427 static int r_show(
struct seq_file *m,
void *v)
461 static const char proc_info_root_name[] =
"fs/reiserfs";
467 &r_file_operations,
func);
482 REISERFS_SB(sb)->procdir =
proc_mkdir(b, proc_info_root);
483 if (REISERFS_SB(sb)->procdir) {
484 REISERFS_SB(sb)->procdir->data =
sb;
485 add_file(sb,
"version", show_version);
486 add_file(sb,
"super", show_super);
487 add_file(sb,
"per-level", show_per_level);
488 add_file(sb,
"bitmap", show_bitmap);
489 add_file(sb,
"on-disk-super", show_on_disk_super);
490 add_file(sb,
"oidmap", show_oidmap);
491 add_file(sb,
"journal", show_journal);
495 proc_info_root_name, b);
520 spin_lock(&__PINFO(sb).
lock);
521 __PINFO(sb).exiting = 1;
522 spin_unlock(&__PINFO(sb).lock);
523 if (proc_info_root) {
525 REISERFS_SB(sb)->procdir =
NULL;
532 if (proc_info_root ==
NULL) {
534 if (!proc_info_root) {
536 proc_info_root_name);
545 if (proc_info_root !=
NULL) {
546 proc_info_root =
NULL;