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/oss | |
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/oss')
-rw-r--r-- | sound/core/oss/mixer_oss.c | 5 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 54e2eb56e4c2..f50ebf20df96 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c | |||
@@ -43,6 +43,10 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file) | |||
43 | struct snd_mixer_oss_file *fmixer; | 43 | struct snd_mixer_oss_file *fmixer; |
44 | int err; | 44 | int err; |
45 | 45 | ||
46 | err = nonseekable_open(inode, file); | ||
47 | if (err < 0) | ||
48 | return err; | ||
49 | |||
46 | card = snd_lookup_oss_minor_data(iminor(inode), | 50 | card = snd_lookup_oss_minor_data(iminor(inode), |
47 | SNDRV_OSS_DEVICE_TYPE_MIXER); | 51 | SNDRV_OSS_DEVICE_TYPE_MIXER); |
48 | if (card == NULL) | 52 | if (card == NULL) |
@@ -397,6 +401,7 @@ static const struct file_operations snd_mixer_oss_f_ops = | |||
397 | .owner = THIS_MODULE, | 401 | .owner = THIS_MODULE, |
398 | .open = snd_mixer_oss_open, | 402 | .open = snd_mixer_oss_open, |
399 | .release = snd_mixer_oss_release, | 403 | .release = snd_mixer_oss_release, |
404 | .llseek = no_llseek, | ||
400 | .unlocked_ioctl = snd_mixer_oss_ioctl, | 405 | .unlocked_ioctl = snd_mixer_oss_ioctl, |
401 | .compat_ioctl = snd_mixer_oss_ioctl_compat, | 406 | .compat_ioctl = snd_mixer_oss_ioctl_compat, |
402 | }; | 407 | }; |
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 82d4e3329b3d..5c8c7dff8ede 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -2379,6 +2379,10 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) | |||
2379 | int nonblock; | 2379 | int nonblock; |
2380 | wait_queue_t wait; | 2380 | wait_queue_t wait; |
2381 | 2381 | ||
2382 | err = nonseekable_open(inode, file); | ||
2383 | if (err < 0) | ||
2384 | return err; | ||
2385 | |||
2382 | pcm = snd_lookup_oss_minor_data(iminor(inode), | 2386 | pcm = snd_lookup_oss_minor_data(iminor(inode), |
2383 | SNDRV_OSS_DEVICE_TYPE_PCM); | 2387 | SNDRV_OSS_DEVICE_TYPE_PCM); |
2384 | if (pcm == NULL) { | 2388 | if (pcm == NULL) { |
@@ -2977,6 +2981,7 @@ static const struct file_operations snd_pcm_oss_f_reg = | |||
2977 | .write = snd_pcm_oss_write, | 2981 | .write = snd_pcm_oss_write, |
2978 | .open = snd_pcm_oss_open, | 2982 | .open = snd_pcm_oss_open, |
2979 | .release = snd_pcm_oss_release, | 2983 | .release = snd_pcm_oss_release, |
2984 | .llseek = no_llseek, | ||
2980 | .poll = snd_pcm_oss_poll, | 2985 | .poll = snd_pcm_oss_poll, |
2981 | .unlocked_ioctl = snd_pcm_oss_ioctl, | 2986 | .unlocked_ioctl = snd_pcm_oss_ioctl, |
2982 | .compat_ioctl = snd_pcm_oss_ioctl_compat, | 2987 | .compat_ioctl = snd_pcm_oss_ioctl_compat, |