VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / proc / proc_misc.c
index d6b65c0..d94d596 100644 (file)
 #include <linux/jiffies.h>
 #include <linux/sysrq.h>
 #include <linux/vmalloc.h>
+#include <linux/vs_base.h>
+#include <linux/vs_cvirt.h>
+
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 #include <asm/tlb.h>
 #include <asm/div64.h>
 
@@ -67,9 +69,6 @@ extern int get_filesystem_list(char *);
 extern int get_exec_domain_list(char *);
 extern int get_dma_list(char *);
 extern int get_locks_status (char *, char **, off_t, int);
-#ifdef CONFIG_SGI_DS1286
-extern int get_ds1286_status(char *);
-#endif
 
 static int proc_calc_metrics(char *page, char **start, off_t off,
                                 int count, int *eof, int len)
@@ -144,6 +143,9 @@ static int uptime_read_proc(char *page, char **start, off_t off,
 
        do_posix_clock_monotonic_gettime(&uptime);
        jiffies_to_timespec(idle_jiffies, &idle);
+       if (vx_flags(VXF_VIRT_UPTIME, 0))
+               vx_vsi_uptime(&uptime, &idle);
+
        len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
                        (unsigned long) uptime.tv_sec,
                        (uptime.tv_nsec / (NSEC_PER_SEC / 100)),
@@ -390,7 +392,7 @@ int show_stat(struct seq_file *p, void *v)
                (unsigned long long)jiffies_64_to_clock_t(iowait),
                (unsigned long long)jiffies_64_to_clock_t(irq),
                (unsigned long long)jiffies_64_to_clock_t(softirq));
-       for_each_cpu(i) {
+       for_each_online_cpu(i) {
 
                /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
                user = kstat_cpu(i).cpustat.user;
@@ -522,22 +524,12 @@ static int filesystems_read_proc(char *page, char **start, off_t off,
 static int cmdline_read_proc(char *page, char **start, off_t off,
                                 int count, int *eof, void *data)
 {
-       extern char saved_command_line[];
        int len;
 
        len = sprintf(page, "%s\n", saved_command_line);
        return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
-#ifdef CONFIG_SGI_DS1286
-static int ds1286_read_proc(char *page, char **start, off_t off,
-                                int count, int *eof, void *data)
-{
-       int len = get_ds1286_status(page);
-       return proc_calc_metrics(page, start, off, count, eof, len);
-}
-#endif
-
 static int locks_read_proc(char *page, char **start, off_t off,
                                 int count, int *eof, void *data)
 {
@@ -631,7 +623,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
 
                if (get_user(c, buf))
                        return -EFAULT;
-               handle_sysrq(c, NULL, NULL);
+               __handle_sysrq(c, NULL, NULL);
        }
        return count;
 }
@@ -671,9 +663,6 @@ void __init proc_misc_init(void)
                {"devices",     devices_read_proc},
                {"filesystems", filesystems_read_proc},
                {"cmdline",     cmdline_read_proc},
-#ifdef CONFIG_SGI_DS1286
-               {"rtc",         ds1286_read_proc},
-#endif
                {"locks",       locks_read_proc},
                {"execdomains", execdomains_read_proc},
                {NULL,}