From: akpm@linux-foundation.org
To: jdike@addtoit.com, blaisorblade@yahoo.it, mm-commits@vger.kernel.org
Subject: - uml-watchdog-driver-locking.patch removed from -mm tree
Date: Sun, 11 Feb 2007 14:48:27 -0800 [thread overview]
Message-ID: <200702112248.l1BMmRhA015627@shell0.pdx.osdl.net> (raw)
The patch titled
uml: watchdog driver locking
has been removed from the -mm tree. Its filename was
uml-watchdog-driver-locking.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
Subject: uml: watchdog driver locking
From: Jeff Dike <jdike@addtoit.com>
Replace BKL use with a spinlock.
Also fix the control so that open doesn't return holding a lock.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/um/drivers/harddog_kern.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff -puN arch/um/drivers/harddog_kern.c~uml-watchdog-driver-locking arch/um/drivers/harddog_kern.c
--- a/arch/um/drivers/harddog_kern.c~uml-watchdog-driver-locking
+++ a/arch/um/drivers/harddog_kern.c
@@ -44,12 +44,13 @@
#include <linux/reboot.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
+#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include "mconsole.h"
MODULE_LICENSE("GPL");
-/* Locked by the BKL in harddog_open and harddog_release */
+static DEFINE_SPINLOCK(lock);
static int timer_alive;
static int harddog_in_fd = -1;
static int harddog_out_fd = -1;
@@ -62,12 +63,12 @@ extern int start_watchdog(int *in_fd_ret
static int harddog_open(struct inode *inode, struct file *file)
{
- int err;
+ int err = -EBUSY;
char *sock = NULL;
- lock_kernel();
+ spin_lock(&lock);
if(timer_alive)
- return -EBUSY;
+ goto err;
#ifdef CONFIG_HARDDOG_NOWAYOUT
__module_get(THIS_MODULE);
#endif
@@ -76,11 +77,15 @@ static int harddog_open(struct inode *in
sock = mconsole_notify_socket();
#endif
err = start_watchdog(&harddog_in_fd, &harddog_out_fd, sock);
- if(err) return(err);
+ if(err)
+ goto err;
timer_alive = 1;
- unlock_kernel();
+ spin_unlock(&lock);
return nonseekable_open(inode, file);
+err:
+ spin_unlock(&lock);
+ return err;
}
extern void stop_watchdog(int in_fd, int out_fd);
@@ -90,14 +95,16 @@ static int harddog_release(struct inode
/*
* Shut off the timer.
*/
- lock_kernel();
+
+ spin_lock(&lock);
stop_watchdog(harddog_in_fd, harddog_out_fd);
harddog_in_fd = -1;
harddog_out_fd = -1;
timer_alive=0;
- unlock_kernel();
+ spin_unlock(&lock);
+
return 0;
}
_
Patches currently in -mm which might be from jdike@addtoit.com are
origin.patch
uml-fix-prototypes.patch
dynamic-kernel-command-line-common.patch
dynamic-kernel-command-line-um.patch
reply other threads:[~2007-02-11 22:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200702112248.l1BMmRhA015627@shell0.pdx.osdl.net \
--to=akpm@linux-foundation.org \
--cc=blaisorblade@yahoo.it \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.