mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
scsi: vmbus: Add function to report available ring buffer to write in total ring size percentage
Netvsc has a function to calculate how much ring buffer in percentage is available to write. This function is also useful for storvsc and other vmbus devices. Define a similar function in vmbus to be used by other vmbus devices. Signed-off-by: Long Li <[email protected]> Acked-by: David S. Miller <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
parent
b6240a4df0
commit
63273cb401
2 changed files with 14 additions and 0 deletions
|
|
@ -227,6 +227,8 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
|
|||
ring_info->ring_buffer->feature_bits.value = 1;
|
||||
|
||||
ring_info->ring_size = page_cnt << PAGE_SHIFT;
|
||||
ring_info->ring_size_div10_reciprocal =
|
||||
reciprocal_value(ring_info->ring_size / 10);
|
||||
ring_info->ring_datasize = ring_info->ring_size -
|
||||
sizeof(struct hv_ring_buffer);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue