patch-2.3.99-pre6 linux/fs/proc/proc_misc.c
Next file: linux/fs/proc/proc_tty.c
Previous file: linux/fs/proc/base.c
Back to the patch index
Back to the overall index
- Lines: 120
- Date:
Fri Apr 21 16:08:45 2000
- Orig file:
v2.3.99-pre5/linux/fs/proc/proc_misc.c
- Orig date:
Tue Mar 7 14:32:26 2000
diff -u --recursive --new-file v2.3.99-pre5/linux/fs/proc/proc_misc.c linux/fs/proc/proc_misc.c
@@ -30,6 +30,7 @@
#include <linux/signal.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -284,14 +285,16 @@
int count, int *eof, void *data)
{
int i, len;
- unsigned sum = 0;
extern unsigned long total_forks;
unsigned long jif = jiffies;
+#if !defined(CONFIG_ARCH_S390)
+ unsigned sum = 0;
for (i = 0 ; i < NR_IRQS ; i++)
sum += kstat_irqs(i);
+#endif
-#ifdef __SMP__
+#ifdef CONFIG_SMP
len = sprintf(page,
"cpu %u %u %u %lu\n",
kstat.cpu_user,
@@ -314,9 +317,13 @@
"disk_rblk %u %u %u %u\n"
"disk_wblk %u %u %u %u\n"
"page %u %u\n"
- "swap %u %u\n"
+#if !defined(CONFIG_ARCH_S390)
+ "swap %u %u\n"
"intr %u",
#else
+ "swap %u %u\n",
+#endif
+#else
len = sprintf(page,
"cpu %u %u %u %lu\n"
"disk %u %u %u %u\n"
@@ -325,8 +332,12 @@
"disk_rblk %u %u %u %u\n"
"disk_wblk %u %u %u %u\n"
"page %u %u\n"
- "swap %u %u\n"
+#if !defined(CONFIG_ARCH_S390)
+ "swap %u %u\n"
"intr %u",
+#else
+ "swap %u %u\n",
+#endif
kstat.cpu_user,
kstat.cpu_nice,
kstat.cpu_system,
@@ -345,10 +356,14 @@
kstat.pgpgin,
kstat.pgpgout,
kstat.pswpin,
+#if !defined(CONFIG_ARCH_S390)
kstat.pswpout,
sum);
- for (i = 0 ; i < NR_IRQS ; i++)
- len += sprintf(page + len, " %u", kstat_irqs(i));
+ for (i = 0 ; i < NR_IRQS ; i++)
+ len += sprintf(page + len, " %u", kstat_irqs(i));
+#else
+ kstat.pswpout);
+#endif
len += sprintf(page + len,
"\nctxt %u\n"
"btime %lu\n"
@@ -388,6 +403,7 @@
return len;
}
+#if !defined(CONFIG_ARCH_S390)
static int interrupts_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
@@ -399,6 +415,7 @@
if (len<0) len = 0;
return len;
}
+#endif
static int filesystems_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
@@ -469,7 +486,10 @@
static int locks_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len = get_locks_status(page, start, off, count);
+ int len;
+ lock_kernel();
+ len = get_locks_status(page, start, off, count);
+ unlock_kernel();
if (len < count) *eof = 1;
return len;
}
@@ -574,7 +594,7 @@
static ssize_t write_profile(struct file * file, const char * buf,
size_t count, loff_t *ppos)
{
-#ifdef __SMP__
+#ifdef CONFIG_SMP
extern int setup_profiling_timer (unsigned int multiplier);
if (count==sizeof(int)) {
@@ -627,7 +647,9 @@
{"stat", kstat_read_proc},
{"devices", devices_read_proc},
{"partitions", partitions_read_proc},
+#if !defined(CONFIG_ARCH_S390)
{"interrupts", interrupts_read_proc},
+#endif
{"filesystems", filesystems_read_proc},
{"dma", dma_read_proc},
{"ioports", ioports_read_proc},
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)