Commit 845602f8 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] prepare for 32-bit dev_t: reiserfs/procfs.c

	fs/reiserfs/procfs.c made sane.  It used to store dev_t of filesystem
in the proc_dir_entry->data (which is void *) and played very odd games after
that.
	Switched to seq_file, stores pointer to superblock, uses sget() to
validate it, avoids use of dev_t completely.
parent 0873a5d6
This diff is collapsed.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/vfs.h> #include <linux/vfs.h>
static struct file_system_type reiserfs_fs_type; struct file_system_type reiserfs_fs_type;
const char reiserfs_3_5_magic_string[] = REISERFS_SUPER_MAGIC_STRING; const char reiserfs_3_5_magic_string[] = REISERFS_SUPER_MAGIC_STRING;
const char reiserfs_3_6_magic_string[] = REISER2FS_SUPER_MAGIC_STRING; const char reiserfs_3_6_magic_string[] = REISER2FS_SUPER_MAGIC_STRING;
...@@ -56,11 +56,6 @@ static int is_any_reiserfs_magic_string (struct reiserfs_super_block * rs) ...@@ -56,11 +56,6 @@ static int is_any_reiserfs_magic_string (struct reiserfs_super_block * rs)
is_reiserfs_jr (rs)); is_reiserfs_jr (rs));
} }
int is_reiserfs_super (struct super_block *s)
{
return s -> s_type == & reiserfs_fs_type ;
}
static int reiserfs_remount (struct super_block * s, int * flags, char * data); static int reiserfs_remount (struct super_block * s, int * flags, char * data);
static int reiserfs_statfs (struct super_block * s, struct kstatfs * buf); static int reiserfs_statfs (struct super_block * s, struct kstatfs * buf);
...@@ -391,13 +386,6 @@ static void reiserfs_put_super (struct super_block * s) ...@@ -391,13 +386,6 @@ static void reiserfs_put_super (struct super_block * s)
REISERFS_SB(s)->reserved_blocks); REISERFS_SB(s)->reserved_blocks);
} }
reiserfs_proc_unregister( s, "journal" );
reiserfs_proc_unregister( s, "oidmap" );
reiserfs_proc_unregister( s, "on-disk-super" );
reiserfs_proc_unregister( s, "bitmap" );
reiserfs_proc_unregister( s, "per-level" );
reiserfs_proc_unregister( s, "super" );
reiserfs_proc_unregister( s, "version" );
reiserfs_proc_info_done( s ); reiserfs_proc_info_done( s );
kfree(s->s_fs_info); kfree(s->s_fs_info);
...@@ -1389,13 +1377,7 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent) ...@@ -1389,13 +1377,7 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
handle_attrs( s ); handle_attrs( s );
reiserfs_proc_info_init( s ); reiserfs_proc_info_init( s );
reiserfs_proc_register( s, "version", reiserfs_version_in_proc );
reiserfs_proc_register( s, "super", reiserfs_super_in_proc );
reiserfs_proc_register( s, "per-level", reiserfs_per_level_in_proc );
reiserfs_proc_register( s, "bitmap", reiserfs_bitmap_in_proc );
reiserfs_proc_register( s, "on-disk-super", reiserfs_on_disk_super_in_proc );
reiserfs_proc_register( s, "oidmap", reiserfs_oidmap_in_proc );
reiserfs_proc_register( s, "journal", reiserfs_journal_in_proc );
init_waitqueue_head (&(sbi->s_wait)); init_waitqueue_head (&(sbi->s_wait));
sbi->bitmap_lock = SPIN_LOCK_UNLOCKED; sbi->bitmap_lock = SPIN_LOCK_UNLOCKED;
...@@ -1480,7 +1462,7 @@ exit_reiserfs_fs ( void ) ...@@ -1480,7 +1462,7 @@ exit_reiserfs_fs ( void )
destroy_inodecache (); destroy_inodecache ();
} }
static struct file_system_type reiserfs_fs_type = { struct file_system_type reiserfs_fs_type = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "reiserfs", .name = "reiserfs",
.get_sb = get_super_block, .get_sb = get_super_block,
......
...@@ -1931,32 +1931,13 @@ struct dentry *reiserfs_get_parent(struct dentry *) ; ...@@ -1931,32 +1931,13 @@ struct dentry *reiserfs_get_parent(struct dentry *) ;
int reiserfs_proc_info_init( struct super_block *sb ); int reiserfs_proc_info_init( struct super_block *sb );
int reiserfs_proc_info_done( struct super_block *sb ); int reiserfs_proc_info_done( struct super_block *sb );
struct proc_dir_entry *reiserfs_proc_register( struct super_block *sb,
char *name, read_proc_t *func );
void reiserfs_proc_unregister( struct super_block *sb, const char *name );
struct proc_dir_entry *reiserfs_proc_register_global( char *name, struct proc_dir_entry *reiserfs_proc_register_global( char *name,
read_proc_t *func ); read_proc_t *func );
void reiserfs_proc_unregister_global( const char *name ); void reiserfs_proc_unregister_global( const char *name );
int reiserfs_proc_info_global_init( void ); int reiserfs_proc_info_global_init( void );
int reiserfs_proc_info_global_done( void ); int reiserfs_proc_info_global_done( void );
int reiserfs_proc_tail( int len, char *buffer, char **start,
off_t offset, int count, int *eof );
int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset, int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data ); int count, int *eof, void *data );
int reiserfs_version_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
int reiserfs_super_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
int reiserfs_per_level_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
int reiserfs_bitmap_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
int reiserfs_on_disk_super_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
int reiserfs_oidmap_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
int reiserfs_journal_in_proc( char *buffer, char **start, off_t offset,
int count, int *eof, void *data );
#if defined( REISERFS_PROC_INFO ) #if defined( REISERFS_PROC_INFO )
......
...@@ -468,7 +468,7 @@ struct reiserfs_sb_info ...@@ -468,7 +468,7 @@ struct reiserfs_sb_info
void reiserfs_file_buffer (struct buffer_head * bh, int list); void reiserfs_file_buffer (struct buffer_head * bh, int list);
int is_reiserfs_super(struct super_block *s) ; extern struct file_system_type reiserfs_fs_type;
int journal_mark_dirty(struct reiserfs_transaction_handle *, struct super_block *, struct buffer_head *bh) ; int journal_mark_dirty(struct reiserfs_transaction_handle *, struct super_block *, struct buffer_head *bh) ;
int flush_old_commits(struct super_block *s, int) ; int flush_old_commits(struct super_block *s, int) ;
int show_reiserfs_locks(void) ; int show_reiserfs_locks(void) ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment