Commit 1d3ade00 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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 <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ceeb4aef
...@@ -78,10 +78,4 @@ ...@@ -78,10 +78,4 @@
#define __cfs_fls __fls #define __cfs_fls __fls
#endif #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 */ #endif /* _PORTALS_COMPAT_H */
...@@ -243,13 +243,13 @@ int proc_console_max_delay_cs(struct ctl_table *table, int write, ...@@ -243,13 +243,13 @@ int proc_console_max_delay_cs(struct ctl_table *table, int write,
if (!write) { /* read */ if (!write) { /* read */
max_delay_cs = cfs_duration_sec(libcfs_console_max_delay * 100); 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; return rc;
} }
/* write */ /* write */
max_delay_cs = 0; 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) if (rc < 0)
return rc; return rc;
if (max_delay_cs <= 0) if (max_delay_cs <= 0)
...@@ -275,13 +275,13 @@ int proc_console_min_delay_cs(struct ctl_table *table, int write, ...@@ -275,13 +275,13 @@ int proc_console_min_delay_cs(struct ctl_table *table, int write,
if (!write) { /* read */ if (!write) { /* read */
min_delay_cs = cfs_duration_sec(libcfs_console_min_delay * 100); 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; return rc;
} }
/* write */ /* write */
min_delay_cs = 0; 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) if (rc < 0)
return rc; return rc;
if (min_delay_cs <= 0) if (min_delay_cs <= 0)
...@@ -306,13 +306,13 @@ int proc_console_backoff(struct ctl_table *table, int write, ...@@ -306,13 +306,13 @@ int proc_console_backoff(struct ctl_table *table, int write,
if (!write) { /* read */ if (!write) { /* read */
backoff= libcfs_console_backoff; backoff= libcfs_console_backoff;
rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); rc = proc_dointvec(&dummy, write, buffer, lenp, ppos);
return rc; return rc;
} }
/* write */ /* write */
backoff = 0; backoff = 0;
rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos); rc = proc_dointvec(&dummy, write, buffer, lenp, ppos);
if (rc < 0) if (rc < 0)
return rc; return rc;
if (backoff <= 0) if (backoff <= 0)
...@@ -337,7 +337,7 @@ int proc_fail_loc(struct ctl_table *table, int write, void __user *buffer, ...@@ -337,7 +337,7 @@ int proc_fail_loc(struct ctl_table *table, int write, void __user *buffer,
int rc; int rc;
long old_fail_loc = cfs_fail_loc; 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) if (old_fail_loc != cfs_fail_loc)
wake_up(&cfs_race_waitq); wake_up(&cfs_race_waitq);
return rc; return rc;
......
...@@ -84,7 +84,7 @@ int proc_set_timeout(struct ctl_table *table, int write, void __user *buffer, ...@@ -84,7 +84,7 @@ int proc_set_timeout(struct ctl_table *table, int write, void __user *buffer,
{ {
int rc; 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) if (ldlm_timeout >= obd_timeout)
ldlm_timeout = max(obd_timeout / 3, 1U); ldlm_timeout = max(obd_timeout / 3, 1U);
return rc; return rc;
...@@ -259,36 +259,6 @@ int proc_alloc_fail_rate(struct ctl_table *table, int write, ...@@ -259,36 +259,6 @@ int proc_alloc_fail_rate(struct ctl_table *table, int write,
return rc; 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 #ifdef CONFIG_SYSCTL
static struct ctl_table obd_table[] = { static struct ctl_table obd_table[] = {
{ {
...@@ -373,35 +343,35 @@ static struct ctl_table obd_table[] = { ...@@ -373,35 +343,35 @@ static struct ctl_table obd_table[] = {
.data = &at_min, .data = &at_min,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_at_min .proc_handler = &proc_dointvec,
}, },
{ {
.procname = "at_max", .procname = "at_max",
.data = &at_max, .data = &at_max,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_at_max .proc_handler = &proc_dointvec,
}, },
{ {
.procname = "at_extra", .procname = "at_extra",
.data = &at_extra, .data = &at_extra,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_at_extra .proc_handler = &proc_dointvec,
}, },
{ {
.procname = "at_early_margin", .procname = "at_early_margin",
.data = &at_early_margin, .data = &at_early_margin,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_at_early_margin .proc_handler = &proc_dointvec,
}, },
{ {
.procname = "at_history", .procname = "at_history",
.data = &at_history, .data = &at_history,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_at_history .proc_handler = &proc_dointvec,
}, },
{} {}
}; };
......
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