[PATCH 5/5] ipc: Show ranges of msgmni and shmmni with CTL_FLAGS_SHOW_RANGE

From: Waiman Long
Date: Wed Mar 07 2018 - 15:35:18 EST


The CTL_FLAGS_SHOW_RANGE flag is added to the msgmni and shmmni
ctl_table entries to show their ranges. Two range table entries are
reserved for the new *_range sysctl parameters.

Signed-off-by: Waiman Long <longman@xxxxxxxxxx>
---
ipc/ipc_sysctl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 2c03f57..3b4d7cd 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -143,7 +143,7 @@ static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
.proc_handler = proc_ipc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &ipc_mni,
- .flags = CTL_FLAGS_CLAMP_RANGE,
+ .flags = CTL_FLAGS_CLAMP_RANGE|CTL_FLAGS_SHOW_RANGE,
},
{
.procname = "shm_rmid_forced",
@@ -171,7 +171,7 @@ static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
.proc_handler = proc_ipc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &ipc_mni,
- .flags = CTL_FLAGS_CLAMP_RANGE,
+ .flags = CTL_FLAGS_CLAMP_RANGE|CTL_FLAGS_SHOW_RANGE,
},
{
.procname = "auto_msgmni",
@@ -228,6 +228,7 @@ static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
.extra2 = &int_max,
},
#endif
+ CTL_RESERVE_RANGES(2)
{}
};

--
1.8.3.1