From: Greg Kroah-Hartman Date: Sun, 13 Jul 2014 01:00:44 +0000 (-0700) Subject: staging: lustre: remove LL_PROC_PROTO macro X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3bdb7ce4119b8b333797d67cf87d2475e56c6842;p=deliverable%2Flinux.git 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 Cc: Oleg Drokin Cc: hpdd-discuss Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h index 8125980089e8..43ce3a05f59b 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h @@ -64,13 +64,13 @@ /* * Sysctl register */ -#define DECLARE_PROC_HANDLER(name) \ -static int \ -LL_PROC_PROTO(name) \ -{ \ - return proc_call_handler(table->data, write, \ - ppos, buffer, lenp, \ - __##name); \ +#define DECLARE_PROC_HANDLER(name) \ +static int name(struct ctl_table *table, int write, \ + void __user *buffer, size_t *lenp, loff_t *ppos) \ +{ \ + return proc_call_handler(table->data, write, \ + ppos, buffer, lenp, \ + __##name); \ } #endif diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h b/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h index 192ad083931a..4fe072056da2 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h @@ -83,11 +83,6 @@ #define ll_proc_dolongvec(table, write, filp, 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 */ int proc_call_handler(void *data, int write, diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index ee3b3d4a214b..60b2e844a33d 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -141,7 +141,8 @@ static int __proc_lnet_stats(void *data, int write, 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; char *tmpstr; @@ -266,7 +267,8 @@ int LL_PROC_PROTO(proc_lnet_routes) 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; char *tmpstr; @@ -400,7 +402,8 @@ int LL_PROC_PROTO(proc_lnet_routers) 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; struct lnet_peer_table *ptable; @@ -626,7 +629,8 @@ static int __proc_lnet_buffers(void *data, int write, 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 rc = 0; diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c index c680def5a1f0..68e41f780e74 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c @@ -214,7 +214,8 @@ static int __proc_debug_mb(void *data, int write, 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; struct ctl_table dummy = *table; @@ -245,7 +246,8 @@ int LL_PROC_PROTO(proc_console_max_delay_cs) 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; struct ctl_table dummy = *table; @@ -276,7 +278,8 @@ int LL_PROC_PROTO(proc_console_min_delay_cs) 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; struct ctl_table dummy = *table; @@ -303,14 +306,16 @@ int LL_PROC_PROTO(proc_console_backoff) 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) LBUG(); 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; long old_fail_loc = cfs_fail_loc; diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c index 23f39de9f7ef..90dbaaddb311 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c @@ -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; @@ -89,7 +90,8 @@ int LL_PROC_PROTO(proc_set_timeout) 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]; int len; @@ -112,7 +114,8 @@ int LL_PROC_PROTO(proc_memory_alloc) 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]; int len; @@ -135,7 +138,8 @@ int LL_PROC_PROTO(proc_pages_alloc) 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]; int len; @@ -158,7 +162,8 @@ int LL_PROC_PROTO(proc_mem_max) 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]; int len; @@ -181,7 +186,8 @@ int LL_PROC_PROTO(proc_pages_max) 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; @@ -222,7 +228,8 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb) 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; @@ -252,23 +259,32 @@ int LL_PROC_PROTO(proc_alloc_fail_rate) 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); } -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); } -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); } -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); } -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); }