diff options
author | Karsten Wiese <fzu@wemgehoertderstaat.de> | 2006-10-06 10:08:27 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-10-06 14:23:04 -0400 |
commit | a9edfc60227a1dc5c741666ff252a6055b73b184 (patch) | |
tree | 15993e126624ec9e05f33f957ee4f69bd4787220 /include/sound | |
parent | 4130d59b1ac6e32c130bd59dbce5eb30fede0197 (diff) |
[ALSA] Handle file operations during snd_card disconnects using static file->f_op
Alsa used to kmalloc one file->f_op per file per disconnecting snd_card.
This led to oopses sometimes when file->f_op was freed before __fput()
finished.
Patch adds a virtual device for disconnect: VDD.
VDD consists of:
LIST_HEAD(shutdown_files)
protected by DEFINE_SPINLOCK(shutdown_mutex)
static struct file_operations snd_shutdown_f_ops
and functions assigned to it
Additions to struct snd_monitor_file
to specify if instance is hidden by VDD or not.
A VDD's instance is
created in snd_card_disconnect() under the card->files_lock.
cleaned up in snd_card_file_remove() under the card->files_lock.
Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/core.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sound/core.h b/include/sound/core.h index b056ea925ecf..fa1ca0127bab 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -89,10 +89,10 @@ struct snd_device { | |||
89 | struct snd_monitor_file { | 89 | struct snd_monitor_file { |
90 | struct file *file; | 90 | struct file *file; |
91 | struct snd_monitor_file *next; | 91 | struct snd_monitor_file *next; |
92 | const struct file_operations *disconnected_f_op; | ||
93 | struct list_head shutdown_list; | ||
92 | }; | 94 | }; |
93 | 95 | ||
94 | struct snd_shutdown_f_ops; /* define it later in init.c */ | ||
95 | |||
96 | /* main structure for soundcard */ | 96 | /* main structure for soundcard */ |
97 | 97 | ||
98 | struct snd_card { | 98 | struct snd_card { |