summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-core/dmxdev.c
diff options
context:
space:
mode:
authorrmcc@localhost.localdomain <rmcc@localhost.localdomain>2006-05-18 16:06:06 +0100
committerrmcc@localhost.localdomain <rmcc@localhost.localdomain>2006-05-18 16:06:06 +0100
commitaad2e973e44590acd4c1b55dd32eadad842e7fdb (patch)
treede152190bd763eb849cf2952cfb468169f3881ba /linux/drivers/media/dvb/dvb-core/dmxdev.c
parentf637ab4e875bd28b68bbd4d776c2071683050b5c (diff)
parent122bd90fa6f72e1366146662e7fb9a6581aab68e (diff)
downloadmediapointer-dvb-s2-aad2e973e44590acd4c1b55dd32eadad842e7fdb.tar.gz
mediapointer-dvb-s2-aad2e973e44590acd4c1b55dd32eadad842e7fdb.tar.bz2
merge: from master
From: Ricardo Cerqueira <v4l@cerqueira.org> merging master changes Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dmxdev.c')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dmxdev.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c
index 09e96e9dd..988499dfd 100644
--- a/linux/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c
@@ -141,12 +141,18 @@ static int dvb_dvr_open(struct inode *inode, struct file *file)
}
if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
- void *mem = vmalloc(DVR_BUFFER_SIZE);
+ void *mem;
+ if (!dvbdev->readers) {
+ mutex_unlock(&dmxdev->mutex);
+ return -EBUSY;
+ }
+ mem = vmalloc(DVR_BUFFER_SIZE);
if (!mem) {
mutex_unlock(&dmxdev->mutex);
return -ENOMEM;
}
dvb_ringbuffer_init(&dmxdev->dvr_buffer, mem, DVR_BUFFER_SIZE);
+ dvbdev->readers--;
}
if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
@@ -184,6 +190,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
dmxdev->dvr_orig_fe);
}
if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
+ dvbdev->readers++;
if (dmxdev->dvr_buffer.data) {
void *mem = dmxdev->dvr_buffer.data;
mb();
@@ -865,9 +872,6 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file,
mutex_unlock(&dmxdevfilter->mutex);
break;
- case DMX_GET_EVENT:
- break;
-
case DMX_GET_PES_PIDS:
if (!dmxdev->demux->get_pes_pids) {
ret = -EINVAL;
@@ -1029,8 +1033,7 @@ static struct file_operations dvb_dvr_fops = {
static struct dvb_device dvbdev_dvr = {
.priv = NULL,
- .users = 1,
- .writers = 1,
+ .readers = 1,
.fops = &dvb_dvr_fops
};