Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57204
b: refs/heads/master
c: 3006d7c
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Martin Schwidefsky committed May 31, 2007
1 parent 8329d75 commit 3d8cc76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c41d4e3e688e338418311f449a4c68f6cb8eabbb
refs/heads/master: 3006d7c67139e5173cf58986c7b6e080a893e2ac
16 changes: 8 additions & 8 deletions trunk/drivers/s390/block/dasd_eer.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/poll.h>
#include <linux/mutex.h>

#include <asm/uaccess.h>
#include <asm/semaphore.h>
#include <asm/atomic.h>
#include <asm/ebcdic.h>

Expand Down Expand Up @@ -514,7 +514,7 @@ void dasd_eer_disable(struct dasd_device *device)
* to transfer in a readbuffer, which is protected by the readbuffer_mutex.
*/
static char readbuffer[PAGE_SIZE];
static DECLARE_MUTEX(readbuffer_mutex);
static DEFINE_MUTEX(readbuffer_mutex);

static int dasd_eer_open(struct inode *inp, struct file *filp)
{
Expand Down Expand Up @@ -579,7 +579,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
struct eerbuffer *eerb;

eerb = (struct eerbuffer *) filp->private_data;
if (down_interruptible(&readbuffer_mutex))
if (mutex_lock_interruptible(&readbuffer_mutex))
return -ERESTARTSYS;

spin_lock_irqsave(&bufferlock, flags);
Expand All @@ -588,7 +588,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
/* has been deleted */
eerb->residual = 0;
spin_unlock_irqrestore(&bufferlock, flags);
up(&readbuffer_mutex);
mutex_unlock(&readbuffer_mutex);
return -EIO;
} else if (eerb->residual > 0) {
/* OK we still have a second half of a record to deliver */
Expand All @@ -602,15 +602,15 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
if (!tc) {
/* no data available */
spin_unlock_irqrestore(&bufferlock, flags);
up(&readbuffer_mutex);
mutex_unlock(&readbuffer_mutex);
if (filp->f_flags & O_NONBLOCK)
return -EAGAIN;
rc = wait_event_interruptible(
dasd_eer_read_wait_queue,
eerb->head != eerb->tail);
if (rc)
return rc;
if (down_interruptible(&readbuffer_mutex))
if (mutex_lock_interruptible(&readbuffer_mutex))
return -ERESTARTSYS;
spin_lock_irqsave(&bufferlock, flags);
}
Expand All @@ -626,11 +626,11 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
spin_unlock_irqrestore(&bufferlock, flags);

if (copy_to_user(buf, readbuffer, effective_count)) {
up(&readbuffer_mutex);
mutex_unlock(&readbuffer_mutex);
return -EFAULT;
}

up(&readbuffer_mutex);
mutex_unlock(&readbuffer_mutex);
return effective_count;
}

Expand Down

0 comments on commit 3d8cc76

Please sign in to comment.