Merge branch 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Dec 2009 17:50:22 +0000 (09:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Dec 2009 17:50:22 +0000 (09:50 -0800)
* 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ratelimit: Make suppressed output messages more useful
  printk: Remove ratelimit.h from kernel.h
  ratelimit: Fix/allow use in atomic contexts
  ratelimit: Use per ratelimit context locking

1  2 
include/linux/kernel.h
include/linux/net.h
kernel/printk.c
kernel/sysctl.c

diff --combined include/linux/kernel.h
@@@ -15,7 -15,6 +15,6 @@@
  #include <linux/bitops.h>
  #include <linux/log2.h>
  #include <linux/typecheck.h>
- #include <linux/ratelimit.h>
  #include <linux/dynamic_debug.h>
  #include <asm/byteorder.h>
  #include <asm/bug.h>
@@@ -146,7 -145,7 +145,7 @@@ extern int _cond_resched(void)
  #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
  
  #define abs(x) ({                             \
 -              int __x = (x);                  \
 +              long __x = (x);                 \
                (__x < 0) ? -__x : __x;         \
        })
  
@@@ -241,21 -240,19 +240,21 @@@ asmlinkage int vprintk(const char *fmt
  asmlinkage int printk(const char * fmt, ...)
        __attribute__ ((format (printf, 1, 2))) __cold;
  
- extern struct ratelimit_state printk_ratelimit_state;
- extern int printk_ratelimit(void);
+ extern int __printk_ratelimit(const char *func);
+ #define printk_ratelimit() __printk_ratelimit(__func__)
  extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
                                   unsigned int interval_msec);
  
 +extern int printk_delay_msec;
 +
  /*
   * Print a one-time message (analogous to WARN_ONCE() et al):
   */
  #define printk_once(x...) ({                  \
 -      static int __print_once = 1;            \
 +      static bool __print_once = true;        \
                                                \
        if (__print_once) {                     \
 -              __print_once = 0;               \
 +              __print_once = false;           \
                printk(x);                      \
        }                                       \
  })
@@@ -659,12 -656,6 +658,12 @@@ extern int do_sysinfo(struct sysinfo *i
  
  #endif /* __KERNEL__ */
  
 +#ifndef __EXPORTED_HEADERS__
 +#ifndef __KERNEL__
 +#warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders
 +#endif /* __KERNEL__ */
 +#endif /* __EXPORTED_HEADERS__ */
 +
  #define SI_LOAD_SHIFT 16
  struct sysinfo {
        long uptime;                    /* Seconds since boot */
  };
  
  /* Force a compilation error if condition is true */
 -#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
 +#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
 +
 +/* Force a compilation error if condition is constant and true */
 +#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
  
  /* Force a compilation error if condition is true, but also produce a
     result (of value 0 and type size_t), so the expression can be used
     e.g. in a structure initializer (or where-ever else comma expressions
     aren't permitted). */
 -#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
 +#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
 +#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
  
  /* Trap pasters of __FUNCTION__ at compile-time */
  #define __FUNCTION__ (__func__)
diff --combined include/linux/net.h
@@@ -178,11 -178,11 +178,11 @@@ struct proto_ops 
        int             (*listen)    (struct socket *sock, int len);
        int             (*shutdown)  (struct socket *sock, int flags);
        int             (*setsockopt)(struct socket *sock, int level,
 -                                    int optname, char __user *optval, int optlen);
 +                                    int optname, char __user *optval, unsigned int optlen);
        int             (*getsockopt)(struct socket *sock, int level,
                                      int optname, char __user *optval, int __user *optlen);
        int             (*compat_setsockopt)(struct socket *sock, int level,
 -                                    int optname, char __user *optval, int optlen);
 +                                    int optname, char __user *optval, unsigned int optlen);
        int             (*compat_getsockopt)(struct socket *sock, int level,
                                      int optname, char __user *optval, int __user *optlen);
        int             (*sendmsg)   (struct kiocb *iocb, struct socket *sock,
@@@ -256,7 -256,7 +256,7 @@@ extern int kernel_getpeername(struct so
  extern int kernel_getsockopt(struct socket *sock, int level, int optname,
                             char *optval, int *optlen);
  extern int kernel_setsockopt(struct socket *sock, int level, int optname,
 -                           char *optval, int optlen);
 +                           char *optval, unsigned int optlen);
  extern int kernel_sendpage(struct socket *sock, struct page *page, int offset,
                           size_t size, int flags);
  extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
@@@ -313,7 -313,7 +313,7 @@@ SOCKCALL_WRAP(name, compat_ioctl, (stru
  SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \
  SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \
  SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \
 -                       char __user *optval, int optlen), (sock, level, optname, optval, optlen)) \
 +                       char __user *optval, unsigned int optlen), (sock, level, optname, optval, optlen)) \
  SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \
                         char __user *optval, int __user *optlen), (sock, level, optname, optval, optlen)) \
  SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \
@@@ -358,6 -358,7 +358,7 @@@ static const struct proto_ops name##_op
  
  #ifdef CONFIG_SYSCTL
  #include <linux/sysctl.h>
+ #include <linux/ratelimit.h>
  extern struct ratelimit_state net_ratelimit_state;
  #endif
  
diff --combined kernel/printk.c
@@@ -33,6 -33,7 +33,7 @@@
  #include <linux/bootmem.h>
  #include <linux/syscalls.h>
  #include <linux/kexec.h>
+ #include <linux/ratelimit.h>
  
  #include <asm/uaccess.h>
  
@@@ -206,11 -207,12 +207,11 @@@ __setup("log_buf_len=", log_buf_len_set
  #ifdef CONFIG_BOOT_PRINTK_DELAY
  
  static unsigned int boot_delay; /* msecs delay after each printk during bootup */
 -static unsigned long long printk_delay_msec; /* per msec, based on boot_delay */
 +static unsigned long long loops_per_msec;     /* based on boot_delay */
  
  static int __init boot_delay_setup(char *str)
  {
        unsigned long lpj;
 -      unsigned long long loops_per_msec;
  
        lpj = preset_lpj ? preset_lpj : 1000000;        /* some guess */
        loops_per_msec = (unsigned long long)lpj / 1000 * HZ;
        if (boot_delay > 10 * 1000)
                boot_delay = 0;
  
 -      printk_delay_msec = loops_per_msec;
 -      printk(KERN_DEBUG "boot_delay: %u, preset_lpj: %ld, lpj: %lu, "
 -              "HZ: %d, printk_delay_msec: %llu\n",
 -              boot_delay, preset_lpj, lpj, HZ, printk_delay_msec);
 +      pr_debug("boot_delay: %u, preset_lpj: %ld, lpj: %lu, "
 +              "HZ: %d, loops_per_msec: %llu\n",
 +              boot_delay, preset_lpj, lpj, HZ, loops_per_msec);
        return 1;
  }
  __setup("boot_delay=", boot_delay_setup);
@@@ -234,7 -237,7 +235,7 @@@ static void boot_delay_msec(void
        if (boot_delay == 0 || system_state != SYSTEM_BOOTING)
                return;
  
 -      k = (unsigned long long)printk_delay_msec * boot_delay;
 +      k = (unsigned long long)loops_per_msec * boot_delay;
  
        timeout = jiffies + msecs_to_jiffies(boot_delay);
        while (k) {
@@@ -653,20 -656,6 +654,20 @@@ static int recursion_bug
  static int new_text_line = 1;
  static char printk_buf[1024];
  
 +int printk_delay_msec __read_mostly;
 +
 +static inline void printk_delay(void)
 +{
 +      if (unlikely(printk_delay_msec)) {
 +              int m = printk_delay_msec;
 +
 +              while (m--) {
 +                      mdelay(1);
 +                      touch_nmi_watchdog();
 +              }
 +      }
 +}
 +
  asmlinkage int vprintk(const char *fmt, va_list args)
  {
        int printed_len = 0;
        char *p;
  
        boot_delay_msec();
 +      printk_delay();
  
        preempt_disable();
        /* This stops the holder of console_sem just where we want him */
@@@ -1376,11 -1364,11 +1377,11 @@@ late_initcall(disable_boot_consoles)
   */
  DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);
  
- int printk_ratelimit(void)
+ int __printk_ratelimit(const char *func)
  {
-       return __ratelimit(&printk_ratelimit_state);
+       return ___ratelimit(&printk_ratelimit_state, func);
  }
- EXPORT_SYMBOL(printk_ratelimit);
+ EXPORT_SYMBOL(__printk_ratelimit);
  
  /**
   * printk_timed_ratelimit - caller-controlled printk ratelimiting
diff --combined kernel/sysctl.c
@@@ -26,6 -26,7 +26,6 @@@
  #include <linux/proc_fs.h>
  #include <linux/security.h>
  #include <linux/ctype.h>
 -#include <linux/utsname.h>
  #include <linux/kmemcheck.h>
  #include <linux/smp_lock.h>
  #include <linux/fs.h>
@@@ -36,6 -37,7 +36,7 @@@
  #include <linux/sysrq.h>
  #include <linux/highuid.h>
  #include <linux/writeback.h>
+ #include <linux/ratelimit.h>
  #include <linux/hugetlb.h>
  #include <linux/initrd.h>
  #include <linux/key.h>
@@@ -49,7 -51,7 +50,7 @@@
  #include <linux/reboot.h>
  #include <linux/ftrace.h>
  #include <linux/slow-work.h>
 -#include <linux/perf_counter.h>
 +#include <linux/perf_event.h>
  
  #include <asm/uaccess.h>
  #include <asm/processor.h>
@@@ -76,7 -78,6 +77,7 @@@ extern int max_threads
  extern int core_uses_pid;
  extern int suid_dumpable;
  extern char core_pattern[];
 +extern unsigned int core_pipe_limit;
  extern int pid_max;
  extern int min_free_kbytes;
  extern int pid_max_min, pid_max_max;
@@@ -106,9 -107,6 +107,9 @@@ static int __maybe_unused one = 1
  static int __maybe_unused two = 2;
  static unsigned long one_ul = 1;
  static int one_hundred = 100;
 +#ifdef CONFIG_PRINTK
 +static int ten_thousand = 10000;
 +#endif
  
  /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
  static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
@@@ -158,14 -156,16 +159,16 @@@ extern int no_unaligned_warning
  extern int unaligned_dump_stack;
  #endif
  
+ extern struct ratelimit_state printk_ratelimit_state;
  #ifdef CONFIG_RT_MUTEXES
  extern int max_lock_depth;
  #endif
  
  #ifdef CONFIG_PROC_SYSCTL
 -static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp,
 +static int proc_do_cad_pid(struct ctl_table *table, int write,
                  void __user *buffer, size_t *lenp, loff_t *ppos);
 -static int proc_taint(struct ctl_table *table, int write, struct file *filp,
 +static int proc_taint(struct ctl_table *table, int write,
                               void __user *buffer, size_t *lenp, loff_t *ppos);
  #endif
  
@@@ -424,14 -424,6 +427,14 @@@ static struct ctl_table kern_table[] = 
                .proc_handler   = &proc_dostring,
                .strategy       = &sysctl_string,
        },
 +      {
 +              .ctl_name       = CTL_UNNUMBERED,
 +              .procname       = "core_pipe_limit",
 +              .data           = &core_pipe_limit,
 +              .maxlen         = sizeof(unsigned int),
 +              .mode           = 0644,
 +              .proc_handler   = &proc_dointvec,
 +      },
  #ifdef CONFIG_PROC_SYSCTL
        {
                .procname       = "tainted",
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
 +      {
 +              .ctl_name       = CTL_UNNUMBERED,
 +              .procname       = "printk_delay",
 +              .data           = &printk_delay_msec,
 +              .maxlen         = sizeof(int),
 +              .mode           = 0644,
 +              .proc_handler   = &proc_dointvec_minmax,
 +              .strategy       = &sysctl_intvec,
 +              .extra1         = &zero,
 +              .extra2         = &ten_thousand,
 +      },
  #endif
        {
                .ctl_name       = KERN_NGROUPS_MAX,
                .child          = slow_work_sysctls,
        },
  #endif
 -#ifdef CONFIG_PERF_COUNTERS
 +#ifdef CONFIG_PERF_EVENTS
        {
                .ctl_name       = CTL_UNNUMBERED,
 -              .procname       = "perf_counter_paranoid",
 -              .data           = &sysctl_perf_counter_paranoid,
 -              .maxlen         = sizeof(sysctl_perf_counter_paranoid),
 +              .procname       = "perf_event_paranoid",
 +              .data           = &sysctl_perf_event_paranoid,
 +              .maxlen         = sizeof(sysctl_perf_event_paranoid),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
        {
                .ctl_name       = CTL_UNNUMBERED,
 -              .procname       = "perf_counter_mlock_kb",
 -              .data           = &sysctl_perf_counter_mlock,
 -              .maxlen         = sizeof(sysctl_perf_counter_mlock),
 +              .procname       = "perf_event_mlock_kb",
 +              .data           = &sysctl_perf_event_mlock,
 +              .maxlen         = sizeof(sysctl_perf_event_mlock),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
        {
                .ctl_name       = CTL_UNNUMBERED,
 -              .procname       = "perf_counter_max_sample_rate",
 -              .data           = &sysctl_perf_counter_sample_rate,
 -              .maxlen         = sizeof(sysctl_perf_counter_sample_rate),
 +              .procname       = "perf_event_max_sample_rate",
 +              .data           = &sysctl_perf_event_sample_rate,
 +              .maxlen         = sizeof(sysctl_perf_event_sample_rate),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
@@@ -1398,31 -1379,6 +1401,31 @@@ static struct ctl_table vm_table[] = 
                .mode           = 0644,
                .proc_handler   = &scan_unevictable_handler,
        },
 +#ifdef CONFIG_MEMORY_FAILURE
 +      {
 +              .ctl_name       = CTL_UNNUMBERED,
 +              .procname       = "memory_failure_early_kill",
 +              .data           = &sysctl_memory_failure_early_kill,
 +              .maxlen         = sizeof(sysctl_memory_failure_early_kill),
 +              .mode           = 0644,
 +              .proc_handler   = &proc_dointvec_minmax,
 +              .strategy       = &sysctl_intvec,
 +              .extra1         = &zero,
 +              .extra2         = &one,
 +      },
 +      {
 +              .ctl_name       = CTL_UNNUMBERED,
 +              .procname       = "memory_failure_recovery",
 +              .data           = &sysctl_memory_failure_recovery,
 +              .maxlen         = sizeof(sysctl_memory_failure_recovery),
 +              .mode           = 0644,
 +              .proc_handler   = &proc_dointvec_minmax,
 +              .strategy       = &sysctl_intvec,
 +              .extra1         = &zero,
 +              .extra2         = &one,
 +      },
 +#endif
 +
  /*
   * NOTE: do not add new entries to this table unless you have read
   * Documentation/sysctl/ctl_unnumbered.txt
@@@ -2251,7 -2207,7 +2254,7 @@@ void sysctl_head_put(struct ctl_table_h
  #ifdef CONFIG_PROC_SYSCTL
  
  static int _proc_do_string(void* data, int maxlen, int write,
 -                         struct file *filp, void __user *buffer,
 +                         void __user *buffer,
                           size_t *lenp, loff_t *ppos)
  {
        size_t len;
   * proc_dostring - read a string sysctl
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: file position
   *
   * Returns 0 on success.
   */
 -int proc_dostring(struct ctl_table *table, int write, struct file *filp,
 +int proc_dostring(struct ctl_table *table, int write,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
  {
 -      return _proc_do_string(table->data, table->maxlen, write, filp,
 +      return _proc_do_string(table->data, table->maxlen, write,
                               buffer, lenp, ppos);
  }
  
@@@ -2353,7 -2310,7 +2356,7 @@@ static int do_proc_dointvec_conv(int *n
  }
  
  static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
 -                int write, struct file *filp, void __user *buffer,
 +                int write, void __user *buffer,
                  size_t *lenp, loff_t *ppos,
                  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
                              int write, void *data),
  #undef TMPBUFLEN
  }
  
 -static int do_proc_dointvec(struct ctl_table *table, int write, struct file *filp,
 +static int do_proc_dointvec(struct ctl_table *table, int write,
                  void __user *buffer, size_t *lenp, loff_t *ppos,
                  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
                              int write, void *data),
                  void *data)
  {
 -      return __do_proc_dointvec(table->data, table, write, filp,
 +      return __do_proc_dointvec(table->data, table, write,
                        buffer, lenp, ppos, conv, data);
  }
  
   * proc_dointvec - read a vector of integers
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: file position
   *
   * Returns 0 on success.
   */
 -int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec(struct ctl_table *table, int write,
                     void __user *buffer, size_t *lenp, loff_t *ppos)
  {
 -    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
 +    return do_proc_dointvec(table,write,buffer,lenp,ppos,
                            NULL,NULL);
  }
  
   * Taint values can only be increased
   * This means we can safely use a temporary.
   */
 -static int proc_taint(struct ctl_table *table, int write, struct file *filp,
 +static int proc_taint(struct ctl_table *table, int write,
                               void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        struct ctl_table t;
  
        t = *table;
        t.data = &tmptaint;
 -      err = proc_doulongvec_minmax(&t, write, filp, buffer, lenp, ppos);
 +      err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
        if (err < 0)
                return err;
  
@@@ -2558,6 -2516,7 +2561,6 @@@ static int do_proc_dointvec_minmax_conv
   * proc_dointvec_minmax - read a vector of integers with min/max values
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: file position
   *
   * Returns 0 on success.
   */
 -int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_minmax(struct ctl_table *table, int write,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        struct do_proc_dointvec_minmax_conv_param param = {
                .min = (int *) table->extra1,
                .max = (int *) table->extra2,
        };
 -      return do_proc_dointvec(table, write, filp, buffer, lenp, ppos,
 +      return do_proc_dointvec(table, write, buffer, lenp, ppos,
                                do_proc_dointvec_minmax_conv, &param);
  }
  
  static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
 -                                   struct file *filp,
                                     void __user *buffer,
                                     size_t *lenp, loff_t *ppos,
                                     unsigned long convmul,
  }
  
  static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
 -                                   struct file *filp,
                                     void __user *buffer,
                                     size_t *lenp, loff_t *ppos,
                                     unsigned long convmul,
                                     unsigned long convdiv)
  {
        return __do_proc_doulongvec_minmax(table->data, table, write,
 -                      filp, buffer, lenp, ppos, convmul, convdiv);
 +                      buffer, lenp, ppos, convmul, convdiv);
  }
  
  /**
   * proc_doulongvec_minmax - read a vector of long integers with min/max values
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: file position
   *
   * Returns 0 on success.
   */
 -int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp,
 +int proc_doulongvec_minmax(struct ctl_table *table, int write,
                           void __user *buffer, size_t *lenp, loff_t *ppos)
  {
 -    return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos, 1l, 1l);
 +    return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
  }
  
  /**
   * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: file position
   * Returns 0 on success.
   */
  int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
 -                                    struct file *filp,
                                      void __user *buffer,
                                      size_t *lenp, loff_t *ppos)
  {
 -    return do_proc_doulongvec_minmax(table, write, filp, buffer,
 +    return do_proc_doulongvec_minmax(table, write, buffer,
                                     lenp, ppos, HZ, 1000l);
  }
  
@@@ -2814,6 -2778,7 +2817,6 @@@ static int do_proc_dointvec_ms_jiffies_
   * proc_dointvec_jiffies - read a vector of integers as seconds
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: file position
   *
   * Returns 0 on success.
   */
 -int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_jiffies(struct ctl_table *table, int write,
                          void __user *buffer, size_t *lenp, loff_t *ppos)
  {
 -    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
 +    return do_proc_dointvec(table,write,buffer,lenp,ppos,
                            do_proc_dointvec_jiffies_conv,NULL);
  }
  
   * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: pointer to the file position
   *
   * Returns 0 on success.
   */
 -int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
                                 void __user *buffer, size_t *lenp, loff_t *ppos)
  {
 -    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
 +    return do_proc_dointvec(table,write,buffer,lenp,ppos,
                            do_proc_dointvec_userhz_jiffies_conv,NULL);
  }
  
   * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
   * @table: the sysctl table
   * @write: %TRUE if this is a write to the sysctl file
 - * @filp: the file structure
   * @buffer: the user buffer
   * @lenp: the size of the user buffer
   * @ppos: file position
   *
   * Returns 0 on success.
   */
 -int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
                             void __user *buffer, size_t *lenp, loff_t *ppos)
  {
 -      return do_proc_dointvec(table, write, filp, buffer, lenp, ppos,
 +      return do_proc_dointvec(table, write, buffer, lenp, ppos,
                                do_proc_dointvec_ms_jiffies_conv, NULL);
  }
  
 -static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp,
 +static int proc_do_cad_pid(struct ctl_table *table, int write,
                           void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        struct pid *new_pid;
  
        tmp = pid_vnr(cad_pid);
  
 -      r = __do_proc_dointvec(&tmp, table, write, filp, buffer,
 +      r = __do_proc_dointvec(&tmp, table, write, buffer,
                               lenp, ppos, NULL, NULL);
        if (r || !write)
                return r;
  
  #else /* CONFIG_PROC_FS */
  
 -int proc_dostring(struct ctl_table *table, int write, struct file *filp,
 +int proc_dostring(struct ctl_table *table, int write,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        return -ENOSYS;
  }
  
 -int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec(struct ctl_table *table, int write,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        return -ENOSYS;
  }
  
 -int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_minmax(struct ctl_table *table, int write,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        return -ENOSYS;
  }
  
 -int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_jiffies(struct ctl_table *table, int write,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        return -ENOSYS;
  }
  
 -int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        return -ENOSYS;
  }
  
 -int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp,
 +int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
                             void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        return -ENOSYS;
  }
  
 -int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp,
 +int proc_doulongvec_minmax(struct ctl_table *table, int write,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
  {
        return -ENOSYS;
  }
  
  int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
 -                                    struct file *filp,
                                      void __user *buffer,
                                      size_t *lenp, loff_t *ppos)
  {