diff options
author | Nicolas Palix | 2009-07-30 17:37:23 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2009-09-15 21:01:54 +0200 |
commit | b219b3f7329d71cdd27355c8c64e65416a0096ce (patch) | |
tree | 614a6b6cd98e2d0b51529b80733a3c1b86451ecf /drivers/staging/hv/RingBuffer.c | |
parent | Staging: hv: remove duplicated osd.o inclusions (diff) | |
download | kernel-qcow2-linux-b219b3f7329d71cdd27355c8c64e65416a0096ce.tar.gz kernel-qcow2-linux-b219b3f7329d71cdd27355c8c64e65416a0096ce.tar.xz kernel-qcow2-linux-b219b3f7329d71cdd27355c8c64e65416a0096ce.zip |
Staging: hv: Replace typedef SG_BUFFER_LIST by struct scatterlist
typedef SG_BUFFER_LIST is removed and its uses are replaced by the use of
struct scatterlist.
Signed-off-by: Nicolas Palix <npalix@diku.dk>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/RingBuffer.c')
-rw-r--r-- | drivers/staging/hv/RingBuffer.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/staging/hv/RingBuffer.c b/drivers/staging/hv/RingBuffer.c index d338ce25e2b0..571f9db4160e 100644 --- a/drivers/staging/hv/RingBuffer.c +++ b/drivers/staging/hv/RingBuffer.c @@ -347,9 +347,9 @@ Description: --*/ static int RingBufferWrite( - RING_BUFFER_INFO* OutRingInfo, - SG_BUFFER_LIST SgBuffers[], - u32 SgBufferCount + RING_BUFFER_INFO *OutRingInfo, + struct scatterlist *sglist, + u32 sgcount ) { int i=0; @@ -357,15 +357,16 @@ RingBufferWrite( u32 byteAvailToRead; u32 totalBytesToWrite=0; + struct scatterlist *sg; volatile u32 nextWriteLocation; u64 prevIndices=0; unsigned long flags; DPRINT_ENTER(VMBUS); - for (i=0; i < SgBufferCount; i++) + for_each_sg(sglist, sg, sgcount, i) { - totalBytesToWrite += SgBuffers[i].Length; + totalBytesToWrite += sg->length; } totalBytesToWrite += sizeof(u64); @@ -394,21 +395,21 @@ RingBufferWrite( /* Write to the ring buffer */ nextWriteLocation = GetNextWriteLocation(OutRingInfo); - for (i=0; i < SgBufferCount; i++) + for_each_sg(sglist, sg, sgcount, i) { - nextWriteLocation = CopyToRingBuffer(OutRingInfo, - nextWriteLocation, - SgBuffers[i].Data, - SgBuffers[i].Length); + nextWriteLocation = CopyToRingBuffer(OutRingInfo, + nextWriteLocation, + sg_virt(sg), + sg->length); } /* Set previous packet start */ prevIndices = GetRingBufferIndices(OutRingInfo); nextWriteLocation = CopyToRingBuffer(OutRingInfo, - nextWriteLocation, - &prevIndices, - sizeof(u64)); + nextWriteLocation, + &prevIndices, + sizeof(u64)); /* Make sure we flush all writes before updating the writeIndex */ mb(); |