]> Pileus Git - ~andy/linux/blobdiff - drivers/hv/ring_buffer.c
net/hyperv: Add flow control based on hi/low watermark
[~andy/linux] / drivers / hv / ring_buffer.c
index 8af25a097d75ae2a189d5e5aa25c1b226c849dc7..7233c88f01b8366547467215dc7c8492f03daacb 100644 (file)
 #include "hyperv_vmbus.h"
 
 
-/* #defines */
-
-
-/* Amount of space to write to */
-#define BYTES_AVAIL_TO_WRITE(r, w, z) \
-       ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))
-
-
-/*
- *
- * hv_get_ringbuffer_availbytes()
- *
- * Get number of bytes available to read and to write to
- * for the specified ring buffer
- */
-static inline void
-hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi,
-                         u32 *read, u32 *write)
-{
-       u32 read_loc, write_loc;
-
-       smp_read_barrier_depends();
-
-       /* Capture the read/write indices before they changed */
-       read_loc = rbi->ring_buffer->read_index;
-       write_loc = rbi->ring_buffer->write_index;
-
-       *write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->ring_datasize);
-       *read = rbi->ring_datasize - *write;
-}
-
 /*
  * hv_get_next_write_location()
  *