}
if (sb->sb_flags & SB_UPCALL)
(*so->so_upcall)(so, so->so_upcallarg, M_DONTWAIT);
+ if (sb->sb_flags & SB_KNOTE &&
+ !(sb->sb_sel.si_flags & SI_INITED))
+ KNOTE(&sb->sb_sel.si_note, 0);
}
/*
kp = sotokextcb(sbtoso(sb));
while (kp) {
if (kp->e_sout && kp->e_sout->su_sbappend) {
- if ((*kp->e_sout->su_sbappend)(sb, m, kp))
+ if ((*kp->e_sout->su_sbappend)(sb, m, kp)) {
+ KERNEL_DEBUG((DBG_FNC_SBAPPEND | DBG_FUNC_END), sb, sb->sb_cc, kp, 0, 0);
return;
+ }
}
kp = kp->e_next;
}
do {
if (n->m_flags & M_EOR) {
sbappendrecord(sb, m); /* XXXXXX!!!! */
+ KERNEL_DEBUG((DBG_FNC_SBAPPEND | DBG_FUNC_END), sb, sb->sb_cc, 0, 0, 0);
return;
}
} while (n->m_next && (n = n->m_next));
kp = kp->e_next;
}
- if (sb->sb_flags & SB_LOCK)
- sb_lock(sb);
+ (void)sblock(sb, M_WAIT);
while (sb->sb_mbcnt) {
/*
* Don't call sbdrop(sb, 0) if the leading mbuf is non-empty:
}
if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt)
panic("sbflush: cc %ld || mb %p || mbcnt %ld", sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt);
+
+ sbunlock(sb);
+
postevent(0, sb, EV_RWBYTES);
}
kp = sotokextcb(sbtoso(sb));
while (kp) {
if (kp->e_sout && kp->e_sout->su_sbdrop) {
- if ((*kp->e_sout->su_sbdrop)(sb, len, kp))
+ if ((*kp->e_sout->su_sbdrop)(sb, len, kp)) {
+ KERNEL_DEBUG((DBG_FNC_SBDROP | DBG_FUNC_END), sb, len, kp, 0, 0);
return;
+ }
}
kp = kp->e_next;
}
int
sb_notify(struct sockbuf *sb)
{
- return ((sb->sb_flags & (SB_WAIT|SB_SEL|SB_ASYNC|SB_UPCALL)) != 0);
+ return ((sb->sb_flags & (SB_WAIT|SB_SEL|SB_ASYNC|SB_UPCALL|SB_KNOTE)) != 0);
}
/*