2002-12-30 02:07:16

by Paulo Andre'

[permalink] [raw]
Subject: [PATCH] 2.5.53 : drivers/scsi/qlogicfc.c locking fixes

This is a small patch to fix the remaining deprecated
save_flags/cli/restore_flags construction in the qlogicfc.c scsi driver.

Please review.

Paulo Andre'

---

--- qlogicfc.c.orig 2002-12-29 22:07:37.000000000 +0000
+++ qlogicfc.c 2002-12-29 22:12:38.000000000 +0000
@@ -108,6 +108,8 @@

#define TRACE_BUF_LEN (32*1024)

+static spinlock_t qlogicfc_lock = SPIN_LOCK_UNLOCKED;
+
struct {
u_long next;
struct {
@@ -122,14 +124,13 @@
{ \
unsigned long flags; \
\
- save_flags(flags); \
- cli(); \
+ spin_lock_irqsave(&qlogicfc_lock, flags); \
trace.buf[trace.next].name = (w); \
trace.buf[trace.next].time = jiffies; \
trace.buf[trace.next].index = (i); \
trace.buf[trace.next].addr = (long) (a); \
trace.next = (trace.next + 1) & (TRACE_BUF_LEN - 1); \
- restore_flags(flags); \
+ spin_unlock_irqrestore(&qlogicfc_lock, flags); \
}

#else