diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-13 05:49:04 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-13 06:01:21 -0400 |
commit | 02f4865fa415a87de28cc8c2e4d798ff46be1cf8 (patch) | |
tree | 7d8e1087fd17e0390439ad4fe3cdd59477c3032c /sound/core/pcm_native.c | |
parent | 73029e0ff18dfac8a1aab1dc188e1e150bbe3adc (diff) |
ALSA: core - Define llseek fops
Set no_llseek to llseek file ops of each sound component (but for hwdep).
This avoids the implicit BKL invocation via generic_file_llseek() used
as default when fops.llseek is NULL.
Also call nonseekable_open() at each open ops to ensure the file flags
have no seek bit.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index cadba3087768..5b22443ed607 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -2107,7 +2107,9 @@ static int snd_pcm_open_file(struct file *file, | |||
2107 | static int snd_pcm_playback_open(struct inode *inode, struct file *file) | 2107 | static int snd_pcm_playback_open(struct inode *inode, struct file *file) |
2108 | { | 2108 | { |
2109 | struct snd_pcm *pcm; | 2109 | struct snd_pcm *pcm; |
2110 | 2110 | int err = nonseekable_open(inode, file); | |
2111 | if (err < 0) | ||
2112 | return err; | ||
2111 | pcm = snd_lookup_minor_data(iminor(inode), | 2113 | pcm = snd_lookup_minor_data(iminor(inode), |
2112 | SNDRV_DEVICE_TYPE_PCM_PLAYBACK); | 2114 | SNDRV_DEVICE_TYPE_PCM_PLAYBACK); |
2113 | return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK); | 2115 | return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK); |
@@ -2116,7 +2118,9 @@ static int snd_pcm_playback_open(struct inode *inode, struct file *file) | |||
2116 | static int snd_pcm_capture_open(struct inode *inode, struct file *file) | 2118 | static int snd_pcm_capture_open(struct inode *inode, struct file *file) |
2117 | { | 2119 | { |
2118 | struct snd_pcm *pcm; | 2120 | struct snd_pcm *pcm; |
2119 | 2121 | int err = nonseekable_open(inode, file); | |
2122 | if (err < 0) | ||
2123 | return err; | ||
2120 | pcm = snd_lookup_minor_data(iminor(inode), | 2124 | pcm = snd_lookup_minor_data(iminor(inode), |
2121 | SNDRV_DEVICE_TYPE_PCM_CAPTURE); | 2125 | SNDRV_DEVICE_TYPE_PCM_CAPTURE); |
2122 | return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE); | 2126 | return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE); |
@@ -3450,6 +3454,7 @@ const struct file_operations snd_pcm_f_ops[2] = { | |||
3450 | .aio_write = snd_pcm_aio_write, | 3454 | .aio_write = snd_pcm_aio_write, |
3451 | .open = snd_pcm_playback_open, | 3455 | .open = snd_pcm_playback_open, |
3452 | .release = snd_pcm_release, | 3456 | .release = snd_pcm_release, |
3457 | .llseek = no_llseek, | ||
3453 | .poll = snd_pcm_playback_poll, | 3458 | .poll = snd_pcm_playback_poll, |
3454 | .unlocked_ioctl = snd_pcm_playback_ioctl, | 3459 | .unlocked_ioctl = snd_pcm_playback_ioctl, |
3455 | .compat_ioctl = snd_pcm_ioctl_compat, | 3460 | .compat_ioctl = snd_pcm_ioctl_compat, |
@@ -3463,6 +3468,7 @@ const struct file_operations snd_pcm_f_ops[2] = { | |||
3463 | .aio_read = snd_pcm_aio_read, | 3468 | .aio_read = snd_pcm_aio_read, |
3464 | .open = snd_pcm_capture_open, | 3469 | .open = snd_pcm_capture_open, |
3465 | .release = snd_pcm_release, | 3470 | .release = snd_pcm_release, |
3471 | .llseek = no_llseek, | ||
3466 | .poll = snd_pcm_capture_poll, | 3472 | .poll = snd_pcm_capture_poll, |
3467 | .unlocked_ioctl = snd_pcm_capture_ioctl, | 3473 | .unlocked_ioctl = snd_pcm_capture_ioctl, |
3468 | .compat_ioctl = snd_pcm_ioctl_compat, | 3474 | .compat_ioctl = snd_pcm_ioctl_compat, |