From 8624512aa908741ba2795200133eae0d7f4557ea Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 2 Mar 2000 02:36:47 +0000 Subject: Merge with 2.3.48. --- fs/proc/proc_misc.c | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'fs/proc/proc_misc.c') diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 3ad4bfabf..1f7ba6b99 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -598,28 +598,11 @@ static struct file_operations proc_profile_operations = { write: write_profile, }; -static struct inode_operations proc_profile_inode_operations = { - &proc_profile_operations, -}; - -static struct proc_dir_entry proc_root_kmsg = { - 0, 4, "kmsg", - S_IFREG | S_IRUSR, 1, 0, 0, - 0, &proc_kmsg_inode_operations -}; -struct proc_dir_entry proc_root_kcore = { - 0, 5, "kcore", - S_IFREG | S_IRUSR, 1, 0, 0, - 0, &proc_kcore_inode_operations -}; -static struct proc_dir_entry proc_root_profile = { - 0, 7, "profile", - S_IFREG | S_IRUGO | S_IWUSR, 1, 0, 0, - 0, &proc_profile_inode_operations -}; +struct proc_dir_entry *proc_root_kcore; void __init proc_misc_init(void) { + struct proc_dir_entry *entry; static struct { char *name; int (*read_proc)(char*,char**,off_t,int,int*,void*); @@ -665,11 +648,25 @@ void __init proc_misc_init(void) create_proc_read_entry(p->name, 0, NULL, p->read_proc, NULL); /* And now for trickier ones */ - proc_register(&proc_root, &proc_root_kmsg); - proc_register(&proc_root, &proc_root_kcore); - proc_root_kcore.size = (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; + entry = create_proc_entry("kmsg", S_IRUSR, &proc_root); + if (entry) + entry->proc_fops = &proc_kmsg_operations; + proc_root_kcore = create_proc_entry("kcore", S_IRUSR, NULL); + if (proc_root_kcore) { + proc_root_kcore->proc_fops = &proc_kcore_operations; + proc_root_kcore->size = + (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; + } if (prof_shift) { - proc_register(&proc_root, &proc_root_profile); - proc_root_profile.size = (1+prof_len) * sizeof(unsigned int); + entry = create_proc_entry("profile", S_IWUSR | S_IRUGO, NULL); + if (entry) { + entry->proc_fops = &proc_profile_operations; + entry->size = (1+prof_len) * sizeof(unsigned int); + } } +#ifdef __powerpc__ + entry = create_proc_entry("ppc_htab", S_IRUGO|S_IWUSR, NULL); + if (entry) + entry->proc_fops = &ppc_htab_operations; +#endif } -- cgit v1.2.3