[virtio] Consolidate vring_get_buf() by using a buffer list to add to the vring

Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
This commit is contained in:
Laurent Vivier
2008-11-19 17:28:26 +01:00
committed by Michael Brown
parent 5dd5107976
commit fc49421c7e
2 changed files with 49 additions and 40 deletions

View File

@@ -58,6 +58,11 @@ struct vring {
struct vring_used *used;
};
struct vring_list {
char *addr;
unsigned int length;
};
static inline void vring_init(struct vring *vr,
unsigned int num, unsigned char *queue)
{
@@ -90,4 +95,5 @@ static inline void vring_init(struct vring *vr,
(sizeof(struct vring_avail) + sizeof(u16) * num)) \
+ PAGE_MASK) & ~PAGE_MASK) + \
(sizeof(struct vring_used) + sizeof(struct vring_used_elem) * num))
#endif /* _VIRTIO_RING_H_ */