From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Linus Torvalds <torvalds@transmeta.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
"David S.Miller" <davem@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>
Subject: [PATCH][RFC] spin_trylock_bh
Date: Sat, 15 Sep 2001 17:26:59 -0300 [thread overview]
Message-ID: <20010915172659.A1916@conectiva.com.br> (raw)
Hi,
Please see if this is acceptable, I noticed this while working on
the locks for NetBEUI 8) Patch is against 2.4.9, but it should apply to
latest prepatch. It was being used in the ppp code for quite some time.
- Arnaldo
Index: include/linux/spinlock.h
===================================================================
RCS file: /home/cvs/kernel-acme/include/linux/spinlock.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 spinlock.h
--- include/linux/spinlock.h 2001/08/16 21:48:34 1.1.1.2
+++ include/linux/spinlock.h 2001/09/15 20:16:44
@@ -30,6 +30,10 @@
#define write_unlock_irqrestore(lock, flags) do { write_unlock(lock); local_irq_restore(flags); } while (0)
#define write_unlock_irq(lock) do { write_unlock(lock); local_irq_enable(); } while (0)
#define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0)
+#define spin_trylock_bh(lock) ({ int __r; local_bh_disable();\
+ __r = spin_trylock(lock); \
+ if (!__r) local_bh_enable(); \
+ __r; })
#ifdef CONFIG_SMP
#include <asm/spinlock.h>
Index: drivers/net/ppp_synctty.c
===================================================================
RCS file: /home/cvs/kernel-acme/drivers/net/ppp_synctty.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 ppp_synctty.c
--- drivers/net/ppp_synctty.c 2001/08/16 21:45:05 1.1.1.2
+++ drivers/net/ppp_synctty.c 2001/09/15 20:16:47
@@ -44,13 +44,6 @@
#include <linux/init.h>
#include <asm/uaccess.h>
-#ifndef spin_trylock_bh
-#define spin_trylock_bh(lock) ({ int __r; local_bh_disable(); \
- __r = spin_trylock(lock); \
- if (!__r) local_bh_enable(); \
- __r; })
-#endif
-
#define PPP_VERSION "2.4.1"
/* Structure for storing local state. */
Index: net/ipv6/ip6_fib.c
===================================================================
RCS file: /home/cvs/kernel-acme/net/ipv6/ip6_fib.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 ip6_fib.c
--- net/ipv6/ip6_fib.c 2001/08/16 18:44:10 1.1.1.2
+++ net/ipv6/ip6_fib.c 2001/09/15 20:16:50
@@ -1192,10 +1192,8 @@
spin_lock_bh(&fib6_gc_lock);
gc_args.timeout = (int)dummy;
} else {
- local_bh_disable();
- if (!spin_trylock(&fib6_gc_lock)) {
+ if (!spin_trylock_bh(&fib6_gc_lock)) {
mod_timer(&ip6_fib_timer, jiffies + HZ);
- local_bh_enable();
return;
}
gc_args.timeout = ip6_rt_gc_interval;
next reply other threads:[~2001-09-15 20:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-15 20:26 Arnaldo Carvalho de Melo [this message]
2001-09-20 23:59 ` [PATCH][RFC] spin_trylock_bh David S. Miller
2001-09-21 0:07 ` Arnaldo Carvalho de Melo
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=20010915172659.A1916@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=torvalds@transmeta.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).