Skip to content

Commit 6e9ef69

Browse files
Dr. David Alan Gilbertmstsirkin
authored andcommitted
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 f87d0fb ("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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Eugenio Pérez <[email protected]> Tested-by: Lei Yang <[email protected]> Reviewed-by: Simon Horman <[email protected]>
1 parent 569c392 commit 6e9ef69

File tree

2 files changed

+0
-82
lines changed

2 files changed

+0
-82
lines changed

drivers/vhost/vringh.c

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -779,22 +779,6 @@ ssize_t vringh_iov_push_user(struct vringh_iov *wiov,
779779
}
780780
EXPORT_SYMBOL(vringh_iov_push_user);
781781

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-
798782
/**
799783
* vringh_complete_user - we've finished with descriptor, publish it.
800784
* @vrh: the vring.
@@ -900,20 +884,6 @@ static inline int putused_kern(const struct vringh *vrh,
900884
return 0;
901885
}
902886

903-
static inline int xfer_kern(const struct vringh *vrh, void *src,
904-
void *dst, size_t len)
905-
{
906-
memcpy(dst, src, len);
907-
return 0;
908-
}
909-
910-
static inline int kern_xfer(const struct vringh *vrh, void *dst,
911-
void *src, size_t len)
912-
{
913-
memcpy(dst, src, len);
914-
return 0;
915-
}
916-
917887
/**
918888
* vringh_init_kern - initialize a vringh for a kernelspace vring.
919889
* @vrh: the vringh to initialize.
@@ -998,51 +968,6 @@ int vringh_getdesc_kern(struct vringh *vrh,
998968
}
999969
EXPORT_SYMBOL(vringh_getdesc_kern);
1000970

1001-
/**
1002-
* vringh_iov_pull_kern - copy bytes from vring_iov.
1003-
* @riov: the riov as passed to vringh_getdesc_kern() (updated as we consume)
1004-
* @dst: the place to copy.
1005-
* @len: the maximum length to copy.
1006-
*
1007-
* Returns the bytes copied <= len or a negative errno.
1008-
*/
1009-
ssize_t vringh_iov_pull_kern(struct vringh_kiov *riov, void *dst, size_t len)
1010-
{
1011-
return vringh_iov_xfer(NULL, riov, dst, len, xfer_kern);
1012-
}
1013-
EXPORT_SYMBOL(vringh_iov_pull_kern);
1014-
1015-
/**
1016-
* vringh_iov_push_kern - copy bytes into vring_iov.
1017-
* @wiov: the wiov as passed to vringh_getdesc_kern() (updated as we consume)
1018-
* @src: the place to copy from.
1019-
* @len: the maximum length to copy.
1020-
*
1021-
* Returns the bytes copied <= len or a negative errno.
1022-
*/
1023-
ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov,
1024-
const void *src, size_t len)
1025-
{
1026-
return vringh_iov_xfer(NULL, wiov, (void *)src, len, kern_xfer);
1027-
}
1028-
EXPORT_SYMBOL(vringh_iov_push_kern);
1029-
1030-
/**
1031-
* vringh_abandon_kern - we've decided not to handle the descriptor(s).
1032-
* @vrh: the vring.
1033-
* @num: the number of descriptors to put back (ie. num
1034-
* vringh_get_kern() to undo).
1035-
*
1036-
* The next vringh_get_kern() will return the old descriptor(s) again.
1037-
*/
1038-
void vringh_abandon_kern(struct vringh *vrh, unsigned int num)
1039-
{
1040-
/* We only update vring_avail_event(vr) when we want to be notified,
1041-
* so we haven't changed that yet. */
1042-
vrh->last_avail_idx -= num;
1043-
}
1044-
EXPORT_SYMBOL(vringh_abandon_kern);
1045-
1046971
/**
1047972
* vringh_complete_kern - we've finished with descriptor, publish it.
1048973
* @vrh: the vring.

include/linux/vringh.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ int vringh_complete_multi_user(struct vringh *vrh,
175175
const struct vring_used_elem used[],
176176
unsigned num_used);
177177

178-
/* Pretend we've never seen descriptor (for easy error handling). */
179-
void vringh_abandon_user(struct vringh *vrh, unsigned int num);
180-
181178
/* Do we need to fire the eventfd to notify the other side? */
182179
int vringh_need_notify_user(struct vringh *vrh);
183180

@@ -235,10 +232,6 @@ int vringh_getdesc_kern(struct vringh *vrh,
235232
u16 *head,
236233
gfp_t gfp);
237234

238-
ssize_t vringh_iov_pull_kern(struct vringh_kiov *riov, void *dst, size_t len);
239-
ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov,
240-
const void *src, size_t len);
241-
void vringh_abandon_kern(struct vringh *vrh, unsigned int num);
242235
int vringh_complete_kern(struct vringh *vrh, u16 head, u32 len);
243236

244237
bool vringh_notify_enable_kern(struct vringh *vrh);

0 commit comments

Comments
 (0)