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