[Devel] [PATCH RHEL7 COMMIT] ve/sysctl: Introduce proc_doulongvec_minmax_virtual()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Aug 31 08:29:17 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.4
------>
commit 85474cc55aa11512b45b40bf382c620d78646992
Author: Andrey Ryabinin <aryabinin at odin.com>
Date:   Mon Aug 31 19:29:17 2015 +0400

    ve/sysctl: Introduce proc_doulongvec_minmax_virtual()
    
    proc_doulongvec_minmax_virtual() - analogous of proc_doulongvec_minmax()
    for per CT sysctls. Will be used for virtualizing aio_nr, aio_max_nr
    
    https://jira.sw.ru/browse/PSBM-29017
    
    Signed-off-by: Andrey Ryabinin <aryabinin at odin.com>
    Reviewed-by: Vladimir Davydov <vdavydov at parallels.com>
---
 include/linux/sysctl.h |  2 ++
 kernel/sysctl.c        | 11 +++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index bdcf06d..af467dc 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -60,6 +60,8 @@ extern int proc_do_large_bitmap(struct ctl_table *, int,
 
 extern int proc_dointvec_virtual(struct ctl_table *table, int write,
 		void __user *buffer, size_t *lenp, loff_t *ppos);
+extern int proc_doulongvec_minmax_virtual(struct ctl_table *table, int write,
+		void __user *buffer, size_t *lenp, loff_t *ppos);
 extern int proc_dointvec_immutable(struct ctl_table *table, int write,
 		void __user *buffer, size_t *lenp, loff_t *ppos);
 extern int proc_dostring_immutable(struct ctl_table *table, int write,
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8478a1e..1a568e7 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2727,6 +2727,17 @@ int proc_dointvec_virtual(struct ctl_table *table, int write,
 	return -EINVAL;
 }
 
+int proc_doulongvec_minmax_virtual(struct ctl_table *table, int write,
+				void __user *buffer, size_t *lenp,
+				loff_t *ppos)
+{
+	struct ctl_table tmp = *table;
+
+	if (virtual_ptr(&tmp.data, &ve0, sizeof(ve0), get_exec_env()))
+		return proc_doulongvec_minmax(&tmp, write, buffer, lenp, ppos);
+	return -EINVAL;
+}
+
 static inline bool sysctl_in_container(void)
 {
 	return !ve_is_super(get_exec_env());



More information about the Devel mailing list