From: John Kacur <jkacur@redhat.com>
To: linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>,
Christoph Hellwig <hch@infradead.org>,
Jonathan Corbet <corbet@lwn.net>,
Andrew Morton <akpm@linux-foundation.org>,
Vincent Sanders <vince@simtec.co.uk>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH RFC] [PATCH] drivers/scsi/ch.c: Remove BKL in ch_open
Date: Sun, 11 Oct 2009 15:45:16 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.0910111443400.3587@localhost.localdomain> (raw)
Locking in ch_open is covered by the spin_lock, it serializes the calls
to idr_find and scsi_device_get. The BKL appears redundant to me here.
>From b385c85bb5c2579e542cfe55475b729325eb65e1 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Sun, 11 Oct 2009 13:06:54 +0200
Subject: [PATCH] drivers/scsi/ch.c: Remove BKL in ch_open
Everything in ch_open is covered by a spin_lock, so the lock_kernel is redundant
Remove it.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
drivers/scsi/ch.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index fe11c1d..4ba8b67 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -579,19 +579,16 @@ ch_open(struct inode *inode, struct file *file)
scsi_changer *ch;
int minor = iminor(inode);
- lock_kernel();
spin_lock(&ch_index_lock);
ch = idr_find(&ch_index_idr, minor);
if (NULL == ch || scsi_device_get(ch->device)) {
spin_unlock(&ch_index_lock);
- unlock_kernel();
return -ENXIO;
}
+ file->private_data = ch;
spin_unlock(&ch_index_lock);
- file->private_data = ch;
- unlock_kernel();
return 0;
}
--
1.6.0.6
next reply other threads:[~2009-10-11 13:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-11 13:45 John Kacur [this message]
2009-10-11 14:37 ` Alan Cox
2009-10-11 15:29 ` Arjan van de Ven
2009-10-11 15:54 ` Alan Cox
2009-10-11 16:03 ` Arjan van de Ven
2009-10-11 16:14 ` Alan Cox
2009-10-11 16:19 ` Arjan van de Ven
2009-10-11 17:09 ` Jonathan Corbet
2009-10-12 13:03 ` Stefan Richter
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=alpine.LFD.2.00.0910111443400.3587@localhost.localdomain \
--to=jkacur@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=corbet@lwn.net \
--cc=fweisbec@gmail.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=vince@simtec.co.uk \
/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
all inboxes | Powered by JetHome®