Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/unpcb.h
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt | * Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt | ||||
* so that changes in the sockbuf may be computed to modify | * so that changes in the sockbuf may be computed to modify | ||||
* back pressure on the sender accordingly. | * back pressure on the sender accordingly. | ||||
*/ | */ | ||||
LIST_HEAD(unp_head, unpcb); | LIST_HEAD(unp_head, unpcb); | ||||
struct unpcb { | struct unpcb { | ||||
LIST_ENTRY(unpcb) unp_link; /* glue on list of all PCBs */ | /* Cache line 1 */ | ||||
struct socket *unp_socket; /* pointer back to socket */ | struct mtx unp_mtx; /* mutex */ | ||||
struct file *unp_file; /* back-pointer to file for gc. */ | |||||
struct vnode *unp_vnode; /* if associated with file */ | |||||
ino_t unp_ino; /* fake inode number */ | |||||
struct unpcb *unp_conn; /* control block of connected socket */ | struct unpcb *unp_conn; /* control block of connected socket */ | ||||
struct unp_head unp_refs; /* referencing socket linked list */ | volatile u_int unp_refcount; | ||||
LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ | |||||
struct sockaddr_un *unp_addr; /* bound address of socket */ | |||||
unp_gen_t unp_gencnt; /* generation count of this instance */ | |||||
short unp_flags; /* flags */ | short unp_flags; /* flags */ | ||||
short unp_gcflag; /* Garbage collector flags. */ | short unp_gcflag; /* Garbage collector flags. */ | ||||
struct sockaddr_un *unp_addr; /* bound address of socket */ | |||||
struct socket *unp_socket; /* pointer back to socket */ | |||||
/* Cache line 2 */ | |||||
struct vnode *unp_vnode; /* if associated with file */ | |||||
struct xucred unp_peercred; /* peer credentials, if applicable */ | struct xucred unp_peercred; /* peer credentials, if applicable */ | ||||
u_int unp_refcount; | LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ | ||||
LIST_ENTRY(unpcb) unp_link; /* glue on list of all PCBs */ | |||||
struct unp_head unp_refs; /* referencing socket linked list */ | |||||
unp_gen_t unp_gencnt; /* generation count of this instance */ | |||||
struct file *unp_file; /* back-pointer to file for gc. */ | |||||
u_int unp_msgcount; /* references from message queue */ | u_int unp_msgcount; /* references from message queue */ | ||||
struct mtx unp_mtx; /* mutex */ | ino_t unp_ino; /* fake inode number */ | ||||
}; | } __aligned(CACHE_LINE_SIZE); | ||||
/* | /* | ||||
* Flags in unp_flags. | * Flags in unp_flags. | ||||
* | * | ||||
* UNP_HAVEPC - indicates that the unp_peercred member is filled in | * UNP_HAVEPC - indicates that the unp_peercred member is filled in | ||||
* and is really the credentials of the connected peer. This is used | * and is really the credentials of the connected peer. This is used | ||||
* to determine whether the contents should be sent to the user or | * to determine whether the contents should be sent to the user or | ||||
* not. | * not. | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |