Commit 3bdb7ce4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: lustre: remove LL_PROC_PROTO macro

Spell out what is happening with the proc file functions, it helps to
unwind the call chain mess here.

Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: hpdd-discuss <hpdd-discuss@lists.01.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0a16b63d
...@@ -64,13 +64,13 @@ ...@@ -64,13 +64,13 @@
/* /*
* Sysctl register * Sysctl register
*/ */
#define DECLARE_PROC_HANDLER(name) \ #define DECLARE_PROC_HANDLER(name) \
static int \ static int name(struct ctl_table *table, int write, \
LL_PROC_PROTO(name) \ void __user *buffer, size_t *lenp, loff_t *ppos) \
{ \ { \
return proc_call_handler(table->data, write, \ return proc_call_handler(table->data, write, \
ppos, buffer, lenp, \ ppos, buffer, lenp, \
__##name); \ __##name); \
} }
#endif #endif
...@@ -83,11 +83,6 @@ ...@@ -83,11 +83,6 @@
#define ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos) \ #define ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos) \
proc_doulongvec_minmax(table, write, buffer, lenp, ppos); proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
#define ll_proc_dostring(table, write, filp, buffer, lenp, ppos) \
proc_dostring(table, write, buffer, lenp, ppos);
#define LL_PROC_PROTO(name) \
name(struct ctl_table *table, int write, \
void __user *buffer, size_t *lenp, loff_t *ppos)
/* helper for sysctl handlers */ /* helper for sysctl handlers */
int proc_call_handler(void *data, int write, int proc_call_handler(void *data, int write,
......
...@@ -141,7 +141,8 @@ static int __proc_lnet_stats(void *data, int write, ...@@ -141,7 +141,8 @@ static int __proc_lnet_stats(void *data, int write,
DECLARE_PROC_HANDLER(proc_lnet_stats); DECLARE_PROC_HANDLER(proc_lnet_stats);
int LL_PROC_PROTO(proc_lnet_routes) int proc_lnet_routes(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
const int tmpsiz = 256; const int tmpsiz = 256;
char *tmpstr; char *tmpstr;
...@@ -266,7 +267,8 @@ int LL_PROC_PROTO(proc_lnet_routes) ...@@ -266,7 +267,8 @@ int LL_PROC_PROTO(proc_lnet_routes)
return rc; return rc;
} }
int LL_PROC_PROTO(proc_lnet_routers) int proc_lnet_routers(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
int rc = 0; int rc = 0;
char *tmpstr; char *tmpstr;
...@@ -400,7 +402,8 @@ int LL_PROC_PROTO(proc_lnet_routers) ...@@ -400,7 +402,8 @@ int LL_PROC_PROTO(proc_lnet_routers)
return rc; return rc;
} }
int LL_PROC_PROTO(proc_lnet_peers) int proc_lnet_peers(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
const int tmpsiz = 256; const int tmpsiz = 256;
struct lnet_peer_table *ptable; struct lnet_peer_table *ptable;
...@@ -626,7 +629,8 @@ static int __proc_lnet_buffers(void *data, int write, ...@@ -626,7 +629,8 @@ static int __proc_lnet_buffers(void *data, int write,
DECLARE_PROC_HANDLER(proc_lnet_buffers); DECLARE_PROC_HANDLER(proc_lnet_buffers);
int LL_PROC_PROTO(proc_lnet_nis) int proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
int tmpsiz = 128 * LNET_CPT_NUMBER; int tmpsiz = 128 * LNET_CPT_NUMBER;
int rc = 0; int rc = 0;
......
...@@ -214,7 +214,8 @@ static int __proc_debug_mb(void *data, int write, ...@@ -214,7 +214,8 @@ static int __proc_debug_mb(void *data, int write,
DECLARE_PROC_HANDLER(proc_debug_mb) DECLARE_PROC_HANDLER(proc_debug_mb)
int LL_PROC_PROTO(proc_console_max_delay_cs) int proc_console_max_delay_cs(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
int rc, max_delay_cs; int rc, max_delay_cs;
struct ctl_table dummy = *table; struct ctl_table dummy = *table;
...@@ -245,7 +246,8 @@ int LL_PROC_PROTO(proc_console_max_delay_cs) ...@@ -245,7 +246,8 @@ int LL_PROC_PROTO(proc_console_max_delay_cs)
return rc; return rc;
} }
int LL_PROC_PROTO(proc_console_min_delay_cs) int proc_console_min_delay_cs(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
int rc, min_delay_cs; int rc, min_delay_cs;
struct ctl_table dummy = *table; struct ctl_table dummy = *table;
...@@ -276,7 +278,8 @@ int LL_PROC_PROTO(proc_console_min_delay_cs) ...@@ -276,7 +278,8 @@ int LL_PROC_PROTO(proc_console_min_delay_cs)
return rc; return rc;
} }
int LL_PROC_PROTO(proc_console_backoff) int proc_console_backoff(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
int rc, backoff; int rc, backoff;
struct ctl_table dummy = *table; struct ctl_table dummy = *table;
...@@ -303,14 +306,16 @@ int LL_PROC_PROTO(proc_console_backoff) ...@@ -303,14 +306,16 @@ int LL_PROC_PROTO(proc_console_backoff)
return rc; return rc;
} }
int LL_PROC_PROTO(libcfs_force_lbug) int libcfs_force_lbug(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
if (write) if (write)
LBUG(); LBUG();
return 0; return 0;
} }
int LL_PROC_PROTO(proc_fail_loc) int proc_fail_loc(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
int rc; int rc;
long old_fail_loc = cfs_fail_loc; long old_fail_loc = cfs_fail_loc;
......
...@@ -79,7 +79,8 @@ enum { ...@@ -79,7 +79,8 @@ enum {
}; };
int LL_PROC_PROTO(proc_set_timeout) int proc_set_timeout(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
int rc; int rc;
...@@ -89,7 +90,8 @@ int LL_PROC_PROTO(proc_set_timeout) ...@@ -89,7 +90,8 @@ int LL_PROC_PROTO(proc_set_timeout)
return rc; return rc;
} }
int LL_PROC_PROTO(proc_memory_alloc) int proc_memory_alloc(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
char buf[22]; char buf[22];
int len; int len;
...@@ -112,7 +114,8 @@ int LL_PROC_PROTO(proc_memory_alloc) ...@@ -112,7 +114,8 @@ int LL_PROC_PROTO(proc_memory_alloc)
return 0; return 0;
} }
int LL_PROC_PROTO(proc_pages_alloc) int proc_pages_alloc(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
char buf[22]; char buf[22];
int len; int len;
...@@ -135,7 +138,8 @@ int LL_PROC_PROTO(proc_pages_alloc) ...@@ -135,7 +138,8 @@ int LL_PROC_PROTO(proc_pages_alloc)
return 0; return 0;
} }
int LL_PROC_PROTO(proc_mem_max) int proc_mem_max(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
char buf[22]; char buf[22];
int len; int len;
...@@ -158,7 +162,8 @@ int LL_PROC_PROTO(proc_mem_max) ...@@ -158,7 +162,8 @@ int LL_PROC_PROTO(proc_mem_max)
return 0; return 0;
} }
int LL_PROC_PROTO(proc_pages_max) int proc_pages_max(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
char buf[22]; char buf[22];
int len; int len;
...@@ -181,7 +186,8 @@ int LL_PROC_PROTO(proc_pages_max) ...@@ -181,7 +186,8 @@ int LL_PROC_PROTO(proc_pages_max)
return 0; return 0;
} }
int LL_PROC_PROTO(proc_max_dirty_pages_in_mb) int proc_max_dirty_pages_in_mb(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
int rc = 0; int rc = 0;
...@@ -222,7 +228,8 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb) ...@@ -222,7 +228,8 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb)
return rc; return rc;
} }
int LL_PROC_PROTO(proc_alloc_fail_rate) int proc_alloc_fail_rate(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
int rc = 0; int rc = 0;
...@@ -252,23 +259,32 @@ int LL_PROC_PROTO(proc_alloc_fail_rate) ...@@ -252,23 +259,32 @@ int LL_PROC_PROTO(proc_alloc_fail_rate)
return rc; return rc;
} }
int LL_PROC_PROTO(proc_at_min) int proc_at_min(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
} }
int LL_PROC_PROTO(proc_at_max)
int proc_at_max(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
} }
int LL_PROC_PROTO(proc_at_extra)
int proc_at_extra(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
} }
int LL_PROC_PROTO(proc_at_early_margin)
int proc_at_early_margin(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
} }
int LL_PROC_PROTO(proc_at_history)
int proc_at_history(struct ctl_table *table, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{ {
return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment