mirror of https://github.com/torvalds/linux.git
sysctl: Wrap do_proc_douintvec with the public function proc_douintvec_conv
Make do_proc_douintvec static and export proc_douintvec_conv wrapper function for external use. This is to keep with the design in sysctl.c. Update fs/pipe.c to use the new public API. Signed-off-by: Joel Granados <joel.granados@kernel.org>
This commit is contained in:
parent
30baaeb685
commit
564195c1a3
|
|
@ -1489,8 +1489,8 @@ static SYSCTL_UINT_CONV_CUSTOM(_pipe_maxsz,
|
||||||
static int proc_dopipe_max_size(const struct ctl_table *table, int write,
|
static int proc_dopipe_max_size(const struct ctl_table *table, int write,
|
||||||
void *buffer, size_t *lenp, loff_t *ppos)
|
void *buffer, size_t *lenp, loff_t *ppos)
|
||||||
{
|
{
|
||||||
return do_proc_douintvec(table, write, buffer, lenp, ppos,
|
return proc_douintvec_conv(table, write, buffer, lenp, ppos,
|
||||||
do_proc_uint_conv_pipe_maxsz);
|
do_proc_uint_conv_pipe_maxsz);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct ctl_table fs_pipe_sysctls[] = {
|
static const struct ctl_table fs_pipe_sysctls[] = {
|
||||||
|
|
|
||||||
|
|
@ -183,14 +183,20 @@ int proc_dostring(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
||||||
int proc_dobool(const struct ctl_table *table, int write, void *buffer,
|
int proc_dobool(const struct ctl_table *table, int write, void *buffer,
|
||||||
size_t *lenp, loff_t *ppos);
|
size_t *lenp, loff_t *ppos);
|
||||||
int proc_dointvec(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
int proc_dointvec(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
||||||
|
int proc_dointvec_minmax(const struct ctl_table *table, int dir, void *buffer,
|
||||||
|
size_t *lenp, loff_t *ppos);
|
||||||
int proc_dointvec_conv(const struct ctl_table *table, int dir, void *buffer,
|
int proc_dointvec_conv(const struct ctl_table *table, int dir, void *buffer,
|
||||||
size_t *lenp, loff_t *ppos,
|
size_t *lenp, loff_t *ppos,
|
||||||
int (*conv)(bool *negp, unsigned long *u_ptr, int *k_ptr,
|
int (*conv)(bool *negp, unsigned long *u_ptr, int *k_ptr,
|
||||||
int dir, const struct ctl_table *table));
|
int dir, const struct ctl_table *table));
|
||||||
int proc_douintvec(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
int proc_douintvec(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
||||||
int proc_dointvec_minmax(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
|
||||||
int proc_douintvec_minmax(const struct ctl_table *table, int write, void *buffer,
|
int proc_douintvec_minmax(const struct ctl_table *table, int write, void *buffer,
|
||||||
size_t *lenp, loff_t *ppos);
|
size_t *lenp, loff_t *ppos);
|
||||||
|
int proc_douintvec_conv(const struct ctl_table *table, int write, void *buffer,
|
||||||
|
size_t *lenp, loff_t *ppos,
|
||||||
|
int (*conv)(unsigned long *lvalp, unsigned int *valp,
|
||||||
|
int write, const struct ctl_table *table));
|
||||||
|
|
||||||
int proc_dou8vec_minmax(const struct ctl_table *table, int write, void *buffer,
|
int proc_dou8vec_minmax(const struct ctl_table *table, int write, void *buffer,
|
||||||
size_t *lenp, loff_t *ppos);
|
size_t *lenp, loff_t *ppos);
|
||||||
int proc_doulongvec_minmax(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
int proc_doulongvec_minmax(const struct ctl_table *, int, void *, size_t *, loff_t *);
|
||||||
|
|
@ -346,11 +352,6 @@ extern struct ctl_table_header *register_sysctl_mount_point(const char *path);
|
||||||
|
|
||||||
void do_sysctl_args(void);
|
void do_sysctl_args(void);
|
||||||
bool sysctl_is_alias(char *param);
|
bool sysctl_is_alias(char *param);
|
||||||
int do_proc_douintvec(const struct ctl_table *table, int write,
|
|
||||||
void *buffer, size_t *lenp, loff_t *ppos,
|
|
||||||
int (*conv)(unsigned long *lvalp,
|
|
||||||
unsigned int *valp, int write,
|
|
||||||
const struct ctl_table *table));
|
|
||||||
|
|
||||||
extern int unaligned_enabled;
|
extern int unaligned_enabled;
|
||||||
extern int no_unaligned_warning;
|
extern int no_unaligned_warning;
|
||||||
|
|
|
||||||
|
|
@ -535,10 +535,11 @@ static int do_proc_douintvec_r(const struct ctl_table *table, void *buffer,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_proc_douintvec(const struct ctl_table *table, int dir, void *buffer,
|
static int do_proc_douintvec(const struct ctl_table *table, int dir,
|
||||||
size_t *lenp, loff_t *ppos,
|
void *buffer, size_t *lenp, loff_t *ppos,
|
||||||
int (*conv)(unsigned long *u_ptr, unsigned int *k_ptr,
|
int (*conv)(unsigned long *u_ptr,
|
||||||
int dir, const struct ctl_table *table))
|
unsigned int *k_ptr, int dir,
|
||||||
|
const struct ctl_table *table))
|
||||||
{
|
{
|
||||||
unsigned int vleft;
|
unsigned int vleft;
|
||||||
|
|
||||||
|
|
@ -567,6 +568,15 @@ int do_proc_douintvec(const struct ctl_table *table, int dir, void *buffer,
|
||||||
return do_proc_douintvec_r(table, buffer, lenp, ppos, conv);
|
return do_proc_douintvec_r(table, buffer, lenp, ppos, conv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int proc_douintvec_conv(const struct ctl_table *table, int dir, void *buffer,
|
||||||
|
size_t *lenp, loff_t *ppos,
|
||||||
|
int (*conv)(unsigned long *u_ptr, unsigned int *k_ptr,
|
||||||
|
int dir, const struct ctl_table *table))
|
||||||
|
{
|
||||||
|
return do_proc_douintvec(table, dir, buffer, lenp, ppos, conv);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* proc_dobool - read/write a bool
|
* proc_dobool - read/write a bool
|
||||||
* @table: the sysctl table
|
* @table: the sysctl table
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue