diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-30 09:25:57 -0600 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-30 09:25:57 +1030 |
commit | 5f0d1d7f2286c8a02dab69f5f0bd51681fab161e (patch) | |
tree | 8989451d6a60ee9f1bae144fba042b91ce6b21a1 | |
parent | 480daab42c4dd74b3c07031ddf9031251c530c77 (diff) | |
download | linux-3.10-5f0d1d7f2286c8a02dab69f5f0bd51681fab161e.tar.gz linux-3.10-5f0d1d7f2286c8a02dab69f5f0bd51681fab161e.tar.bz2 linux-3.10-5f0d1d7f2286c8a02dab69f5f0bd51681fab161e.zip |
virtio: rename 'pagesize' arg to vring_init/vring_size
It's really the alignment desired for consumer/producer separation;
historically this x86 pagesize, but with PowerPC it'll still be x86
pagesize. And in theory lguest could choose a different value.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | include/linux/virtio_ring.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index c4a598fb382..01bf3124e31 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -83,7 +83,7 @@ struct vring { * __u16 avail_idx; * __u16 available[num]; * - * // Padding to the next page boundary. + * // Padding to the next align boundary. * char pad[]; * * // A ring of used descriptor heads with free-running index. @@ -93,19 +93,19 @@ struct vring { * }; */ static inline void vring_init(struct vring *vr, unsigned int num, void *p, - unsigned long pagesize) + unsigned long align) { vr->num = num; vr->desc = p; vr->avail = p + num*sizeof(struct vring_desc); - vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + pagesize-1) - & ~(pagesize - 1)); + vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1) + & ~(align - 1)); } -static inline unsigned vring_size(unsigned int num, unsigned long pagesize) +static inline unsigned vring_size(unsigned int num, unsigned long align) { return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) - + pagesize - 1) & ~(pagesize - 1)) + + align - 1) & ~(align - 1)) + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num; } |