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>
                } else {
                        ret = blkvsc_submit_request(blkvsc_req,
                                                    blkvsc_request_completion);
-                       if (ret == -1) {
+                       if (ret == -EAGAIN) {
                                pending = 1;
                                list_add_tail(&blkvsc_req->pend_entry,
                                              &blkdev->pending_list);
 
        if (ret == 0) {
                /* success */
                /* no-op */
-       } else if (ret == -1) {
+       } else if (ret == -EAGAIN) {
                /* no more room...wait a bit and attempt to retry 3 times */
                retries++;
                dev_err(&device->device, "unable to send receive completion pkt"
 
        /* is empty since the read index == write index */
        if (bytes_avail_towrite <= totalbytes_towrite) {
                spin_unlock_irqrestore(&outring_info->ring_lock, flags);
-               return -1;
+               return -EAGAIN;
        }
 
        /* Write to the ring buffer */
 
                spin_unlock_irqrestore(&Inring_info->ring_lock, flags);
 
-               return -1;
+               return -EAGAIN;
        }
 
        /* Convert to byte offset */
        if (bytes_avail_toread < buflen) {
                spin_unlock_irqrestore(&inring_info->ring_lock, flags);
 
-               return -1;
+               return -EAGAIN;
        }
 
        next_read_location =
 
        /* Invokes the vsc to start an IO */
        ret = storvsc_do_io(dev, &cmd_request->request);
 
-       if (ret == -1) {
+       if (ret == -EAGAIN) {
                /* no more space */
 
                if (cmd_request->bounce_sgl_count) {