From: Arnd Bergmann <arnd@arndb.de>
To: linux-kernel@vger.kernel.org
Cc: John Kacur <jkacur@redhat.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Arnd Bergmann <arnd@arndb.de>, Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 7/8] soundcore_open: Reduce the area BKL coverage
Date: Sun, 4 Jul 2010 00:02:31 +0200 [thread overview]
Message-ID: <1278194552-24943-8-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1278194552-24943-1-git-send-email-arnd@arndb.de>
From: John Kacur <jkacur@redhat.com>
Most of this function is protected by the sound_loader_lock.
We can push down the BKL to this call out err = file->f_op->open(inode,file);
In order to build the sound core without the BKL, we
will need to push the lock_kernel() call into the ~20
device drivers that register their file operations.
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Alan Cox <alan@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
---
sound/sound_core.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 7c2d677..c8627fc 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -576,8 +576,6 @@ static int soundcore_open(struct inode *inode, struct file *file)
struct sound_unit *s;
const struct file_operations *new_fops = NULL;
- lock_kernel ();
-
chain=unit&0x0F;
if(chain==4 || chain==5) /* dsp/audio/dsp16 */
{
@@ -630,18 +628,23 @@ static int soundcore_open(struct inode *inode, struct file *file)
const struct file_operations *old_fops = file->f_op;
file->f_op = new_fops;
spin_unlock(&sound_loader_lock);
- if(file->f_op->open)
+
+ if (file->f_op->open) {
+ /* TODO: push down BKL into indivial open functions */
+ lock_kernel();
err = file->f_op->open(inode,file);
+ unlock_kernel();
+ }
+
if (err) {
fops_put(file->f_op);
file->f_op = fops_get(old_fops);
}
+
fops_put(old_fops);
- unlock_kernel();
return err;
}
spin_unlock(&sound_loader_lock);
- unlock_kernel();
return -ENODEV;
}
--
1.7.1
next prev parent reply other threads:[~2010-07-03 22:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-03 22:02 [PATCH 0/8] BKL removal, assorted patches Arnd Bergmann
2010-07-03 22:02 ` [PATCH 1/8] do_coredump: do not take BKL Arnd Bergmann
2010-07-09 23:25 ` Frederic Weisbecker
2010-07-03 22:02 ` [PATCH 2/8] init: remove the BKL from startup code Arnd Bergmann
2010-07-09 3:52 ` Frederic Weisbecker
2010-07-09 13:37 ` Frederic Weisbecker
2010-07-03 22:02 ` [PATCH 3/8] hpet: kill BKL, add compat_ioctl Arnd Bergmann
2010-07-03 22:02 ` [PATCH 4/8] proc/pci: kill BKL Arnd Bergmann
2010-08-13 23:33 ` Jesse Barnes
2010-07-03 22:02 ` [PATCH 5/8] dasd: no need for BKL in ioctl Arnd Bergmann
2010-07-03 22:02 ` [PATCH 6/8] isapnp: BKL removal Arnd Bergmann
2010-07-03 22:02 ` Arnd Bergmann [this message]
2010-07-05 16:09 ` [PATCH 7/8] soundcore_open: Reduce the area BKL coverage Takashi Iwai
2010-07-03 22:02 ` [PATCH 8/8] BKL: introduce CONFIG_BKL Arnd Bergmann
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=1278194552-24943-8-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=fweisbec@gmail.com \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
/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®