Staging: hv: vmbus: Cleanup error values in ringbuffer.c

Use standard Linux errno values in ringbuffer.c and do the associated
cleanup in the clients.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
K. Y. Srinivasan 2011-08-25 09:48:58 -07:00 committed by Greg Kroah-Hartman
parent 176fb9e3f1
commit d2598f017f
4 changed files with 6 additions and 6 deletions

View file

@ -725,7 +725,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
} else { } else {
ret = blkvsc_submit_request(blkvsc_req, ret = blkvsc_submit_request(blkvsc_req,
blkvsc_request_completion); blkvsc_request_completion);
if (ret == -1) { if (ret == -EAGAIN) {
pending = 1; pending = 1;
list_add_tail(&blkvsc_req->pend_entry, list_add_tail(&blkvsc_req->pend_entry,
&blkdev->pending_list); &blkdev->pending_list);

View file

@ -565,7 +565,7 @@ static void netvsc_send_recv_completion(struct hv_device *device,
if (ret == 0) { if (ret == 0) {
/* success */ /* success */
/* no-op */ /* no-op */
} else if (ret == -1) { } else if (ret == -EAGAIN) {
/* no more room...wait a bit and attempt to retry 3 times */ /* no more room...wait a bit and attempt to retry 3 times */
retries++; retries++;
dev_err(&device->device, "unable to send receive completion pkt" dev_err(&device->device, "unable to send receive completion pkt"

View file

@ -390,7 +390,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
/* is empty since the read index == write index */ /* is empty since the read index == write index */
if (bytes_avail_towrite <= totalbytes_towrite) { if (bytes_avail_towrite <= totalbytes_towrite) {
spin_unlock_irqrestore(&outring_info->ring_lock, flags); spin_unlock_irqrestore(&outring_info->ring_lock, flags);
return -1; return -EAGAIN;
} }
/* Write to the ring buffer */ /* Write to the ring buffer */
@ -450,7 +450,7 @@ int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info,
spin_unlock_irqrestore(&Inring_info->ring_lock, flags); spin_unlock_irqrestore(&Inring_info->ring_lock, flags);
return -1; return -EAGAIN;
} }
/* Convert to byte offset */ /* Convert to byte offset */
@ -496,7 +496,7 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
if (bytes_avail_toread < buflen) { if (bytes_avail_toread < buflen) {
spin_unlock_irqrestore(&inring_info->ring_lock, flags); spin_unlock_irqrestore(&inring_info->ring_lock, flags);
return -1; return -EAGAIN;
} }
next_read_location = next_read_location =

View file

@ -578,7 +578,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
/* Invokes the vsc to start an IO */ /* Invokes the vsc to start an IO */
ret = storvsc_do_io(dev, &cmd_request->request); ret = storvsc_do_io(dev, &cmd_request->request);
if (ret == -1) { if (ret == -EAGAIN) {
/* no more space */ /* no more space */
if (cmd_request->bounce_sgl_count) { if (cmd_request->bounce_sgl_count) {