Normalize field naming for struct vnet, fix two debugging printfs that

print them.

Reviewed by:	bz
Approved by:	re (kensmith, kib)
This commit is contained in:
Robert Watson 2009-07-19 17:40:45 +00:00
parent 80a0e9b5f5
commit 006e9db452
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195769
4 changed files with 12 additions and 12 deletions

View File

@ -333,7 +333,8 @@ vnet_destroy(struct vnet *vnet)
struct ifnet *ifp, *nifp;
struct vnet_modlink *vml;
KASSERT(vnet->sockcnt == 0, ("%s: vnet still has sockets", __func__));
KASSERT(vnet->vnet_sockcnt == 0,
("%s: vnet still has sockets", __func__));
VNET_LIST_WLOCK();
LIST_REMOVE(vnet, vnet_le);
@ -426,14 +427,13 @@ DB_SHOW_COMMAND(vnets, db_show_vnets)
VNET_ITERATOR_DECL(vnet_iter);
#if SIZE_MAX == UINT32_MAX /* 32-bit arch */
db_printf(" vnet ifs socks");
db_printf(" vnet ifs socks\n");
#else /* 64-bit arch, most probaly... */
db_printf(" vnet ifs socks");
db_printf(" vnet ifs socks\n");
#endif
VNET_FOREACH(vnet_iter) {
db_printf("%p %3d %5d",
vnet_iter, vnet_iter->ifcnt, vnet_iter->sockcnt);
db_printf("\n");
db_printf("%p %3d %5d\n", vnet_iter, vnet_iter->vnet_ifcnt,
vnet_iter->vnet_sockcnt);
}
}
#endif

View File

@ -285,7 +285,7 @@ soalloc(struct vnet *vnet)
so->so_gencnt = ++so_gencnt;
++numopensockets;
#ifdef VIMAGE
++vnet->sockcnt; /* Locked with so_global_mtx. */
vnet->vnet_sockcnt++;
so->so_vnet = vnet;
#endif
mtx_unlock(&so_global_mtx);
@ -308,7 +308,7 @@ sodealloc(struct socket *so)
so->so_gencnt = ++so_gencnt;
--numopensockets; /* Could be below, but faster here. */
#ifdef VIMAGE
--so->so_vnet->sockcnt;
so->so_vnet->vnet_sockcnt--;
#endif
mtx_unlock(&so_global_mtx);
if (so->so_rcv.sb_hiwat)

View File

@ -593,7 +593,7 @@ if_attach_internal(struct ifnet *ifp, int vmove)
IFNET_WLOCK();
TAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link);
#ifdef VIMAGE
curvnet->ifcnt++;
curvnet->vnet_ifcnt++;
#endif
IFNET_WUNLOCK();
@ -758,7 +758,7 @@ if_detach_internal(struct ifnet *ifp, int vmove)
}
#ifdef VIMAGE
if (found)
curvnet->ifcnt--;
curvnet->vnet_ifcnt--;
#endif
IFNET_WUNLOCK();
if (!found) {

View File

@ -44,8 +44,8 @@
struct vnet {
LIST_ENTRY(vnet) vnet_le; /* all vnets list */
u_int vnet_magic_n;
u_int ifcnt;
u_int sockcnt;
u_int vnet_ifcnt;
u_int vnet_sockcnt;
void *vnet_data_mem;
uintptr_t vnet_data_base;
};