Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117657
b: refs/heads/master
c: d6917e1
h: refs/heads/master
i:
  117655: 9322e5b
v: v3
  • Loading branch information
Alexey Dobriyan committed Oct 23, 2008
1 parent 9d540fa commit 6e734f5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 41 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df8106dbb59a8c167ea16631059ecb5f7d77da13
refs/heads/master: d6917e19f3fda8e1f88bc23ddceed952927bd716
1 change: 1 addition & 0 deletions trunk/fs/proc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ proc-y += inode.o root.o base.o generic.o array.o \
proc-y += cmdline.o
proc-y += cpuinfo.o
proc-y += devices.o
proc-y += interrupts.o
proc-y += loadavg.o
proc-y += meminfo.o
proc-y += stat.o
Expand Down
53 changes: 53 additions & 0 deletions trunk/fs/proc/interrupts.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irqnr.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>

/*
* /proc/interrupts
*/
static void *int_seq_start(struct seq_file *f, loff_t *pos)
{
return (*pos <= nr_irqs) ? pos : NULL;
}

static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
{
(*pos)++;
if (*pos > nr_irqs)
return NULL;
return pos;
}

static void int_seq_stop(struct seq_file *f, void *v)
{
/* Nothing to do */
}

static const struct seq_operations int_seq_ops = {
.start = int_seq_start,
.next = int_seq_next,
.stop = int_seq_stop,
.show = show_interrupts
};

static int interrupts_open(struct inode *inode, struct file *filp)
{
return seq_open(filp, &int_seq_ops);
}

static const struct file_operations proc_interrupts_operations = {
.open = interrupts_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

static int __init proc_interrupts_init(void)
{
proc_create("interrupts", 0, NULL, &proc_interrupts_operations);
return 0;
}
module_init(proc_interrupts_init);
40 changes: 0 additions & 40 deletions trunk/fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,45 +198,6 @@ static const struct file_operations proc_vmalloc_operations = {
};
#endif

/*
* /proc/interrupts
*/
static void *int_seq_start(struct seq_file *f, loff_t *pos)
{
return (*pos <= nr_irqs) ? pos : NULL;
}


static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
{
(*pos)++;
return (*pos <= nr_irqs) ? pos : NULL;
}

static void int_seq_stop(struct seq_file *f, void *v)
{
/* Nothing to do */
}

static const struct seq_operations int_seq_ops = {
.start = int_seq_start,
.next = int_seq_next,
.stop = int_seq_stop,
.show = show_interrupts
};

static int interrupts_open(struct inode *inode, struct file *filp)
{
return seq_open(filp, &int_seq_ops);
}

static const struct file_operations proc_interrupts_operations = {
.open = interrupts_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

#ifdef CONFIG_PROC_PAGE_MONITOR
#define KPMSIZE sizeof(u64)
#define KPMMASK (KPMSIZE - 1)
Expand Down Expand Up @@ -375,7 +336,6 @@ void __init proc_misc_init(void)
proc_symlink("mounts", NULL, "self/mounts");

/* And now for trickier ones */
proc_create("interrupts", 0, NULL, &proc_interrupts_operations);
#ifdef CONFIG_SLABINFO
proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
#ifdef CONFIG_DEBUG_SLAB_LEAK
Expand Down

0 comments on commit 6e734f5

Please sign in to comment.