Commit 73949261 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (4/8) ->get_sb() switchover

convert procfs to ->get_sb().  Similar to ext2, except that we use
get_sb_single() instead of get_sb_bdev().  Notice the we _don't_ keep
FS_SINGLE in flags - as the matter of fact, with ->get_sb() FS_SINGLE is
useless. 
parent 165d5003
...@@ -213,8 +213,7 @@ printk("proc_iget: using deleted entry %s, count=%d\n", de->name, atomic_read(&d ...@@ -213,8 +213,7 @@ printk("proc_iget: using deleted entry %s, count=%d\n", de->name, atomic_read(&d
goto out; goto out;
} }
struct super_block *proc_read_super(struct super_block *s,void *data, int proc_fill_super(struct super_block *s, void *data, int silent)
int silent)
{ {
struct inode * root_inode; struct inode * root_inode;
struct task_struct *p; struct task_struct *p;
...@@ -237,11 +236,11 @@ struct super_block *proc_read_super(struct super_block *s,void *data, ...@@ -237,11 +236,11 @@ struct super_block *proc_read_super(struct super_block *s,void *data,
if (!s->s_root) if (!s->s_root)
goto out_no_root; goto out_no_root;
parse_options(data, &root_inode->i_uid, &root_inode->i_gid); parse_options(data, &root_inode->i_uid, &root_inode->i_gid);
return s; return 0;
out_no_root: out_no_root:
printk("proc_read_super: get root inode failed\n"); printk("proc_read_super: get root inode failed\n");
iput(root_inode); iput(root_inode);
return NULL; return -ENOMEM;
} }
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -23,7 +23,16 @@ struct proc_dir_entry *proc_net, *proc_bus, *proc_root_fs, *proc_root_driver; ...@@ -23,7 +23,16 @@ struct proc_dir_entry *proc_net, *proc_bus, *proc_root_fs, *proc_root_driver;
struct proc_dir_entry *proc_sys_root; struct proc_dir_entry *proc_sys_root;
#endif #endif
static DECLARE_FSTYPE(proc_fs_type, "proc", proc_read_super, FS_SINGLE); static struct super_block *proc_get_sb(struct file_system_type *fs_type,
int flags, char *dev_name, void *data)
{
return get_sb_single(fs_type, flags, data, proc_fill_super);
}
static struct file_system_type proc_fs_type = {
name: "proc",
get_sb: proc_get_sb,
};
extern int __init proc_init_inodecache(void); extern int __init proc_init_inodecache(void);
void __init proc_root_init(void) void __init proc_root_init(void)
......
...@@ -97,7 +97,7 @@ extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, ...@@ -97,7 +97,7 @@ extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
extern struct vfsmount *proc_mnt; extern struct vfsmount *proc_mnt;
extern struct super_block *proc_read_super(struct super_block *,void *,int); extern int proc_fill_super(struct super_block *,void *,int);
extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *); extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *);
extern int proc_match(int, const char *,struct proc_dir_entry *); extern int proc_match(int, const char *,struct proc_dir_entry *);
......
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