patch-2.4.0-test4 linux/drivers/char/softdog.c
Next file: linux/drivers/char/synclink.c
Previous file: linux/drivers/char/sbc60xxwdt.c
Back to the patch index
Back to the overall index
- Lines: 40
- Date:
Wed Jul 12 21:58:42 2000
- Orig file:
v2.4.0-test3/linux/drivers/char/softdog.c
- Orig date:
Thu May 11 15:30:07 2000
diff -u --recursive --new-file v2.4.0-test3/linux/drivers/char/softdog.c linux/drivers/char/softdog.c
@@ -37,6 +37,7 @@
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/reboot.h>
+#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/uaccess.h>
@@ -79,7 +80,9 @@
{
if(timer_alive)
return -EBUSY;
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
MOD_INC_USE_COUNT;
+#endif
/*
* Activate timer
*/
@@ -94,11 +97,12 @@
* Shut off the timer.
* Lock it in if it's a module and we defined ...NOWAYOUT
*/
+ lock_kernel();
#ifndef CONFIG_WATCHDOG_NOWAYOUT
del_timer(&watchdog_ticktock);
- MOD_DEC_USE_COUNT;
#endif
timer_alive=0;
+ unlock_kernel();
return 0;
}
@@ -146,6 +150,7 @@
static struct file_operations softdog_fops=
{
+ owner: THIS_MODULE,
write: softdog_write,
ioctl: softdog_ioctl,
open: softdog_open,
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)