diff options
author | phk <phk@FreeBSD.org> | 2002-02-17 21:15:36 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-02-17 21:15:36 +0000 |
commit | c2a47cdbe88de50d484d2cdb605874e1168626dc (patch) | |
tree | bb7a11048d3fd2c30aa1207f05aaf1c93556e580 /sys/ufs | |
parent | 3348974369967e4687c3d229bed09683b11c7541 (diff) | |
download | FreeBSD-src-c2a47cdbe88de50d484d2cdb605874e1168626dc.zip FreeBSD-src-c2a47cdbe88de50d484d2cdb605874e1168626dc.tar.gz |
Move the stuff related to select and poll out of struct vnode.
The use of the zone allocator may or may not be overkill.
There is an XXX: over in ufs/ufs/ufs_vnops.c that jlemon may need
to revisit.
This shaves about 60 bytes of struct vnode which on my laptop means
600k less RAM used for vnodes.
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 0c934e8..b1d862d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2473,9 +2473,14 @@ ufs_kqfilter(ap) kn->kn_hook = (caddr_t)vp; - mtx_lock(&vp->v_pollinfo.vpi_lock); - SLIST_INSERT_HEAD(&vp->v_pollinfo.vpi_selinfo.si_note, kn, kn_selnext); - mtx_unlock(&vp->v_pollinfo.vpi_lock); + if (vp->v_pollinfo == NULL) { + /* XXX: call v_addpollinfo(vp) ? */ + printf("ufs_kqfilter: vnode with no v_pollinfo\n"); + return (1); + } + mtx_lock(&vp->v_pollinfo->vpi_lock); + SLIST_INSERT_HEAD(&vp->v_pollinfo->vpi_selinfo.si_note, kn, kn_selnext); + mtx_unlock(&vp->v_pollinfo->vpi_lock); return (0); } @@ -2485,10 +2490,11 @@ filt_ufsdetach(struct knote *kn) { struct vnode *vp = (struct vnode *)kn->kn_hook; - mtx_lock(&vp->v_pollinfo.vpi_lock); - SLIST_REMOVE(&vp->v_pollinfo.vpi_selinfo.si_note, + KASSERT(vp->v_pollinfo != NULL, ("Mising v_pollinfo")); + mtx_lock(&vp->v_pollinfo->vpi_lock); + SLIST_REMOVE(&vp->v_pollinfo->vpi_selinfo.si_note, kn, knote, kn_selnext); - mtx_unlock(&vp->v_pollinfo.vpi_lock); + mtx_unlock(&vp->v_pollinfo->vpi_lock); } /*ARGSUSED*/ |