aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorUlrich Obergfell <uobergfe@redhat.com>2015-04-14 18:44:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 19:48:59 -0400
commit83a80a39075a9ded23df1e26a4b617c289077630 (patch)
treee4def1ad61fbeea79397fe811385b7beb81ad268 /kernel/watchdog.c
parentef246a216b02c604ff465b9a62bb0d2e1ea183a7 (diff)
watchdog: introduce separate handlers for parameters in /proc/sys/kernel
Separate handlers for each watchdog parameter in /proc/sys/kernel replace the proc_dowatchdog() function. Three of those handlers merely call proc_watchdog_common() with one different argument. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> Signed-off-by: Don Zickus <dzickus@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 3600a01c97a9..26002ed4c16e 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -769,6 +769,65 @@ out:
769} 769}
770 770
771/* 771/*
772 * /proc/sys/kernel/watchdog
773 */
774int proc_watchdog(struct ctl_table *table, int write,
775 void __user *buffer, size_t *lenp, loff_t *ppos)
776{
777 return proc_watchdog_common(NMI_WATCHDOG_ENABLED|SOFT_WATCHDOG_ENABLED,
778 table, write, buffer, lenp, ppos);
779}
780
781/*
782 * /proc/sys/kernel/nmi_watchdog
783 */
784int proc_nmi_watchdog(struct ctl_table *table, int write,
785 void __user *buffer, size_t *lenp, loff_t *ppos)
786{
787 return proc_watchdog_common(NMI_WATCHDOG_ENABLED,
788 table, write, buffer, lenp, ppos);
789}
790
791/*
792 * /proc/sys/kernel/soft_watchdog
793 */
794int proc_soft_watchdog(struct ctl_table *table, int write,
795 void __user *buffer, size_t *lenp, loff_t *ppos)
796{
797 return proc_watchdog_common(SOFT_WATCHDOG_ENABLED,
798 table, write, buffer, lenp, ppos);
799}
800
801/*
802 * /proc/sys/kernel/watchdog_thresh
803 */
804int proc_watchdog_thresh(struct ctl_table *table, int write,
805 void __user *buffer, size_t *lenp, loff_t *ppos)
806{
807 int err, old;
808
809 mutex_lock(&watchdog_proc_mutex);
810
811 old = ACCESS_ONCE(watchdog_thresh);
812 err = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
813
814 if (err || !write)
815 goto out;
816
817 /*
818 * Update the sample period.
819 * Restore 'watchdog_thresh' on failure.
820 */
821 set_sample_period();
822 err = proc_watchdog_update();
823 if (err)
824 watchdog_thresh = old;
825out:
826 mutex_unlock(&watchdog_proc_mutex);
827 return err;
828}
829
830/*
772 * proc handler for /proc/sys/kernel/nmi_watchdog,watchdog_thresh 831 * proc handler for /proc/sys/kernel/nmi_watchdog,watchdog_thresh
773 */ 832 */
774 833