diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
commit | 529c593ece216e4aaffd36bd940cb94f1fa63129 (patch) | |
tree | 78f1c0b805f5656aa7b0417a043c5346f700a2cf /fs/proc | |
parent | 0bd079751d25808d1972baee5c4eaa1db2227257 (diff) |
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/Makefile | 3 | ||||
-rw-r--r-- | fs/proc/array.c | 3 | ||||
-rw-r--r-- | fs/proc/base.c | 44 | ||||
-rw-r--r-- | fs/proc/generic.c | 11 | ||||
-rw-r--r-- | fs/proc/kcore.c | 10 | ||||
-rw-r--r-- | fs/proc/kmsg.c | 15 | ||||
-rw-r--r-- | fs/proc/omirr.c | 279 | ||||
-rw-r--r-- | fs/proc/proc_misc.c | 8 | ||||
-rw-r--r-- | fs/proc/procfs_syms.c | 3 | ||||
-rw-r--r-- | fs/proc/root.c | 5 |
10 files changed, 28 insertions, 353 deletions
diff --git a/fs/proc/Makefile b/fs/proc/Makefile index fade4acf2..ad890255e 100644 --- a/fs/proc/Makefile +++ b/fs/proc/Makefile @@ -10,9 +10,6 @@ O_TARGET := proc.o O_OBJS := inode.o root.o base.o generic.o array.o \ kmsg.o proc_tty.o proc_misc.o kcore.o -ifdef CONFIG_OMIRR -O_OBJS := $(O_OBJS) omirr.o -endif OX_OBJS := procfs_syms.o M_OBJS := diff --git a/fs/proc/array.c b/fs/proc/array.c index 4ae097ca2..65bc80c88 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -133,8 +133,7 @@ static inline const char * get_task_state(struct task_struct *tsk) TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE | TASK_ZOMBIE | - TASK_STOPPED | - TASK_SWAPPING); + TASK_STOPPED); const char **p = &task_state_array[0]; while (state) { diff --git a/fs/proc/base.c b/fs/proc/base.c index 4670b456c..cdd2116b2 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -15,7 +15,6 @@ #include <asm/uaccess.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/proc_fs.h> @@ -206,8 +205,7 @@ static ssize_t pid_maps_read(struct file * file, char * buf, } static struct file_operations proc_maps_operations = { - NULL, /* array_lseek */ - pid_maps_read, + read: pid_maps_read, }; struct inode_operations proc_maps_inode_operations = { @@ -258,8 +256,7 @@ static ssize_t proc_info_read(struct file * file, char * buf, } static struct file_operations proc_info_file_operations = { - NULL, /* lseek */ - proc_info_read, /* read */ + read: proc_info_read, }; static struct inode_operations proc_info_inode_operations = { @@ -348,9 +345,8 @@ static ssize_t mem_write(struct file * file, const char * buf, } static struct file_operations proc_mem_operations = { - NULL, /* lseek - default */ - mem_read, - mem_write, + read: mem_read, + write: mem_write, }; static struct inode_operations proc_mem_inode_operations = { @@ -366,9 +362,6 @@ static struct inode_operations proc_mem_inode_operations = { NULL, /* rename */ NULL, /* readlink */ NULL, /* follow_link */ - NULL, /* get_block */ - NULL, /* readpage */ - NULL, /* writepage */ NULL, /* truncate */ proc_permission, /* permission */ NULL /* revalidate */ @@ -456,18 +449,8 @@ out: } static struct inode_operations proc_pid_link_inode_operations = { - NULL, /* file-operations */ - NULL, /* create */ - NULL, /* lookup */ - NULL, /* link */ - NULL, /* unlink */ - NULL, /* symlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* mknod */ - NULL, /* rename */ - proc_pid_readlink, /* readlink */ - proc_pid_follow_link, /* follow_link */ + readlink: proc_pid_readlink, + follow_link: proc_pid_follow_link }; /* reading from directory - bad */ @@ -761,10 +744,8 @@ out: } static struct file_operations proc_fd_operations = { - NULL, /* lseek - default */ - proc_dir_read, /* read - bad */ - NULL, /* write - bad */ - proc_readfd, /* readdir */ + read: proc_dir_read, /* read - bad */ + readdir: proc_readfd, /* readdir */ }; /* @@ -783,9 +764,6 @@ static struct inode_operations proc_fd_inode_operations = { NULL, /* rename */ NULL, /* readlink */ NULL, /* follow_link */ - NULL, /* get_block */ - NULL, /* readpage */ - NULL, /* writepage */ NULL, /* truncate */ proc_permission, /* permission */ }; @@ -882,10 +860,8 @@ out: } static struct file_operations proc_base_operations = { - NULL, /* lseek - default */ - proc_dir_read, /* read - bad */ - NULL, /* write - bad */ - proc_base_readdir, /* readdir */ + read: proc_dir_read, /* read - bad */ + readdir: proc_base_readdir, /* readdir */ }; static struct inode_operations proc_base_inode_operations = { diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 3017323b2..ad42f4fbc 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -32,9 +32,9 @@ int proc_match(int len, const char *name,struct proc_dir_entry * de) } static struct file_operations proc_file_operations = { - proc_file_lseek, /* lseek */ - proc_file_read, /* read */ - proc_file_write, /* write */ + llseek: proc_file_lseek, + read: proc_file_read, + write: proc_file_write, }; static struct inode_operations proc_file_inode_operations = { @@ -337,10 +337,7 @@ int proc_readdir(struct file * filp, * the /proc directory. */ static struct file_operations proc_dir_operations = { - NULL, /* lseek - default */ - NULL, /* read - bad */ - NULL, /* write - bad */ - proc_readdir, /* readdir */ + readdir: proc_readdir, }; /* diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index f63bcac6e..01ac4fe2a 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -27,14 +27,8 @@ static int open_kcore(struct inode * inode, struct file * filp) static ssize_t read_kcore(struct file *, char *, size_t, loff_t *); static struct file_operations proc_kcore_operations = { - NULL, /* lseek */ - read_kcore, - NULL, /* write */ - NULL, /* readdir */ - NULL, /* poll */ - NULL, /* ioctl */ - NULL, /* mmap */ - open_kcore + read: read_kcore, + open: open_kcore, }; struct inode_operations proc_kcore_inode_operations = { diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c index b9344ba55..a8fe0fc3c 100644 --- a/fs/proc/kmsg.c +++ b/fs/proc/kmsg.c @@ -46,17 +46,10 @@ static unsigned int kmsg_poll(struct file *file, poll_table * wait) static struct file_operations proc_kmsg_operations = { - NULL, /* kmsg_lseek */ - kmsg_read, - NULL, /* kmsg_write */ - NULL, /* kmsg_readdir */ - kmsg_poll, /* kmsg_poll */ - NULL, /* kmsg_ioctl */ - NULL, /* mmap */ - kmsg_open, - NULL, /* flush */ - kmsg_release, - NULL /* can't fsync */ + read: kmsg_read, + poll: kmsg_poll, + open: kmsg_open, + release: kmsg_release, }; struct inode_operations proc_kmsg_inode_operations = { diff --git a/fs/proc/omirr.c b/fs/proc/omirr.c deleted file mode 100644 index bdbcb0cbf..000000000 --- a/fs/proc/omirr.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * fs/proc/omirr.c - online mirror support - * - * (C) 1997 Thomas Schoebel-Theuer - */ - -#include <linux/string.h> -#include <linux/mm.h> -#include <linux/fs.h> -#include <linux/omirr.h> -#include <asm/uaccess.h> - -static int nr_omirr_open = 0; -static int cleared_flag = 0; - -static char * buffer = NULL; -static int read_pos, write_pos; -static int clip_pos, max_pos; -static DECLARE_WAIT_QUEUE_HEAD(read_wait); -static DECLARE_WAIT_QUEUE_HEAD(write_wait); - -static /*inline*/ int reserve_write_space(int len) -{ - int rest = max_pos - write_pos; - - if(rest < len) { - clip_pos = write_pos; - write_pos = 0; - rest = max_pos; - } - while(read_pos > write_pos && read_pos <= write_pos+len) { - if(!nr_omirr_open) - return 0; - interruptible_sleep_on(&write_wait); - } - return 1; -} - -static /*inline*/ void write_space(int len) -{ - write_pos += len; - wake_up_interruptible(&read_wait); -} - -static /*inline*/ int reserve_read_space(int len) -{ - int rest = clip_pos - read_pos; - - if(!rest) { - read_pos = 0; - rest = clip_pos; - clip_pos = max_pos; - } - if(len > rest) - len = rest; - while(read_pos == write_pos) { - interruptible_sleep_on(&read_wait); - } - rest = write_pos - read_pos; - if(rest > 0 && rest < len) - len = rest; - return len; -} - -static /*inline*/ void read_space(int len) -{ - read_pos += len; - if(read_pos >= clip_pos) { - read_pos = 0; - clip_pos = max_pos; - } - wake_up_interruptible(&write_wait); -} - -static /*inline*/ void init_buffer(char * initxt) -{ - int len = initxt ? strlen(initxt) : 0; - - if(!buffer) { - buffer = (char*)__get_free_page(GFP_USER); - max_pos = clip_pos = PAGE_SIZE; - } - read_pos = write_pos = 0; - memcpy(buffer, initxt, len); - write_space(len); -} - -static int omirr_open(struct inode * inode, struct file * file) -{ - if(nr_omirr_open) - return -EAGAIN; - nr_omirr_open++; - if(!buffer) - init_buffer(NULL); - return 0; -} - -static int omirr_release(struct inode * inode, struct file * file) -{ - nr_omirr_open--; - read_space(0); - return 0; -} - -static long omirr_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) -{ - char * tmp; - int len; - int error = 0; - - if(!count) - goto done; - error = -EINVAL; - if(!buf || count < 0) - goto done; - - error = verify_area(VERIFY_WRITE, buf, count); - if(error) - goto done; - - error = -EAGAIN; - if((file->f_flags & O_NONBLOCK) && read_pos == write_pos) - goto done; - - error = len = reserve_read_space(count); - tmp = buffer + read_pos; - while(len) { - put_user(*tmp++, buf++); - len--; - } - read_space(error); -done: - return error; -} - -int compute_name(struct dentry * entry, char * buf) -{ - int len; - - if(IS_ROOT(entry)) { - *buf = '/'; - return 1; - } - len = compute_name(entry->d_parent, buf); - if(len > 1) { - buf[len++] = '/'; - } - memcpy(buf+len, entry->d_name, entry->d_len); - return len + entry->d_len; -} - -int _omirr_print(struct dentry * ent1, struct dentry * ent2, - struct qstr * suffix, const char * fmt, - va_list args1, va_list args2) -{ - int count = strlen(fmt) + 10; /* estimate */ - const char * tmp = fmt; - char lenbuf[8]; - int res; - - if(!buffer) - init_buffer(NULL); - while(*tmp) { - while(*tmp && *tmp++ != '%') ; - if(*tmp) { - if(*tmp == 's') { - char * str = va_arg(args1, char*); - count += strlen(str); - } else { - (void)va_arg(args1, int); - count += 8; /* estimate */ - } - } - } - if(ent1) { - struct dentry * dent = ent1; - while(dent && !IS_ROOT(dent)) { - count += dent->d_len + 1; - dent = dent->d_parent; - } - count++; - if(ent2) { - dent = ent2; - while(dent && !IS_ROOT(dent)) { - count += dent->d_len + 1; - dent = dent->d_parent; - } - count++; - } - if(suffix) - count += suffix->len + 1; - } - - if((nr_omirr_open | cleared_flag) && reserve_write_space(count)) { - cleared_flag = 0; - res = vsprintf(buffer+write_pos+4, fmt, args2) + 4; - if(res > count) - printk("omirr: format estimate was wrong\n"); - if(ent1) { - res += compute_name(ent1, buffer+write_pos+res); - if(ent2) { - buffer[write_pos+res++] = '\0'; - res += compute_name(ent2, buffer+write_pos+res); - } - if(suffix) { - buffer[write_pos+res++] = '/'; - memcpy(buffer+write_pos+res, - suffix->name, suffix->len); - res += suffix->len; - } - buffer[write_pos+res++] = '\0'; - buffer[write_pos+res++] = '\n'; - } - sprintf(lenbuf, "%04d", res); - memcpy(buffer+write_pos, lenbuf, 4); - } else { - if(!cleared_flag) { - cleared_flag = 1; - init_buffer("0007 Z\n"); - } - res = 0; - } - write_space(res); - return res; -} - -int omirr_print(struct dentry * ent1, struct dentry * ent2, - struct qstr * suffix, const char * fmt, ...) -{ - va_list args1, args2; - int res; - - /* I don't know whether I could make a simple copy of the va_list, - * so for the safe way... - */ - va_start(args1, fmt); - va_start(args2, fmt); - res = _omirr_print(ent1, ent2, suffix, fmt, args1, args2); - va_end(args2); - va_end(args1); - return res; -} - -int omirr_printall(struct inode * inode, const char * fmt, ...) -{ - int res = 0; - struct dentry * tmp = inode->i_dentry; - - if(tmp) do { - va_list args1, args2; - va_start(args1, fmt); - va_start(args2, fmt); - res += _omirr_print(tmp, NULL, NULL, fmt, args1, args2); - va_end(args2); - va_end(args1); - tmp = tmp->d_next; - } while(tmp != inode->i_dentry); - return res; -} - -static struct file_operations omirr_operations = { - NULL, /* omirr_lseek */ - omirr_read, - NULL, /* omirr_write */ - NULL, /* omirr_readdir */ - NULL, /* omirr_select */ - NULL, /* omirr_ioctl */ - NULL, /* mmap */ - omirr_open, - NULL, /* flush */ - omirr_release, - NULL, /* fsync */ - NULL, /* fasync */ -}; - -struct inode_operations proc_omirr_inode_operations = { - &omirr_operations, -}; diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 00b09e6a7..3ad4bfabf 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -29,6 +29,7 @@ #include <linux/smp.h> #include <linux/signal.h> #include <linux/module.h> +#include <linux/init.h> #include <asm/uaccess.h> #include <asm/pgtable.h> @@ -593,9 +594,8 @@ static ssize_t write_profile(struct file * file, const char * buf, } static struct file_operations proc_profile_operations = { - NULL, /* lseek */ - read_profile, - write_profile, + read: read_profile, + write: write_profile, }; static struct inode_operations proc_profile_inode_operations = { @@ -618,7 +618,7 @@ static struct proc_dir_entry proc_root_profile = { 0, &proc_profile_inode_operations }; -void proc_misc_init(void) +void __init proc_misc_init(void) { static struct { char *name; diff --git a/fs/proc/procfs_syms.c b/fs/proc/procfs_syms.c index 45d80dd5f..cc1ae7d96 100644 --- a/fs/proc/procfs_syms.c +++ b/fs/proc/procfs_syms.c @@ -2,6 +2,7 @@ #include <linux/module.h> #include <linux/fs.h> #include <linux/proc_fs.h> +#include <linux/init.h> extern struct proc_dir_entry *proc_sys_root; @@ -26,7 +27,7 @@ static struct file_system_type proc_fs_type = { NULL }; -int init_proc_fs(void) +int __init init_proc_fs(void) { return register_filesystem(&proc_fs_type) == 0; } diff --git a/fs/proc/root.c b/fs/proc/root.c index 75780167a..8bacabed2 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -143,10 +143,7 @@ static int proc_root_readdir(struct file * filp, * directory handling functions for that.. */ static struct file_operations proc_root_operations = { - NULL, /* lseek - default */ - NULL, /* read - bad */ - NULL, /* write - bad */ - proc_root_readdir, /* readdir */ + readdir: proc_root_readdir, }; /* |