aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-05-25 23:59:18 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-05-25 23:59:18 +0000
commitaa341db39b6373c5e242f376a3cabe6a6b99141e (patch)
tree633ffc56e163c5c55069e4a1270c8bfdbfa57057
parent3f9dac85cc8f2963026fdc2d5477acb607176a89 (diff)
downloadsrc-aa341db39b6373c5e242f376a3cabe6a6b99141e.tar.gz
src-aa341db39b6373c5e242f376a3cabe6a6b99141e.zip
Rename m_unmappedtouio() to m_unmapped_uiomove().
This function doesn't only copy data into a uio but instead is a variant of uiomove() similar to uiomove_fromphys(). Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30444
-rw-r--r--sys/kern/uipc_mbuf.c12
-rw-r--r--sys/kern/uipc_socket.c3
-rw-r--r--sys/sys/mbuf.h3
3 files changed, 10 insertions, 8 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 6a1085720a85..b9e716b411be 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -628,8 +628,8 @@ m_copyfromunmapped(const struct mbuf *m, int off, int len, caddr_t cp)
uio.uio_iovcnt = 1;
uio.uio_offset = 0;
uio.uio_rw = UIO_READ;
- error = m_unmappedtouio(m, off, &uio, len);
- KASSERT(error == 0, ("m_unmappedtouio failed: off %d, len %d", off,
+ error = m_unmapped_uiomove(m, off, &uio, len);
+ KASSERT(error == 0, ("m_unmapped_uiomove failed: off %d, len %d", off,
len));
}
@@ -1157,8 +1157,8 @@ m_copytounmapped(const struct mbuf *m, int off, int len, c_caddr_t cp)
uio.uio_iovcnt = 1;
uio.uio_offset = 0;
uio.uio_rw = UIO_WRITE;
- error = m_unmappedtouio(m, off, &uio, len);
- KASSERT(error == 0, ("m_unmappedtouio failed: off %d, len %d", off,
+ error = m_unmapped_uiomove(m, off, &uio, len);
+ KASSERT(error == 0, ("m_unmapped_uiomove failed: off %d, len %d", off,
len));
}
@@ -1899,7 +1899,7 @@ m_uiotombuf(struct uio *uio, int how, int len, int align, int flags)
* Copy data to/from an unmapped mbuf into a uio limited by len if set.
*/
int
-m_unmappedtouio(const struct mbuf *m, int m_off, struct uio *uio, int len)
+m_unmapped_uiomove(const struct mbuf *m, int m_off, struct uio *uio, int len)
{
vm_page_t pg;
int error, i, off, pglen, pgoff, seglen, segoff;
@@ -1970,7 +1970,7 @@ m_mbuftouio(struct uio *uio, const struct mbuf *m, int len)
length = min(m->m_len, total - progress);
if ((m->m_flags & M_EXTPG) != 0)
- error = m_unmappedtouio(m, 0, uio, length);
+ error = m_unmapped_uiomove(m, 0, uio, length);
else
error = uiomove(mtod(m, void *), length, uio);
if (error)
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 0ca87bfc522a..94d7782b5f0a 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -2198,7 +2198,8 @@ dontblock:
SBLASTMBUFCHK(&so->so_rcv);
SOCKBUF_UNLOCK(&so->so_rcv);
if ((m->m_flags & M_EXTPG) != 0)
- error = m_unmappedtouio(m, moff, uio, (int)len);
+ error = m_unmapped_uiomove(m, moff, uio,
+ (int)len);
else
error = uiomove(mtod(m, char *) + moff,
(int)len, uio);
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 729653fa1e55..e37b872c74fe 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -833,7 +833,6 @@ struct mbuf *m_getm2(struct mbuf *, int, int, short, int);
struct mbuf *m_getptr(struct mbuf *, int, int *);
u_int m_length(struct mbuf *, struct mbuf **);
int m_mbuftouio(struct uio *, const struct mbuf *, int);
-int m_unmappedtouio(const struct mbuf *, int, struct uio *, int);
void m_move_pkthdr(struct mbuf *, struct mbuf *);
int m_pkthdr_init(struct mbuf *, int);
struct mbuf *m_prepend(struct mbuf *, int, int);
@@ -843,6 +842,8 @@ struct mbuf *m_pullup(struct mbuf *, int);
int m_sanity(struct mbuf *, int);
struct mbuf *m_split(struct mbuf *, int, int);
struct mbuf *m_uiotombuf(struct uio *, int, int, int, int);
+int m_unmapped_uiomove(const struct mbuf *, int, struct uio *,
+ int);
struct mbuf *m_unshare(struct mbuf *, int);
int m_snd_tag_alloc(struct ifnet *,
union if_snd_tag_alloc_params *, struct m_snd_tag **);