clean
[linux-2.4.21-pre4.git] / fs / reiserfs / procfs.c
1 /* -*- linux-c -*- */
2 /* fs/reiserfs/procfs.c */
3 /*
4  * Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
5  */
6
7 /* proc info support a la one created by Sizif@Botik.RU for PGC */
8
9 /* $Id: procfs.c,v 1.1.1.1 2005/04/11 02:50:50 jack Exp $ */
10
11 #include <linux/config.h>
12 #include <linux/module.h>
13 #include <linux/sched.h>
14 #include <asm/uaccess.h>
15 #include <linux/reiserfs_fs.h>
16 #include <linux/reiserfs_fs_sb.h>
17 #include <linux/smp_lock.h>
18 #include <linux/locks.h>
19 #include <linux/init.h>
20 #include <linux/proc_fs.h>
21
22 #if defined( REISERFS_PROC_INFO )
23
24 /*
25  * LOCKING:
26  *
27  * We rely on new Alexander Viro's super-block locking.
28  *
29  */
30
31 static struct super_block *procinfo_prologue( kdev_t dev )
32 {
33         struct super_block *result;
34
35         /* get super-block by device */
36         result = get_super( dev );
37         if( result != NULL ) {
38                 if( !reiserfs_is_super( result ) ) {
39                         printk( KERN_DEBUG "reiserfs: procfs-52: "
40                                 "non-reiserfs super found\n" );
41                         drop_super( result );
42                         result = NULL;
43                 }
44         } else
45                 printk( KERN_DEBUG "reiserfs: procfs-74: "
46                         "race between procinfo and umount\n" );
47         return result;
48 }
49
50 int procinfo_epilogue( struct super_block *super )
51 {
52         drop_super( super );
53         return 0;
54 }
55
56 int reiserfs_proc_tail( int len, char *buffer, char **start, 
57                         off_t offset, int count, int *eof )
58 {
59         /* this is black procfs magic */
60         if( offset >= len ) {
61                 *start = buffer;
62                 *eof = 1;
63                 return 0;
64         }
65         *start = buffer + offset;
66         if( ( len -= offset ) > count ) {
67                 return count;
68         }
69         *eof = 1;
70         return len;
71 }
72
73 int reiserfs_version_in_proc( char *buffer, char **start, off_t offset,
74                               int count, int *eof, void *data )
75 {
76         int len = 0;
77         struct super_block *sb;
78         char *format;
79     
80         sb = procinfo_prologue( ( kdev_t ) ( long ) data );
81         if( sb == NULL )
82                 return -ENOENT;
83         if ( sb->u.reiserfs_sb.s_properties & (1 << REISERFS_3_6) ) {
84                 format = "3.6";
85         } else if ( sb->u.reiserfs_sb.s_properties & (1 << REISERFS_3_5) ) {
86                 format = "3.5";
87         } else {
88                 format = "unknown";
89         }
90         len += sprintf( &buffer[ len ], "%s format\twith checks %s\n",
91                         format,
92 #if defined( CONFIG_REISERFS_CHECK )
93                         "on"
94 #else
95                         "off"
96 #endif
97                 );
98         procinfo_epilogue( sb );
99         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
100 }
101
102 int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset,
103                                      int count, int *eof, void *data )
104 {
105         int len = 0;
106     
107         len += sprintf( &buffer[ len ], "%s [%s]\n", 
108                         reiserfs_get_version_string(),
109 #if defined( CONFIG_REISERFS_FS_MODULE )
110                         "as module"
111 #else
112                         "built into kernel"
113 #endif
114                         );
115         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
116 }
117
118 #define SF( x ) ( r -> x )
119 #define SFP( x ) SF( s_proc_info_data.x )
120 #define SFPL( x ) SFP( x[ level ] )
121 #define SFPF( x ) SFP( scan_bitmap.x )
122 #define SFPJ( x ) SFP( journal.x )
123
124 #define D2C( x ) le16_to_cpu( x )
125 #define D4C( x ) le32_to_cpu( x )
126 #define DF( x ) D2C( rs -> x )
127 #define DFL( x ) D4C( rs -> x )
128
129 #define objectid_map( s, rs ) (old_format_only (s) ?                            \
130                          (__u32 *)((struct reiserfs_super_block_v1 *)rs + 1) :  \
131                          (__u32 *)(rs + 1))
132 #define MAP( i ) D4C( objectid_map( sb, rs )[ i ] )
133
134 #define DJF( x ) le32_to_cpu( rs -> x )
135 #define JF( x ) ( r -> s_journal -> x )
136
137 int reiserfs_super_in_proc( char *buffer, char **start, off_t offset,
138                             int count, int *eof, void *data )
139 {
140         struct super_block *sb;
141         struct reiserfs_sb_info *r;
142         int len = 0;
143     
144         sb = procinfo_prologue( ( kdev_t ) ( long ) data );
145         if( sb == NULL )
146                 return -ENOENT;
147         r = &sb->u.reiserfs_sb;
148         len += sprintf( &buffer[ len ], 
149                         "state: \t%s\n"
150                         "mount options: \t%s%s%s%s%s%s%s%s%s%s%s%s\n"
151                         "gen. counter: \t%i\n"
152                         "s_kmallocs: \t%i\n"
153                         "s_disk_reads: \t%i\n"
154                         "s_disk_writes: \t%i\n"
155                         "s_fix_nodes: \t%i\n"
156                         "s_do_balance: \t%i\n"
157                         "s_unneeded_left_neighbor: \t%i\n"
158                         "s_good_search_by_key_reada: \t%i\n"
159                         "s_bmaps: \t%i\n"
160                         "s_bmaps_without_search: \t%i\n"
161                         "s_direct2indirect: \t%i\n"
162                         "s_indirect2direct: \t%i\n"
163                         "\n"
164                         "max_hash_collisions: \t%i\n"
165
166                         "breads: \t%lu\n"
167                         "bread_misses: \t%lu\n"
168
169                         "search_by_key: \t%lu\n"
170                         "search_by_key_fs_changed: \t%lu\n"
171                         "search_by_key_restarted: \t%lu\n"
172                         
173                         "insert_item_restarted: \t%lu\n"
174                         "paste_into_item_restarted: \t%lu\n"
175                         "cut_from_item_restarted: \t%lu\n"
176                         "delete_solid_item_restarted: \t%lu\n"
177                         "delete_item_restarted: \t%lu\n"
178
179                         "leaked_oid: \t%lu\n"
180                         "leaves_removable: \t%lu\n",
181
182                         SF( s_mount_state ) == REISERFS_VALID_FS ?
183                         "REISERFS_VALID_FS" : "REISERFS_ERROR_FS",
184                         reiserfs_r5_hash( sb ) ? "FORCE_R5 " : "",
185                         reiserfs_rupasov_hash( sb ) ? "FORCE_RUPASOV " : "",
186                         reiserfs_tea_hash( sb ) ? "FORCE_TEA " : "",
187                         reiserfs_hash_detect( sb ) ? "DETECT_HASH " : "",
188                         reiserfs_no_border( sb ) ? "NO_BORDER " : "BORDER ",
189                         reiserfs_no_unhashed_relocation( sb ) ? "NO_UNHASHED_RELOCATION " : "",
190                         reiserfs_hashed_relocation( sb ) ? "UNHASHED_RELOCATION " : "",
191                         reiserfs_test4( sb ) ? "TEST4 " : "",
192                         have_large_tails( sb ) ? "TAILS " : have_small_tails(sb)?"SMALL_TAILS ":"NO_TAILS ",
193                         replay_only( sb ) ? "REPLAY_ONLY " : "",
194                         reiserfs_dont_log( sb ) ? "DONT_LOG " : "LOG ",
195                         convert_reiserfs( sb ) ? "CONV " : "",
196
197                         atomic_read( &r -> s_generation_counter ),
198                         SF( s_kmallocs ),
199                         SF( s_disk_reads ),
200                         SF( s_disk_writes ),
201                         SF( s_fix_nodes ),
202                         SF( s_do_balance ),
203                         SF( s_unneeded_left_neighbor ),
204                         SF( s_good_search_by_key_reada ),
205                         SF( s_bmaps ),
206                         SF( s_bmaps_without_search ),
207                         SF( s_direct2indirect ),
208                         SF( s_indirect2direct ),
209                         SFP( max_hash_collisions ),
210                         SFP( breads ),
211                         SFP( bread_miss ),
212                         SFP( search_by_key ),
213                         SFP( search_by_key_fs_changed ),
214                         SFP( search_by_key_restarted ),
215
216                         SFP( insert_item_restarted ),
217                         SFP( paste_into_item_restarted ),
218                         SFP( cut_from_item_restarted ),
219                         SFP( delete_solid_item_restarted ),
220                         SFP( delete_item_restarted ),
221
222                         SFP( leaked_oid ),
223                         SFP( leaves_removable ) );
224
225         procinfo_epilogue( sb );
226         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
227 }
228
229 int reiserfs_per_level_in_proc( char *buffer, char **start, off_t offset,
230                                 int count, int *eof, void *data )
231 {
232         struct super_block *sb;
233         struct reiserfs_sb_info *r;
234         int len = 0;
235         int level;
236         
237         sb = procinfo_prologue( ( kdev_t ) ( long ) data );
238         if( sb == NULL )
239                 return -ENOENT;
240         r = &sb->u.reiserfs_sb;
241
242         len += sprintf( &buffer[ len ],
243                         "level\t"
244                         "     balances"
245                         " [sbk:  reads"
246                         "   fs_changed"
247                         "   restarted]"
248                         "   free space"
249                         "        items"
250                         "   can_remove"
251                         "         lnum"
252                         "         rnum"
253                         "       lbytes"
254                         "       rbytes"
255                         "     get_neig"
256                         " get_neig_res"
257                         "  need_l_neig"
258                         "  need_r_neig"
259                         "\n"
260                         
261                 );
262
263         for( level = 0 ; level < MAX_HEIGHT ; ++ level ) {
264                 if( len > PAGE_SIZE - 240 ) {
265                         len += sprintf( &buffer[ len ], "... and more\n" );
266                         break;
267                 }
268                 len += sprintf( &buffer[ len ], 
269                                 "%i\t"
270                                 " %12lu"
271                                 " %12lu"
272                                 " %12lu"
273                                 " %12lu"
274                                 " %12lu"
275                                 " %12lu"
276                                 " %12lu"
277                                 " %12li"
278                                 " %12li"
279                                 " %12li"
280                                 " %12li"
281                                 " %12lu"
282                                 " %12lu"
283                                 " %12lu"
284                                 " %12lu"
285                                 "\n",
286                                 level, 
287                                 SFPL( balance_at ),
288                                 SFPL( sbk_read_at ),
289                                 SFPL( sbk_fs_changed ),
290                                 SFPL( sbk_restarted ),
291                                 SFPL( free_at ),
292                                 SFPL( items_at ),
293                                 SFPL( can_node_be_removed ),
294                                 SFPL( lnum ),
295                                 SFPL( rnum ),
296                                 SFPL( lbytes ),
297                                 SFPL( rbytes ),
298                                 SFPL( get_neighbors ),
299                                 SFPL( get_neighbors_restart ),
300                                 SFPL( need_l_neighbor ),
301                                 SFPL( need_r_neighbor )
302                         );
303         }
304
305         procinfo_epilogue( sb );
306         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
307 }
308
309 int reiserfs_bitmap_in_proc( char *buffer, char **start, off_t offset,
310                              int count, int *eof, void *data )
311 {
312         struct super_block *sb;
313         struct reiserfs_sb_info *r = &sb->u.reiserfs_sb;
314         int len = 0;
315     
316         sb = procinfo_prologue( ( kdev_t ) ( long ) data );
317         if( sb == NULL )
318                 return -ENOENT;
319         r = &sb->u.reiserfs_sb;
320
321         len += sprintf( &buffer[ len ], "free_block: %lu\n"
322                         "  scan_bitmap:"
323                         "          wait"
324                         "          bmap"
325                         "         retry"
326                         "        stolen"
327                         "  journal_hint"
328                         "journal_nohint"
329                         "\n"
330                         " %14lu"
331                         " %14lu"
332                         " %14lu"
333                         " %14lu"
334                         " %14lu"
335                         " %14lu"
336                         " %14lu"
337                         "\n",
338                         SFP( free_block ),
339                         SFPF( call ), 
340                         SFPF( wait ), 
341                         SFPF( bmap ),
342                         SFPF( retry ),
343                         SFPF( stolen ),
344                         SFPF( in_journal_hint ),
345                         SFPF( in_journal_nohint ) );
346
347         procinfo_epilogue( sb );
348         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
349 }
350
351 int reiserfs_on_disk_super_in_proc( char *buffer, char **start, off_t offset,
352                                     int count, int *eof, void *data )
353 {
354         struct super_block *sb;
355         struct reiserfs_sb_info *sb_info;
356         struct reiserfs_super_block *rs;
357         int hash_code;
358         __u32 flags;
359         int len = 0;
360     
361         sb = procinfo_prologue( ( kdev_t ) ( long ) data );
362         if( sb == NULL )
363                 return -ENOENT;
364         sb_info = &sb->u.reiserfs_sb;
365         rs = sb_info -> s_rs;
366         hash_code = DFL( s_hash_function_code );
367         flags = DFL( s_flags );
368
369         len += sprintf( &buffer[ len ], 
370                         "block_count: \t%i\n"
371                         "free_blocks: \t%i\n"
372                         "root_block: \t%i\n"
373                         "blocksize: \t%i\n"
374                         "oid_maxsize: \t%i\n"
375                         "oid_cursize: \t%i\n"
376                         "state: \t%i\n"
377                         "magic: \t%12.12s\n"
378                         "hash: \t%s\n"
379                         "tree_height: \t%i\n"
380                         "bmap_nr: \t%i\n"
381                         "version: \t%i\n"
382                         "flags: \t%x[%s]\n",
383
384                         DFL( s_block_count ),
385                         DFL( s_free_blocks ),
386                         DFL( s_root_block ),
387                         DF( s_blocksize ),
388                         DF( s_oid_maxsize ),
389                         DF( s_oid_cursize ),
390                         DF( s_state ),
391                         rs -> s_magic,
392                         hash_code == TEA_HASH ? "tea" :
393                         ( hash_code == YURA_HASH ) ? "rupasov" :
394                         ( hash_code == R5_HASH ) ? "r5" :
395                         ( hash_code == UNSET_HASH ) ? "unset" : "unknown",
396                         DF( s_tree_height ),
397                         DF( s_bmap_nr ),
398                         DF( s_version ),
399                         flags, 
400                         ( flags & reiserfs_attrs_cleared ) 
401                         ? "attrs_cleared" : "" );
402
403         procinfo_epilogue( sb );
404         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
405 }
406
407 int reiserfs_oidmap_in_proc( char *buffer, char **start, off_t offset,
408                              int count, int *eof, void *data )
409 {
410         struct super_block *sb;
411         struct reiserfs_sb_info *sb_info;
412         struct reiserfs_super_block *rs;
413         int i;
414         unsigned int mapsize;
415         unsigned long total_used;
416         int len = 0;
417         int exact;
418     
419         sb = procinfo_prologue( ( kdev_t ) ( long ) data );
420         if( sb == NULL )
421                 return -ENOENT;
422         sb_info = &sb->u.reiserfs_sb;
423         rs = sb_info -> s_rs;
424         mapsize = le16_to_cpu( rs -> s_oid_cursize );
425         total_used = 0;
426
427         for( i = 0 ; i < mapsize ; ++i ) {
428                 __u32 right;
429
430                 right = ( i == mapsize - 1 ) ? MAX_KEY_OBJECTID : MAP( i + 1 );
431                 len += sprintf( &buffer[ len ], "%s: [ %x .. %x )\n",
432                                 ( i & 1 ) ? "free" : "used", MAP( i ), right );
433                 if( ! ( i & 1 ) ) {
434                         total_used += right - MAP( i );
435                 }
436                 if( len > PAGE_SIZE - 100 ) {
437                         len += sprintf( &buffer[ len ], "... and more\n" );
438                         break;
439                 }
440         }
441 #if defined( REISERFS_USE_OIDMAPF )
442         if( sb_info -> oidmap.use_file && ( sb_info -> oidmap.mapf != NULL ) ) {
443                 loff_t size;
444
445                 size = sb_info -> oidmap.mapf -> f_dentry -> d_inode -> i_size;
446                 total_used += size / sizeof( reiserfs_oidinterval_d_t );
447                 exact = 1;
448         } else
449 #endif
450         {
451                 exact = ( i == mapsize );
452         }
453         len += sprintf( &buffer[ len ], "total: \t%i [%i/%i] used: %lu [%s]\n", 
454                         i, 
455                         mapsize, le16_to_cpu( rs -> s_oid_maxsize ),
456                         total_used, exact ? "exact" : "estimation" );
457
458         procinfo_epilogue( sb );
459         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
460 }
461
462 int reiserfs_journal_in_proc( char *buffer, char **start, off_t offset,
463                               int count, int *eof, void *data )
464 {
465         struct super_block *sb;
466         struct reiserfs_sb_info *r;
467         struct reiserfs_super_block *rs;
468         int len = 0;
469     
470         sb = procinfo_prologue( ( kdev_t ) ( long ) data );
471         if( sb == NULL )
472                 return -ENOENT;
473         r = &sb->u.reiserfs_sb;
474         rs = r -> s_rs;
475
476         len += sprintf( &buffer[ len ], 
477                         /* on-disk fields */
478                         "s_journal_block: \t%i\n"
479                         "s_journal_dev: \t%s[%x]\n"
480                         "s_orig_journal_size: \t%i\n"
481                         "s_journal_trans_max: \t%i\n"
482                         "s_journal_block_count: \t%i\n"
483                         "s_journal_max_batch: \t%i\n"
484                         "s_journal_max_commit_age: \t%i\n"
485                         "s_journal_max_trans_age: \t%i\n"
486                         /* incore fields */
487                         "j_state: \t%li\n"                      
488                         "j_trans_id: \t%lu\n"
489                         "j_mount_id: \t%lu\n"
490                         "j_start: \t%lu\n"
491                         "j_len: \t%lu\n"
492                         "j_len_alloc: \t%lu\n"
493                         "j_wcount: \t%i\n"
494                         "j_bcount: \t%lu\n"
495                         "j_first_unflushed_offset: \t%lu\n"
496                         "j_last_flush_trans_id: \t%lu\n"
497                         "j_trans_start_time: \t%li\n"
498                         "j_journal_list_index: \t%i\n"
499                         "j_list_bitmap_index: \t%i\n"
500                         "j_must_wait: \t%i\n"
501                         "j_next_full_flush: \t%i\n"
502                         "j_next_async_flush: \t%i\n"
503                         "j_cnode_used: \t%i\n"
504                         "j_cnode_free: \t%i\n"
505                         "\n"
506                         /* reiserfs_proc_info_data_t.journal fields */
507                         "in_journal: \t%12lu\n"
508                         "in_journal_bitmap: \t%12lu\n"
509                         "in_journal_reusable: \t%12lu\n"
510                         "lock_journal: \t%12lu\n"
511                         "lock_journal_wait: \t%12lu\n"
512                         "journal_begin: \t%12lu\n"
513                         "journal_relock_writers: \t%12lu\n"
514                         "journal_relock_wcount: \t%12lu\n"
515                         "mark_dirty: \t%12lu\n"
516                         "mark_dirty_already: \t%12lu\n"
517                         "mark_dirty_notjournal: \t%12lu\n"
518                         "restore_prepared: \t%12lu\n"
519                         "prepare: \t%12lu\n"
520                         "prepare_retry: \t%12lu\n",
521
522                         DJF( s_journal_block ),
523                         DJF( s_journal_dev ) == 0 ? "none" : bdevname( DJF( s_journal_dev ) ), 
524                         DJF( s_journal_dev ),
525                         DJF( s_orig_journal_size ),
526                         DJF( s_journal_trans_max ),
527                         DJF( s_journal_block_count ),
528                         DJF( s_journal_max_batch ),
529                         DJF( s_journal_max_commit_age ),
530                         DJF( s_journal_max_trans_age ),
531                         
532                         JF( j_state ),                  
533                         JF( j_trans_id ),
534                         JF( j_mount_id ),
535                         JF( j_start ),
536                         JF( j_len ),
537                         JF( j_len_alloc ),
538                         atomic_read( & r -> s_journal -> j_wcount ),
539                         JF( j_bcount ),
540                         JF( j_first_unflushed_offset ),
541                         JF( j_last_flush_trans_id ),
542                         JF( j_trans_start_time ),
543                         JF( j_journal_list_index ),
544                         JF( j_list_bitmap_index ),
545                         JF( j_must_wait ),
546                         JF( j_next_full_flush ),
547                         JF( j_next_async_flush ),
548                         JF( j_cnode_used ),
549                         JF( j_cnode_free ),
550
551                         SFPJ( in_journal ),
552                         SFPJ( in_journal_bitmap ),
553                         SFPJ( in_journal_reusable ),
554                         SFPJ( lock_journal ),
555                         SFPJ( lock_journal_wait ),
556                         SFPJ( journal_being ),
557                         SFPJ( journal_relock_writers ),
558                         SFPJ( journal_relock_wcount ),
559                         SFPJ( mark_dirty ),
560                         SFPJ( mark_dirty_already ),
561                         SFPJ( mark_dirty_notjournal ),
562                         SFPJ( restore_prepared ),
563                         SFPJ( prepare ),
564                         SFPJ( prepare_retry )
565                 );
566
567         procinfo_epilogue( sb );
568         return reiserfs_proc_tail( len, buffer, start, offset, count, eof );
569 }
570
571
572 static struct proc_dir_entry *proc_info_root = NULL;
573 static const char *proc_info_root_name = "fs/reiserfs";
574
575 int reiserfs_proc_info_init( struct super_block *sb )
576 {
577         spin_lock_init( & __PINFO( sb ).lock );
578         sb->u.reiserfs_sb.procdir = proc_mkdir( bdevname( sb -> s_dev ), 
579                                                 proc_info_root );
580         if( sb->u.reiserfs_sb.procdir ) {
581                 sb->u.reiserfs_sb.procdir -> owner = THIS_MODULE;
582                 return 0;
583         }
584         reiserfs_warning( "reiserfs: cannot create /proc/%s/%s\n",
585                           proc_info_root_name, bdevname( sb -> s_dev ) );
586         return 1;
587 }
588
589
590 int reiserfs_proc_info_done( struct super_block *sb )
591 {
592         spin_lock( & __PINFO( sb ).lock );
593         __PINFO( sb ).exiting = 1;
594         spin_unlock( & __PINFO( sb ).lock );
595         if ( proc_info_root ) {
596                 remove_proc_entry( bdevname( sb -> s_dev ), proc_info_root );
597                 sb->u.reiserfs_sb.procdir = NULL;
598         }
599         return 0;
600 }
601
602 /* Create /proc/fs/reiserfs/DEV/name and attach read procedure @func
603    to it.  Other parts of reiserfs use this function to make their
604    per-device statistics available via /proc */
605
606 struct proc_dir_entry *reiserfs_proc_register( struct super_block *sb, 
607                                                char *name, read_proc_t *func )
608 {
609         return ( sb->u.reiserfs_sb.procdir ) ? create_proc_read_entry
610                 ( name, 0, sb->u.reiserfs_sb.procdir, func, 
611                   ( void * ) ( long ) sb -> s_dev ) : NULL;
612 }
613
614 void reiserfs_proc_unregister( struct super_block *sb, const char *name )
615 {
616         remove_proc_entry( name, sb->u.reiserfs_sb.procdir );
617 }
618
619 struct proc_dir_entry *reiserfs_proc_register_global( char *name, 
620                                                       read_proc_t *func )
621 {
622         return ( proc_info_root ) ? create_proc_read_entry( name, 0, 
623                                                             proc_info_root, 
624                                                             func, NULL ) : NULL;
625 }
626
627 void reiserfs_proc_unregister_global( const char *name )
628 {
629         remove_proc_entry( name, proc_info_root );
630 }
631
632 int reiserfs_proc_info_global_init( void )
633 {
634         if( proc_info_root == NULL ) {
635                 proc_info_root = proc_mkdir( proc_info_root_name, 0 );
636                 if( proc_info_root ) {
637                         proc_info_root -> owner = THIS_MODULE;
638                 } else {
639                         reiserfs_warning( "reiserfs: cannot create /proc/%s\n",
640                                           proc_info_root_name );
641                         return 1;
642                 }
643         }
644         return 0;
645 }
646
647 int reiserfs_proc_info_global_done( void )
648 {
649         if ( proc_info_root != NULL ) {
650                 proc_info_root = NULL;
651                 remove_proc_entry( proc_info_root_name, 0 );
652         }
653         return 0;
654 }
655
656 /* REISERFS_PROC_INFO */
657 #else
658
659 int reiserfs_proc_info_init( struct super_block *sb ) { return 0; }
660 int reiserfs_proc_info_done( struct super_block *sb ) { return 0; }
661
662 struct proc_dir_entry *reiserfs_proc_register( struct super_block *sb, 
663                                                char *name, 
664                                                read_proc_t *func ) 
665 { return NULL; }
666
667 void reiserfs_proc_unregister( struct super_block *sb, const char *name ) 
668 {;}
669
670 struct proc_dir_entry *reiserfs_proc_register_global( char *name, 
671                                                       read_proc_t *func )
672 { return NULL; }
673
674 void reiserfs_proc_unregister_global( const char *name ) {;}
675
676 int reiserfs_proc_info_global_init( void ) { return 0; }
677 int reiserfs_proc_info_global_done( void ) { return 0; }
678
679 int reiserfs_global_version_in_proc( char *buffer, char **start, 
680                                      off_t offset,
681                                      int count, int *eof, void *data )
682 { return 0; }
683
684 int reiserfs_version_in_proc( char *buffer, char **start, off_t offset,
685                               int count, int *eof, void *data )
686 { return 0; }
687
688 int reiserfs_super_in_proc( char *buffer, char **start, off_t offset,
689                             int count, int *eof, void *data )
690 { return 0; }
691
692 int reiserfs_per_level_in_proc( char *buffer, char **start, off_t offset,
693                                 int count, int *eof, void *data )
694 { return 0; }
695
696 int reiserfs_bitmap_in_proc( char *buffer, char **start, off_t offset,
697                              int count, int *eof, void *data )
698 { return 0; }
699
700 int reiserfs_on_disk_super_in_proc( char *buffer, char **start, off_t offset,
701                                     int count, int *eof, void *data )
702 { return 0; }
703
704 int reiserfs_oidmap_in_proc( char *buffer, char **start, off_t offset,
705                              int count, int *eof, void *data )
706 { return 0; }
707
708 int reiserfs_journal_in_proc( char *buffer, char **start, off_t offset,
709                               int count, int *eof, void *data )
710 { return 0; }
711
712 /* REISERFS_PROC_INFO */
713 #endif
714
715 /*
716  * $Log: procfs.c,v $
717  * Revision 1.1.1.1  2005/04/11 02:50:50  jack
718  * first release
719  *
720  * Revision 1.1.1.1  2005/01/10 13:16:52  jack
721  * First release
722  *
723  * Revision 1.1.8.2  2001/07/15 17:08:42  god
724  *  . use get_super() in procfs.c
725  *  . remove remove_save_link() from reiserfs_do_truncate()
726  *
727  * I accept terms and conditions stated in the Legal Agreement
728  * (available at http://www.namesys.com/legalese.html)
729  *
730  * Revision 1.1.8.1  2001/07/11 16:48:50  god
731  * proc info support
732  *
733  * I accept terms and conditions stated in the Legal Agreement
734  * (available at http://www.namesys.com/legalese.html)
735  *
736  */
737
738 /* 
739  * Make Linus happy.
740  * Local variables:
741  * c-indentation-style: "K&R"
742  * mode-name: "LC"
743  * c-basic-offset: 8
744  * tab-width: 8
745  * End:
746  */