summaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/event_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/oprofile/event_buffer.c')
-rw-r--r--drivers/oprofile/event_buffer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c
index b80318f03420..04d641714d34 100644
--- a/drivers/oprofile/event_buffer.c
+++ b/drivers/oprofile/event_buffer.c
@@ -24,7 +24,7 @@
#include "event_buffer.h"
#include "oprofile_stats.h"
-DECLARE_MUTEX(buffer_sem);
+DEFINE_MUTEX(buffer_mutex);
static unsigned long buffer_opened;
static DECLARE_WAIT_QUEUE_HEAD(buffer_wait);
@@ -32,7 +32,7 @@ static unsigned long * event_buffer;
static unsigned long buffer_size;
static unsigned long buffer_watershed;
static size_t buffer_pos;
-/* atomic_t because wait_event checks it outside of buffer_sem */
+/* atomic_t because wait_event checks it outside of buffer_mutex */
static atomic_t buffer_ready = ATOMIC_INIT(0);
/* Add an entry to the event buffer. When we
@@ -60,10 +60,10 @@ void add_event_entry(unsigned long value)
*/
void wake_up_buffer_waiter(void)
{
- down(&buffer_sem);
+ mutex_lock(&buffer_mutex);
atomic_set(&buffer_ready, 1);
wake_up(&buffer_wait);
- up(&buffer_sem);
+ mutex_unlock(&buffer_mutex);
}
@@ -162,7 +162,7 @@ static ssize_t event_buffer_read(struct file * file, char __user * buf,
if (!atomic_read(&buffer_ready))
return -EAGAIN;
- down(&buffer_sem);
+ mutex_lock(&buffer_mutex);
atomic_set(&buffer_ready, 0);
@@ -177,7 +177,7 @@ static ssize_t event_buffer_read(struct file * file, char __user * buf,
buffer_pos = 0;
out:
- up(&buffer_sem);
+ mutex_unlock(&buffer_mutex);
return retval;
}