Lines Matching defs:sfs
114 sendfile_sync_destroy(struct sendfile_sync *sfs)
116 KASSERT(sfs->count == 0, ("sendfile sync %p still busy", sfs));
118 cv_destroy(&sfs->cv);
119 mtx_destroy(&sfs->mtx);
120 free(sfs, M_SENDFILE);
124 sendfile_sync_signal(struct sendfile_sync *sfs)
126 mtx_lock(&sfs->mtx);
127 KASSERT(sfs->count > 0, ("sendfile sync %p not busy", sfs));
128 if (--sfs->count == 0) {
129 if (!sfs->waiting) {
131 sendfile_sync_destroy(sfs);
134 cv_signal(&sfs->cv);
137 mtx_unlock(&sfs->mtx);
184 struct sendfile_sync *sfs = m->m_ext.ext_arg2;
185 sendfile_sync_signal(sfs);
209 struct sendfile_sync *sfs = m->m_ext.ext_arg1;
210 sendfile_sync_signal(sfs);
686 struct sendfile_sync *sfs;
698 sfs = NULL;
724 sfs = malloc(sizeof(*sfs), M_SENDFILE, M_WAITOK | M_ZERO);
725 mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF);
726 cv_init(&sfs->cv, "sendfile");
727 sfs->waiting = true;
1023 if (sfs != NULL) {
1026 m0->m_ext.ext_arg1 = sfs;
1027 mtx_lock(&sfs->mtx);
1028 sfs->count++;
1029 mtx_unlock(&sfs->mtx);
1101 if (sfs != NULL) {
1103 m0->m_ext.ext_arg2 = sfs;
1104 mtx_lock(&sfs->mtx);
1105 sfs->count++;
1106 mtx_unlock(&sfs->mtx);
1245 if (sfs != NULL) {
1246 mtx_lock(&sfs->mtx);
1247 if (sfs->count != 0)
1248 error = cv_wait_sig(&sfs->cv, &sfs->mtx);
1249 if (sfs->count == 0) {
1250 sendfile_sync_destroy(sfs);
1252 sfs->waiting = false;
1253 mtx_unlock(&sfs->mtx);