Step 2.3: Rename mbuf_ext_pg_len() to m_epg_pagelen() that
uses mbuf argument. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598
This commit is contained in:
parent
49b6b60e22
commit
c4ee38f8e8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360575
@ -2441,7 +2441,7 @@ count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_t *nextaddr)
|
||||
}
|
||||
pgoff = m->m_ext_pgs.first_pg_off;
|
||||
for (i = 0; i < m->m_ext_pgs.npgs && len > 0; i++) {
|
||||
pglen = mbuf_ext_pg_len(&m->m_ext_pgs, i, pgoff);
|
||||
pglen = m_epg_pagelen(m, i, pgoff);
|
||||
if (off >= pglen) {
|
||||
off -= pglen;
|
||||
pgoff = 0;
|
||||
|
@ -1655,13 +1655,13 @@ write_ktlstx_sgl(void *dst, struct mbuf *m, int nsegs)
|
||||
/* Figure out the first S/G length. */
|
||||
pa = m->m_epg_pa[0] + m->m_ext_pgs.first_pg_off;
|
||||
usgl->addr0 = htobe64(pa);
|
||||
len = mbuf_ext_pg_len(&m->m_ext_pgs, 0, m->m_ext_pgs.first_pg_off);
|
||||
len = m_epg_pagelen(m, 0, m->m_ext_pgs.first_pg_off);
|
||||
pa += len;
|
||||
for (i = 1; i < m->m_ext_pgs.npgs; i++) {
|
||||
if (m->m_epg_pa[i] != pa)
|
||||
break;
|
||||
len += mbuf_ext_pg_len(&m->m_ext_pgs, i, 0);
|
||||
pa += mbuf_ext_pg_len(&m->m_ext_pgs, i, 0);
|
||||
len += m_epg_pagelen(m, i, 0);
|
||||
pa += m_epg_pagelen(m, i, 0);
|
||||
}
|
||||
usgl->len0 = htobe32(len);
|
||||
#ifdef INVARIANTS
|
||||
@ -1679,11 +1679,11 @@ write_ktlstx_sgl(void *dst, struct mbuf *m, int nsegs)
|
||||
#endif
|
||||
pa = m->m_epg_pa[i];
|
||||
usgl->sge[j / 2].addr[j & 1] = htobe64(pa);
|
||||
len = mbuf_ext_pg_len(&m->m_ext_pgs, i, 0);
|
||||
len = m_epg_pagelen(m, i, 0);
|
||||
pa += len;
|
||||
} else {
|
||||
len += mbuf_ext_pg_len(&m->m_ext_pgs, i, 0);
|
||||
pa += mbuf_ext_pg_len(&m->m_ext_pgs, i, 0);
|
||||
len += m_epg_pagelen(m, i, 0);
|
||||
pa += m_epg_pagelen(m, i, 0);
|
||||
}
|
||||
}
|
||||
if (j >= 0) {
|
||||
|
@ -983,7 +983,7 @@ _mb_unmapped_to_ext(struct mbuf *m)
|
||||
}
|
||||
pgoff = ext_pgs->first_pg_off;
|
||||
for (i = 0; i < ext_pgs->npgs && len > 0; i++) {
|
||||
pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff);
|
||||
pglen = m_epg_pagelen(m, i, pgoff);
|
||||
if (off >= pglen) {
|
||||
off -= pglen;
|
||||
pgoff = 0;
|
||||
|
@ -145,7 +145,7 @@ _bus_dmamap_load_mbuf_epg(bus_dma_tag_t dmat, bus_dmamap_t map,
|
||||
}
|
||||
pgoff = m->m_ext_pgs.first_pg_off;
|
||||
for (i = 0; i < m->m_ext_pgs.npgs && error == 0 && len > 0; i++) {
|
||||
pglen = mbuf_ext_pg_len(&m->m_ext_pgs, i, pgoff);
|
||||
pglen = m_epg_pagelen(m, i, pgoff);
|
||||
if (off >= pglen) {
|
||||
off -= pglen;
|
||||
pgoff = 0;
|
||||
|
@ -249,7 +249,7 @@ sglist_count_mbuf_epg(struct mbuf *m, size_t off, size_t len)
|
||||
nextaddr = 0;
|
||||
pgoff = m->m_ext_pgs.first_pg_off;
|
||||
for (i = 0; i < m->m_ext_pgs.npgs && len > 0; i++) {
|
||||
pglen = mbuf_ext_pg_len(&m->m_ext_pgs, i, pgoff);
|
||||
pglen = m_epg_pagelen(m, i, pgoff);
|
||||
if (off >= pglen) {
|
||||
off -= pglen;
|
||||
pgoff = 0;
|
||||
@ -406,7 +406,7 @@ sglist_append_mbuf_epg(struct sglist *sg, struct mbuf *m, size_t off,
|
||||
}
|
||||
pgoff = m->m_ext_pgs.first_pg_off;
|
||||
for (i = 0; i < m->m_ext_pgs.npgs && error == 0 && len > 0; i++) {
|
||||
pglen = mbuf_ext_pg_len(&m->m_ext_pgs, i, pgoff);
|
||||
pglen = m_epg_pagelen(m, i, pgoff);
|
||||
if (off >= pglen) {
|
||||
off -= pglen;
|
||||
pgoff = 0;
|
||||
|
@ -1550,7 +1550,7 @@ ktls_encrypt(struct mbuf *top)
|
||||
|
||||
off = pgs->first_pg_off;
|
||||
for (i = 0; i < pgs->npgs; i++, off = 0) {
|
||||
len = mbuf_ext_pg_len(pgs, i, off);
|
||||
len = m_epg_pagelen(m, i, off);
|
||||
src_iov[i].iov_len = len;
|
||||
src_iov[i].iov_base =
|
||||
(char *)(void *)PHYS_TO_DMAP(m->m_epg_pa[i]) +
|
||||
|
@ -1805,7 +1805,7 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struct uio *uio, int len)
|
||||
}
|
||||
pgoff = ext_pgs->first_pg_off;
|
||||
for (i = 0; i < ext_pgs->npgs && error == 0 && len > 0; i++) {
|
||||
pglen = mbuf_ext_pg_len(ext_pgs, i, pgoff);
|
||||
pglen = m_epg_pagelen(m, i, pgoff);
|
||||
if (off >= pglen) {
|
||||
off -= pglen;
|
||||
pgoff = 0;
|
||||
|
@ -388,12 +388,14 @@ struct mbuf {
|
||||
|
||||
#ifdef _KERNEL
|
||||
static inline int
|
||||
mbuf_ext_pg_len(struct mbuf_ext_pgs *ext_pgs, int pidx, int pgoff)
|
||||
m_epg_pagelen(const struct mbuf *m, int pidx, int pgoff)
|
||||
{
|
||||
|
||||
KASSERT(pgoff == 0 || pidx == 0,
|
||||
("page %d with non-zero offset %d in %p", pidx, pgoff, ext_pgs));
|
||||
if (pidx == ext_pgs->npgs - 1) {
|
||||
return (ext_pgs->last_pg_len);
|
||||
("page %d with non-zero offset %d in %p", pidx, pgoff, m));
|
||||
|
||||
if (pidx == m->m_ext_pgs.npgs - 1) {
|
||||
return (m->m_ext_pgs.last_pg_len);
|
||||
} else {
|
||||
return (PAGE_SIZE - pgoff);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user