staging: lustre: remove LL_PROC_PROTO macro

This change “staging: lustre: remove LL_PROC_PROTO macro” (commit 3bdb7ce) in Linux kernel is authored by Greg Kroah-Hartman <gregkh [at] linuxfoundation.org> on Sat Jul 12 18:00:44 2014 -0700.

Description of "staging: lustre: remove LL_PROC_PROTO macro"

The change “staging: lustre: remove LL_PROC_PROTO macro” introduces changes as follows.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 3bdb7ce

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "staging: lustre: remove LL_PROC_PROTO macro"

There are 86 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 .../include/linux/libcfs/linux/linux-prim.h   | 14 +++----
 .../linux/libcfs/linux/portals_compat25.h     |  5 ---
 .../staging/lustre/lnet/lnet/router_proc.c    | 12 ++++--
 .../lustre/lustre/libcfs/linux/linux-proc.c   | 15 ++++---
 .../lustre/obdclass/linux/linux-sysctl.c      | 40 +++++++++++++------
 5 files changed, 53 insertions(+), 33 deletions(-)
 
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);
 }

The commit for this change in Linux stable tree is 3bdb7ce (patch).

Last modified: 2020/02/10