diff options
| author | Joel Granados <joel.granados@kernel.org> | 2025-10-14 13:35:42 +0200 |
|---|---|---|
| committer | Joel Granados <joel.granados@kernel.org> | 2025-11-27 15:45:37 +0100 |
| commit | 4639faaa607f3bed85f2cdde686a88453c99ef06 (patch) | |
| tree | 07d794ee855f503a9732f5ffbab91a0810916698 /kernel/time | |
| parent | 54932988c4230925d2bf0023509ac2fee59a089a (diff) | |
sysctl: Move proc_doulongvec_ms_jiffies_minmax to kernel/time/jiffies.c
Move proc_doulongvec_ms_jiffies_minmax to kernel/time/jiffies.c. Create
a non static wrapper function proc_doulongvec_minmax_conv that
forwards the custom convmul and convdiv argument values to the internal
do_proc_doulongvec_minmax. Remove unused linux/times.h include from
kernel/sysctl.c.
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Diffstat (limited to 'kernel/time')
| -rw-r--r-- | kernel/time/jiffies.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c index 8e845a68382c..d31a6d40d38d 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c @@ -190,6 +190,7 @@ int proc_dointvec_ms_jiffies(const struct ctl_table *table, int dir, void *buffe return proc_dointvec_conv(table, dir, buffer, lenp, ppos, do_proc_int_conv_ms_jiffies); } +EXPORT_SYMBOL(proc_dointvec_ms_jiffies); int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int dir, void *buffer, size_t *lenp, loff_t *ppos) @@ -197,5 +198,29 @@ int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int dir, return proc_dointvec_conv(table, dir, buffer, lenp, ppos, do_proc_int_conv_ms_jiffies_minmax); } -EXPORT_SYMBOL(proc_dointvec_ms_jiffies); + +/** + * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values + * @table: the sysctl table + * @dir: %TRUE if this is a write to the sysctl file + * @buffer: the user buffer + * @lenp: the size of the user buffer + * @ppos: file position + * + * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long + * values from/to the user buffer, treated as an ASCII string. The values + * are treated as milliseconds, and converted to jiffies when they are stored. + * + * This routine will ensure the values are within the range specified by + * table->extra1 (min) and table->extra2 (max). + * + * Returns 0 on success. + */ +int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int dir, + void *buffer, size_t *lenp, loff_t *ppos) +{ + return proc_doulongvec_minmax_conv(table, dir, buffer, lenp, ppos, + HZ, 1000l); +} +EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); |
