Whamcloud - gitweb
LU-9859 lnet: fold lprocfs_call_handler functionality into lnet_debugfs_*
[fs/lustre-release.git] / lnet / lnet / router_proc.c
index 5d84c73..df5e25a 100644 (file)
 
 #define LNET_PROC_VERSION(v)   ((unsigned int)((v) & LNET_PROC_VER_MASK))
 
-static int __proc_lnet_stats(void *data, int write,
-                            loff_t pos, void __user *buffer, int nob)
+static int proc_lnet_stats(struct ctl_table *table, int write,
+                          void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-       int              rc;
+       int rc;
        struct lnet_counters *ctrs;
        struct lnet_counters_common common;
-       int              len;
+       size_t nob = *lenp;
+       loff_t pos = *ppos;
+       int len;
        char tmpstr[256]; /* 7 %u and 4 u64 */
 
        if (write) {
@@ -125,14 +127,6 @@ out_no_ctrs:
 }
 
 static int
-proc_lnet_stats(struct ctl_table *table, int write, void __user *buffer,
-               size_t *lenp, loff_t *ppos)
-{
-       return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
-                                   __proc_lnet_stats);
-}
-
-static int
 proc_lnet_routes(struct ctl_table *table, int write, void __user *buffer,
                 size_t *lenp, loff_t *ppos)
 {
@@ -541,9 +535,11 @@ proc_lnet_peers(struct ctl_table *table, int write, void __user *buffer,
        return rc;
 }
 
-static int __proc_lnet_buffers(void *data, int write,
-                              loff_t pos, void __user *buffer, int nob)
+static int proc_lnet_buffers(struct ctl_table *table, int write,
+                            void __user *buffer, size_t *lenp, loff_t *ppos)
 {
+       size_t nob = *lenp;
+       loff_t pos = *ppos;
        char            *s;
        char            *tmpstr;
        int             tmpsiz;
@@ -600,14 +596,6 @@ static int __proc_lnet_buffers(void *data, int write,
 }
 
 static int
-proc_lnet_buffers(struct ctl_table *table, int write, void __user *buffer,
-                 size_t *lenp, loff_t *ppos)
-{
-       return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
-                                   __proc_lnet_buffers);
-}
-
-static int
 proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer,
              size_t *lenp, loff_t *ppos)
 {
@@ -787,10 +775,13 @@ static struct lnet_portal_rotors  portal_rotors[] = {
        },
 };
 
-static int __proc_lnet_portal_rotor(void *data, int write,
-                                   loff_t pos, void __user *buffer, int nob)
+static int proc_lnet_portal_rotor(struct ctl_table *table, int write,
+                                 void __user *buffer, size_t *lenp,
+                                 loff_t *ppos)
 {
        const int       buf_len = 128;
+       size_t nob = *lenp;
+       loff_t pos = *ppos;
        char            *buf;
        char            *tmp;
        int             rc;
@@ -850,15 +841,6 @@ static int __proc_lnet_portal_rotor(void *data, int write,
        return rc;
 }
 
-static int
-proc_lnet_portal_rotor(struct ctl_table *table, int write, void __user *buffer,
-                      size_t *lenp, loff_t *ppos)
-{
-       return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
-                                   __proc_lnet_portal_rotor);
-}
-
-
 static struct ctl_table lnet_table[] = {
        /*
         * NB No .strategy entries have been provided since sysctl(8) prefers