Whamcloud - gitweb
LU-13004 lnet: remove lnet_extract_iov() 48/37848/3
authorMr NeilBrown <neilb@suse.de>
Wed, 4 Dec 2019 05:30:32 +0000 (16:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 May 2020 08:24:53 +0000 (08:24 +0000)
The only place this is called, the src kvec is
NULL with length 0, so it returns 0.
So remove it.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I72fd39d0b4330fd4f811f2ee1476a653407855b4
Reviewed-on: https://review.whamcloud.com/37848
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/include/lnet/lib-lnet.h
lnet/klnds/socklnd/socklnd_cb.c
lnet/lnet/lib-move.c

index f27b5f0..817dbda 100644 (file)
@@ -653,10 +653,6 @@ void lnet_counters_get(struct lnet_counters *counters);
 void lnet_counters_reset(void);
 
 unsigned int lnet_iov_nob(unsigned int niov, struct kvec *iov);
-int lnet_extract_iov(int dst_niov, struct kvec *dst,
-                     int src_niov, struct kvec *src,
-                     unsigned int offset, unsigned int len);
-
 unsigned int lnet_kiov_nob(unsigned int niov, struct bio_vec *iov);
 int lnet_extract_kiov(int dst_niov, struct bio_vec *dst,
                      int src_niov, struct bio_vec *src,
index 1417c13..c878b2b 100644 (file)
@@ -1392,9 +1392,7 @@ ksocknal_recv(struct lnet_ni *ni, void *private, struct lnet_msg *msg,
                conn->ksnc_rx_nkiov = 0;
                conn->ksnc_rx_kiov = NULL;
                conn->ksnc_rx_iov = conn->ksnc_rx_iov_space.iov;
-               conn->ksnc_rx_niov =
-                       lnet_extract_iov(LNET_MAX_IOV, conn->ksnc_rx_iov,
-                                        niov, NULL, offset, mlen);
+               conn->ksnc_rx_niov = 0;
        } else {
                conn->ksnc_rx_niov = 0;
                conn->ksnc_rx_iov  = NULL;
index cefc4b6..30f0d71 100644 (file)
@@ -338,54 +338,6 @@ lnet_copy_iov2iov(unsigned int ndiov, struct kvec *diov, unsigned int doffset,
 }
 EXPORT_SYMBOL(lnet_copy_iov2iov);
 
-int
-lnet_extract_iov(int dst_niov, struct kvec *dst,
-                int src_niov, struct kvec *src,
-                unsigned int offset, unsigned int len)
-{
-       /* Initialise 'dst' to the subset of 'src' starting at 'offset',
-        * for exactly 'len' bytes, and return the number of entries.
-        * NB not destructive to 'src' */
-       unsigned int    frag_len;
-       unsigned int    niov;
-
-       if (len == 0)                           /* no data => */
-               return (0);                     /* no frags */
-
-       LASSERT(src_niov > 0);
-       while (offset >= src->iov_len) {      /* skip initial frags */
-               offset -= src->iov_len;
-               src_niov--;
-               src++;
-               LASSERT(src_niov > 0);
-       }
-
-       niov = 1;
-       for (;;) {
-               LASSERT(src_niov > 0);
-               LASSERT((int)niov <= dst_niov);
-
-               frag_len = src->iov_len - offset;
-               dst->iov_base = ((char *)src->iov_base) + offset;
-
-               if (len <= frag_len) {
-                       dst->iov_len = len;
-                       return (niov);
-               }
-
-               dst->iov_len = frag_len;
-
-               len -= frag_len;
-               dst++;
-               src++;
-               niov++;
-               src_niov--;
-               offset = 0;
-       }
-}
-EXPORT_SYMBOL(lnet_extract_iov);
-
-
 unsigned int
 lnet_kiov_nob(unsigned int niov, struct bio_vec *kiov)
 {