From 1d3ade00c6d3279c1e078137a3bc2fab7c6d715a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 12 Jul 2014 21:26:09 -0700 Subject: [PATCH] staging: lustre: remove proc function wrappers ll_proc_dointvec and ll_proc_dolongvec didn't do anything except confuse things due to a lack of a filep variable in the functions they were used in. So remove them and just call the real proc functions. This enabled the code to be unwound a bit and a few "empty" proc handlers were removed and just passed directly to procfs instead. Cc: Andreas Dilger Cc: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- .../linux/libcfs/linux/portals_compat25.h | 6 --- .../lustre/lustre/libcfs/linux/linux-proc.c | 14 +++---- .../lustre/obdclass/linux/linux-sysctl.c | 42 +++---------------- 3 files changed, 13 insertions(+), 49 deletions(-) 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 0728f20b499f..442d61be1c18 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h @@ -78,10 +78,4 @@ #define __cfs_fls __fls #endif -#define ll_proc_dointvec(table, write, filp, buffer, lenp, ppos) \ - proc_dointvec(table, write, buffer, lenp, ppos); - -#define ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos) \ - proc_doulongvec_minmax(table, write, buffer, lenp, ppos); - #endif /* _PORTALS_COMPAT_H */ diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c index 0732ff4ca72f..13a9266acfa0 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c @@ -243,13 +243,13 @@ int proc_console_max_delay_cs(struct ctl_table *table, int write, if (!write) { /* read */ max_delay_cs = cfs_duration_sec(libcfs_console_max_delay * 100); - rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); return rc; } /* write */ max_delay_cs = 0; - rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); if (rc < 0) return rc; if (max_delay_cs <= 0) @@ -275,13 +275,13 @@ int proc_console_min_delay_cs(struct ctl_table *table, int write, if (!write) { /* read */ min_delay_cs = cfs_duration_sec(libcfs_console_min_delay * 100); - rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); return rc; } /* write */ min_delay_cs = 0; - rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); if (rc < 0) return rc; if (min_delay_cs <= 0) @@ -306,13 +306,13 @@ int proc_console_backoff(struct ctl_table *table, int write, if (!write) { /* read */ backoff= libcfs_console_backoff; - rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); return rc; } /* write */ backoff = 0; - rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(&dummy, write, buffer, lenp, ppos); if (rc < 0) return rc; if (backoff <= 0) @@ -337,7 +337,7 @@ int proc_fail_loc(struct ctl_table *table, int write, void __user *buffer, int rc; long old_fail_loc = cfs_fail_loc; - rc = ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos); + rc = proc_doulongvec_minmax(table, write, buffer, lenp, ppos); if (old_fail_loc != cfs_fail_loc) wake_up(&cfs_race_waitq); return rc; diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c index 5a36930e8fbb..a4cd46b182d9 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c @@ -84,7 +84,7 @@ int proc_set_timeout(struct ctl_table *table, int write, void __user *buffer, { int rc; - rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(table, write, buffer, lenp, ppos); if (ldlm_timeout >= obd_timeout) ldlm_timeout = max(obd_timeout / 3, 1U); return rc; @@ -259,36 +259,6 @@ int proc_alloc_fail_rate(struct ctl_table *table, int write, return rc; } -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 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 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 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 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); -} - #ifdef CONFIG_SYSCTL static struct ctl_table obd_table[] = { { @@ -373,35 +343,35 @@ static struct ctl_table obd_table[] = { .data = &at_min, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_min + .proc_handler = &proc_dointvec, }, { .procname = "at_max", .data = &at_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_max + .proc_handler = &proc_dointvec, }, { .procname = "at_extra", .data = &at_extra, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_extra + .proc_handler = &proc_dointvec, }, { .procname = "at_early_margin", .data = &at_early_margin, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_early_margin + .proc_handler = &proc_dointvec, }, { .procname = "at_history", .data = &at_history, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_history + .proc_handler = &proc_dointvec, }, {} };