inpcb: allow to provide protocol specific pcb size

The protocol specific structure shall start with inpcb.

Differential revision:	https://reviews.freebsd.org/D37126
This commit is contained in:
Gleb Smirnoff
2022-12-02 14:10:55 -08:00
parent cc2be31177
commit 0aa120d52f
5 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -464,13 +464,14 @@ struct inpcbstorage {
uma_zone_t ips_zone;
uma_zone_t ips_portzone;
uma_init ips_pcbinit;
size_t ips_size;
const char * ips_zone_name;
const char * ips_portzone_name;
const char * ips_infolock_name;
const char * ips_hashlock_name;
};
#define INPCBSTORAGE_DEFINE(prot, lname, zname, iname, hname) \
#define INPCBSTORAGE_DEFINE(prot, ppcb, lname, zname, iname, hname) \
static int \
prot##_inpcb_init(void *mem, int size __unused, int flags __unused) \
{ \
@@ -480,6 +481,7 @@ prot##_inpcb_init(void *mem, int size __unused, int flags __unused) \
return (0); \
} \
static struct inpcbstorage prot = { \
.ips_size = sizeof(struct ppcb), \
.ips_pcbinit = prot##_inpcb_init, \
.ips_zone_name = zname, \
.ips_portzone_name = zname " ports", \