From 7433a5a966a5dfb5621eb7f43532ed77e8c033c3 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Sat, 2 May 2020 22:49:14 +0000 Subject: [PATCH] Start moving into EPG_/epg_ namespace. There is only one flag, but next commit brings in second flag, so let them already be in the future namespace. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 --- sys/kern/uipc_ktls.c | 4 ++-- sys/kern/uipc_mbuf.c | 2 +- sys/sys/mbuf.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 9d1174cde29a..cac7d589b679 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1545,7 +1545,7 @@ ktls_encrypt(struct mbuf_ext_pgs *pgs) * (from sendfile), anonymous wired pages are * allocated and assigned to the destination iovec. */ - is_anon = (pgs->flags & MBUF_PEXT_FLAG_ANON) != 0; + is_anon = (pgs->flags & EPG_FLAG_ANON) != 0; off = pgs->first_pg_off; for (i = 0; i < pgs->npgs; i++, off = 0) { @@ -1601,7 +1601,7 @@ ktls_encrypt(struct mbuf_ext_pgs *pgs) m->m_ext.ext_free = mb_free_mext_pgs; /* Pages are now writable. */ - pgs->flags |= MBUF_PEXT_FLAG_ANON; + pgs->flags |= EPG_FLAG_ANON; } /* diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 105e36d04377..7f54b666f971 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1678,7 +1678,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) prev->m_next = mb; prev = mb; pgs = &mb->m_ext_pgs; - pgs->flags = MBUF_PEXT_FLAG_ANON; + pgs->flags = EPG_FLAG_ANON; needed = length = MIN(maxseg, total); for (i = 0; needed > 0; i++, needed -= PAGE_SIZE) { retry_page: diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 312b74a5e54a..28667076d559 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -229,8 +229,6 @@ struct pkthdr { #define MBUF_PEXT_MAX_BYTES \ (MBUF_PEXT_MAX_PGS * PAGE_SIZE + MBUF_PEXT_HDR_LEN + MBUF_PEXT_TRAIL_LEN) -#define MBUF_PEXT_FLAG_ANON 1 /* Data can be encrypted in place. */ - struct ktls_session; struct socket; @@ -366,6 +364,7 @@ struct mbuf { uint16_t first_pg_off; uint16_t last_pg_len; uint8_t flags; +#define EPG_FLAG_ANON 0x1 /* Data can be encrypted in place. */ uint8_t record_type; uint8_t spare[2]; int enc_cnt;