summaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/raw1394-private.h
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-08-16 00:11:48 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-10-15 22:21:08 +0200
commit10963ea1bd966ba46a46178c4d6abcdf3c23538d (patch)
treed11eb5adbca18c9570c28fff4dffe0f7d4d1da1c /drivers/ieee1394/raw1394-private.h
parentieee1394: sbp2: enforce s/g segment size limit (diff)
downloadlinux-10963ea1bd966ba46a46178c4d6abcdf3c23538d.tar.xz
linux-10963ea1bd966ba46a46178c4d6abcdf3c23538d.zip
ieee1394: raw1394: replace BKL by local mutex, make ioctl() and mmap() thread-safe
This removes the last usage of the Big Kernel Lock from the ieee1394 stack, i.e. from raw1394's (unlocked_)ioctl and compat_ioctl. The ioctl()s don't need to take the BKL, but they need to be serialized per struct file *. In particular, accesses to ->iso_state need to be serial. We simply use a blocking mutex for this purpose because libraw1394 does not use O_NONBLOCK. In practice, there is no lock contention anyway because most if not all libraw1394 clients use a libraw1394 handle only in a single thread. mmap() also accesses ->iso_state. Until now this was unprotected against concurrent changes by ioctls. Fix this bug while we are at it. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/raw1394-private.h')
-rw-r--r--drivers/ieee1394/raw1394-private.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ieee1394/raw1394-private.h b/drivers/ieee1394/raw1394-private.h
index a06aaad5b448..7a225a405987 100644
--- a/drivers/ieee1394/raw1394-private.h
+++ b/drivers/ieee1394/raw1394-private.h
@@ -22,6 +22,7 @@ enum raw1394_iso_state { RAW1394_ISO_INACTIVE = 0,
struct file_info {
struct list_head list;
+ struct mutex state_mutex;
enum { opened, initialized, connected } state;
unsigned int protocol_version;