Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vhost: vringh: Remove unused functions

The functions:
vringh_abandon_kern()
vringh_abandon_user()
vringh_iov_pull_kern() and
vringh_iov_push_kern()
were all added in 2013 by
commit f87d0fbb5798 ("vringh: host-side implementation of virtio rings.")
but have remained unused.

Remove them and the two helper functions they used.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Message-Id: <20250617001838.114457-3-linux@treblig.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>

authored by

Dr. David Alan Gilbert and committed by
Michael S. Tsirkin
6e9ef693 569c392e

-82
-75
drivers/vhost/vringh.c
··· 780 780 EXPORT_SYMBOL(vringh_iov_push_user); 781 781 782 782 /** 783 - * vringh_abandon_user - we've decided not to handle the descriptor(s). 784 - * @vrh: the vring. 785 - * @num: the number of descriptors to put back (ie. num 786 - * vringh_get_user() to undo). 787 - * 788 - * The next vringh_get_user() will return the old descriptor(s) again. 789 - */ 790 - void vringh_abandon_user(struct vringh *vrh, unsigned int num) 791 - { 792 - /* We only update vring_avail_event(vr) when we want to be notified, 793 - * so we haven't changed that yet. */ 794 - vrh->last_avail_idx -= num; 795 - } 796 - EXPORT_SYMBOL(vringh_abandon_user); 797 - 798 - /** 799 783 * vringh_complete_user - we've finished with descriptor, publish it. 800 784 * @vrh: the vring. 801 785 * @head: the head as filled in by vringh_getdesc_user. ··· 884 900 return 0; 885 901 } 886 902 887 - static inline int xfer_kern(const struct vringh *vrh, void *src, 888 - void *dst, size_t len) 889 - { 890 - memcpy(dst, src, len); 891 - return 0; 892 - } 893 - 894 - static inline int kern_xfer(const struct vringh *vrh, void *dst, 895 - void *src, size_t len) 896 - { 897 - memcpy(dst, src, len); 898 - return 0; 899 - } 900 - 901 903 /** 902 904 * vringh_init_kern - initialize a vringh for a kernelspace vring. 903 905 * @vrh: the vringh to initialize. ··· 967 997 return 1; 968 998 } 969 999 EXPORT_SYMBOL(vringh_getdesc_kern); 970 - 971 - /** 972 - * vringh_iov_pull_kern - copy bytes from vring_iov. 973 - * @riov: the riov as passed to vringh_getdesc_kern() (updated as we consume) 974 - * @dst: the place to copy. 975 - * @len: the maximum length to copy. 976 - * 977 - * Returns the bytes copied <= len or a negative errno. 978 - */ 979 - ssize_t vringh_iov_pull_kern(struct vringh_kiov *riov, void *dst, size_t len) 980 - { 981 - return vringh_iov_xfer(NULL, riov, dst, len, xfer_kern); 982 - } 983 - EXPORT_SYMBOL(vringh_iov_pull_kern); 984 - 985 - /** 986 - * vringh_iov_push_kern - copy bytes into vring_iov. 987 - * @wiov: the wiov as passed to vringh_getdesc_kern() (updated as we consume) 988 - * @src: the place to copy from. 989 - * @len: the maximum length to copy. 990 - * 991 - * Returns the bytes copied <= len or a negative errno. 992 - */ 993 - ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, 994 - const void *src, size_t len) 995 - { 996 - return vringh_iov_xfer(NULL, wiov, (void *)src, len, kern_xfer); 997 - } 998 - EXPORT_SYMBOL(vringh_iov_push_kern); 999 - 1000 - /** 1001 - * vringh_abandon_kern - we've decided not to handle the descriptor(s). 1002 - * @vrh: the vring. 1003 - * @num: the number of descriptors to put back (ie. num 1004 - * vringh_get_kern() to undo). 1005 - * 1006 - * The next vringh_get_kern() will return the old descriptor(s) again. 1007 - */ 1008 - void vringh_abandon_kern(struct vringh *vrh, unsigned int num) 1009 - { 1010 - /* We only update vring_avail_event(vr) when we want to be notified, 1011 - * so we haven't changed that yet. */ 1012 - vrh->last_avail_idx -= num; 1013 - } 1014 - EXPORT_SYMBOL(vringh_abandon_kern); 1015 1000 1016 1001 /** 1017 1002 * vringh_complete_kern - we've finished with descriptor, publish it.
-7
include/linux/vringh.h
··· 175 175 const struct vring_used_elem used[], 176 176 unsigned num_used); 177 177 178 - /* Pretend we've never seen descriptor (for easy error handling). */ 179 - void vringh_abandon_user(struct vringh *vrh, unsigned int num); 180 - 181 178 /* Do we need to fire the eventfd to notify the other side? */ 182 179 int vringh_need_notify_user(struct vringh *vrh); 183 180 ··· 232 235 u16 *head, 233 236 gfp_t gfp); 234 237 235 - ssize_t vringh_iov_pull_kern(struct vringh_kiov *riov, void *dst, size_t len); 236 - ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, 237 - const void *src, size_t len); 238 - void vringh_abandon_kern(struct vringh *vrh, unsigned int num); 239 238 int vringh_complete_kern(struct vringh *vrh, u16 head, u32 len); 240 239 241 240 bool vringh_notify_enable_kern(struct vringh *vrh);