Skip to content

Commit 8f053ac

Browse files
Alexey Dobriyantorvalds
authored andcommitted
proc: remove INF macro
If you're applying this patch, all /proc/$PID/* files were converted to seq_file interface and this code became unused. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d962c14 commit 8f053ac

2 files changed

Lines changed: 0 additions & 42 deletions

File tree

‎fs/proc/base.c‎

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ struct pid_entry {
130130
{ .proc_get_link = get_link } )
131131
#define REG(NAME, MODE, fops) \
132132
NOD(NAME, (S_IFREG|(MODE)), NULL, &fops, {})
133-
#define INF(NAME, MODE, read) \
134-
NOD(NAME, (S_IFREG|(MODE)), \
135-
NULL, &proc_info_file_operations, \
136-
{ .proc_read = read } )
137133
#define ONE(NAME, MODE, show) \
138134
NOD(NAME, (S_IFREG|(MODE)), \
139135
NULL, &proc_single_file_operations, \
@@ -604,43 +600,6 @@ static const struct inode_operations proc_def_inode_operations = {
604600
.setattr = proc_setattr,
605601
};
606602

607-
#define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */
608-
609-
static ssize_t proc_info_read(struct file * file, char __user * buf,
610-
size_t count, loff_t *ppos)
611-
{
612-
struct inode * inode = file_inode(file);
613-
unsigned long page;
614-
ssize_t length;
615-
struct task_struct *task = get_proc_task(inode);
616-
617-
length = -ESRCH;
618-
if (!task)
619-
goto out_no_task;
620-
621-
if (count > PROC_BLOCK_SIZE)
622-
count = PROC_BLOCK_SIZE;
623-
624-
length = -ENOMEM;
625-
if (!(page = __get_free_page(GFP_TEMPORARY)))
626-
goto out;
627-
628-
length = PROC_I(inode)->op.proc_read(task, (char*)page);
629-
630-
if (length >= 0)
631-
length = simple_read_from_buffer(buf, count, ppos, (char *)page, length);
632-
free_page(page);
633-
out:
634-
put_task_struct(task);
635-
out_no_task:
636-
return length;
637-
}
638-
639-
static const struct file_operations proc_info_file_operations = {
640-
.read = proc_info_read,
641-
.llseek = generic_file_llseek,
642-
};
643-
644603
static int proc_single_show(struct seq_file *m, void *v)
645604
{
646605
struct inode *inode = m->private;

‎fs/proc/internal.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ struct proc_dir_entry {
5252

5353
union proc_op {
5454
int (*proc_get_link)(struct dentry *, struct path *);
55-
int (*proc_read)(struct task_struct *task, char *page);
5655
int (*proc_show)(struct seq_file *m,
5756
struct pid_namespace *ns, struct pid *pid,
5857
struct task_struct *task);

0 commit comments

Comments
 (0)