Lines Matching defs:sfs
113 sendfile_sync_destroy(struct sendfile_sync *sfs)
115 KASSERT(sfs->count == 0, ("sendfile sync %p still busy", sfs));
117 cv_destroy(&sfs->cv);
118 mtx_destroy(&sfs->mtx);
119 free(sfs, M_SENDFILE);
123 sendfile_sync_signal(struct sendfile_sync *sfs)
125 mtx_lock(&sfs->mtx);
126 KASSERT(sfs->count > 0, ("sendfile sync %p not busy", sfs));
127 if (--sfs->count == 0) {
128 if (!sfs->waiting) {
130 sendfile_sync_destroy(sfs);
133 cv_signal(&sfs->cv);
136 mtx_unlock(&sfs->mtx);
183 struct sendfile_sync *sfs = m->m_ext.ext_arg2;
184 sendfile_sync_signal(sfs);
208 struct sendfile_sync *sfs = m->m_ext.ext_arg1;
209 sendfile_sync_signal(sfs);
692 struct sendfile_sync *sfs;
704 sfs = NULL;
730 sfs = malloc(sizeof(*sfs), M_SENDFILE, M_WAITOK | M_ZERO);
731 mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF);
732 cv_init(&sfs->cv, "sendfile");
733 sfs->waiting = true;
1027 if (sfs != NULL) {
1030 m0->m_ext.ext_arg1 = sfs;
1031 mtx_lock(&sfs->mtx);
1032 sfs->count++;
1033 mtx_unlock(&sfs->mtx);
1105 if (sfs != NULL) {
1107 m0->m_ext.ext_arg2 = sfs;
1108 mtx_lock(&sfs->mtx);
1109 sfs->count++;
1110 mtx_unlock(&sfs->mtx);
1243 if (sfs != NULL) {
1244 mtx_lock(&sfs->mtx);
1245 if (sfs->count != 0)
1246 error = cv_wait_sig(&sfs->cv, &sfs->mtx);
1247 if (sfs->count == 0) {
1248 sendfile_sync_destroy(sfs);
1250 sfs->waiting = false;
1251 mtx_unlock(&sfs->mtx);