int tmp_len = (TMP_BUF_LEN > bytes_left) ? bytes_left : TMP_BUF_LEN;
int tmp_read = 0;
- spin_lock_irqsave(&(stream->lock), flags);
+ palacios_spinlock_lock_irqsave(&(stream->lock), flags);
tmp_read = ringbuf_read(stream->out_ring, tmp_buf, tmp_len);
- spin_unlock_irqrestore(&(stream->lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(stream->lock), flags);
if (tmp_read == 0) {
// If userspace reads more than we have
}
- spin_lock_irqsave(&(stream->lock), flags);
+ palacios_spinlock_lock_irqsave(&(stream->lock), flags);
total_bytes_left = ringbuf_data_len(stream->out_ring);
- spin_unlock_irqrestore(&(stream->lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(stream->lock), flags);
if (total_bytes_left > 0) {
wake_up_interruptible(&(stream->intr_queue));
poll_wait(filp, &(stream->intr_queue), poll_tb);
- spin_lock_irqsave(&(stream->lock), flags);
+ palacios_spinlock_lock_irqsave(&(stream->lock), flags);
data_avail = ringbuf_data_len(stream->out_ring);
- spin_unlock_irqrestore(&(stream->lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(stream->lock), flags);
if (data_avail > 0) {
return mask;
struct stream_state * stream = filp->private_data;
unsigned long flags;
- spin_lock_irqsave(&(stream->lock), flags);
+ palacios_spinlock_lock_irqsave(&(stream->lock), flags);
stream->connected = 0;
- spin_unlock_irqrestore(&(stream->lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(stream->lock), flags);
return 0;
strncpy(stream->name, name, STREAM_NAME_LEN - 1);
init_waitqueue_head(&(stream->intr_queue));
- spin_lock_init(&(stream->lock));
+ palacios_spinlock_init(&(stream->lock));
if (guest == NULL) {
list_add(&(stream->stream_node), &(global_streams));
}
while (bytes_written < len) {
- spin_lock_irqsave(&(stream->lock), flags);
+ palacios_spinlock_lock_irqsave(&(stream->lock), flags);
bytes_written += ringbuf_write(stream->out_ring, buf + bytes_written, len - bytes_written);
- spin_unlock_irqrestore(&(stream->lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(stream->lock), flags);
wake_up_interruptible(&(stream->intr_queue));
free_ringbuf(stream->out_ring);
list_del(&(stream->stream_node));
+ palacios_spinlock_deinit(&(stream->lock));
palacios_free(stream);
}
return -EFAULT;
}
- spin_lock_irqsave(&(stream->lock), flags);
+ palacios_spinlock_lock_irqsave(&(stream->lock), flags);
if (stream->connected == 0) {
stream->connected = 1;
ret = 1;
}
- spin_unlock_irqrestore(&(stream->lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(stream->lock), flags);
if (ret == -1) {