Lines Matching refs:stp

627 #define	STR_SERVICE(stp, q) {						\  argument
628 ASSERT(MUTEX_HELD(&stp->sd_qlock)); \
629 while (stp->sd_qhead != NULL) { \
630 DQ(q, stp->sd_qhead, stp->sd_qtail, q_link); \
631 ASSERT(stp->sd_nqueues > 0); \
632 stp->sd_nqueues--; \
634 mutex_exit(&stp->sd_qlock); \
636 mutex_enter(&stp->sd_qlock); \
638 ASSERT(stp->sd_nqueues == 0); \
639 ASSERT((stp->sd_qhead == NULL) && (stp->sd_qtail == NULL)); \
649 stdata_t *stp = buf; in stream_head_constructor() local
651 mutex_init(&stp->sd_lock, NULL, MUTEX_DEFAULT, NULL); in stream_head_constructor()
652 mutex_init(&stp->sd_reflock, NULL, MUTEX_DEFAULT, NULL); in stream_head_constructor()
653 mutex_init(&stp->sd_qlock, NULL, MUTEX_DEFAULT, NULL); in stream_head_constructor()
654 cv_init(&stp->sd_monitor, NULL, CV_DEFAULT, NULL); in stream_head_constructor()
655 cv_init(&stp->sd_iocmonitor, NULL, CV_DEFAULT, NULL); in stream_head_constructor()
656 cv_init(&stp->sd_refmonitor, NULL, CV_DEFAULT, NULL); in stream_head_constructor()
657 cv_init(&stp->sd_qcv, NULL, CV_DEFAULT, NULL); in stream_head_constructor()
658 cv_init(&stp->sd_zcopy_wait, NULL, CV_DEFAULT, NULL); in stream_head_constructor()
659 stp->sd_wrq = NULL; in stream_head_constructor()
668 stdata_t *stp = buf; in stream_head_destructor() local
670 mutex_destroy(&stp->sd_lock); in stream_head_destructor()
671 mutex_destroy(&stp->sd_reflock); in stream_head_destructor()
672 mutex_destroy(&stp->sd_qlock); in stream_head_destructor()
673 cv_destroy(&stp->sd_monitor); in stream_head_destructor()
674 cv_destroy(&stp->sd_iocmonitor); in stream_head_destructor()
675 cv_destroy(&stp->sd_refmonitor); in stream_head_destructor()
676 cv_destroy(&stp->sd_qcv); in stream_head_destructor()
677 cv_destroy(&stp->sd_zcopy_wait); in stream_head_destructor()
933 struct stdata *stp; in str_sendsig() local
936 stp = vp->v_stream; in str_sendsig()
938 mutex_enter(&stp->sd_lock); in str_sendsig()
939 if (stp->sd_sigflags & event) in str_sendsig()
940 strsendsig(stp->sd_siglist, event, band, error); in str_sendsig()
941 mutex_exit(&stp->sd_lock); in str_sendsig()
1625 findlinks(stdata_t *stp, int index, int type, str_stack_t *ss) in findlinks() argument
1634 qup = getendq(stp->sd_wrq); in findlinks()
1644 mnp = &ss->ss_mux_nodes[getmajor(stp->sd_vnode->v_rdev)]; in findlinks()
1729 struct stdata *stp; in mlink_file() local
1745 stp = vp->v_stream; in mlink_file()
1747 TR_I_LINK, "I_LINK/I_PLINK:stp %p", stp); in mlink_file()
1751 if (stp->sd_flag & STRHUP) { in mlink_file()
1757 if (stp->sd_strtab == NULL) { in mlink_file()
1760 if (!stp->sd_strtab->st_muxwinit) { in mlink_file()
1771 if (getmajor(stp->sd_vnode->v_rdev) >= ss->ss_devcnt) { in mlink_file()
1776 if (stp->sd_flag & STPLEX) { in mlink_file()
1791 (stpdown == stp) || (stpdown->sd_flag & in mlink_file()
1795 linkcycle(stp, stpdown, ss)) { in mlink_file()
1802 rq = getendq(stp->sd_wrq); in mlink_file()
1878 str = stp->sd_strtab; in mlink_file()
1898 error = strdoioctl(stp, &strioc, FNATIVE, in mlink_file()
1941 ldi_mlink_fp(stp, fpdown, lhlink, LINKNORMAL); in mlink_file()
1943 ldi_mlink_fp(stp, fpdown, lhlink, LINKPERSIST); in mlink_file()
1948 mux_addedge(stp, stpdown, linkp->li_lblk.l_index, ss); in mlink_file()
1955 mutex_enter(&stp->sd_lock); in mlink_file()
1956 stp->sd_flag |= STRHASLINKS; in mlink_file()
1957 mutex_exit(&stp->sd_lock); in mlink_file()
2009 munlink(stdata_t *stp, linkinfo_t *linkp, int flag, cred_t *crp, int *rvalp, in munlink() argument
2045 error = strdoioctl(stp, &strioc, FNATIVE, in munlink()
2068 mux_rmvedge(stp, linkp->li_lblk.l_index, ss); in munlink()
2231 ldi_munlink_fp(stp, fpdown, LINKNORMAL); in munlink()
2233 ldi_munlink_fp(stp, fpdown, LINKPERSIST); in munlink()
2256 munlinkall(stdata_t *stp, int flag, cred_t *crp, int *rvalp, str_stack_t *ss) in munlinkall() argument
2262 while (linkp = findlinks(stp, 0, flag, ss)) { in munlinkall()
2266 if (error = munlink(stp, linkp, flag, crp, rvalp, ss)) in munlinkall()
2351 devflg_to_qflag(struct streamtab *stp, uint32_t devflag, uint32_t *qflagp, in devflg_to_qflag() argument
2474 stp->st_rdinit->qi_minfo->mi_idname); in devflg_to_qflag()
2738 stdata_t *stp, in strmakemsg() argument
2757 error = strmakedata(iosize, uiop, stp, flag, &mpdata); in strmakemsg()
2851 stdata_t *stp, in strmakedata() argument
2857 int wroff = (int)stp->sd_wroff; in strmakedata()
2858 int tail_len = (int)stp->sd_tail; in strmakedata()
2873 maxblk = stp->sd_maxblk; in strmakedata()
2920 if (stp->sd_copyflag & STRCOPYCACHED) in strmakedata()
2934 if (stp->sd_wputdatafunc != NULL) { in strmakedata()
2937 newbp = (stp->sd_wputdatafunc)(stp->sd_vnode, in strmakedata()
2999 strwaitq(stdata_t *stp, int flag, ssize_t count, int fmode, clock_t timout, in strwaitq() argument
3009 ASSERT(MUTEX_HELD(&stp->sd_lock)); in strwaitq()
3012 sleepon = &_RD(stp->sd_wrq)->q_wait; in strwaitq()
3016 sleepon = &stp->sd_wrq->q_wait; in strwaitq()
3022 if (stp->sd_wakeq & slpflg) { in strwaitq()
3026 stp->sd_wakeq &= ~slpflg; in strwaitq()
3031 if (stp->sd_flag & errs) { in strwaitq()
3037 error = strgeterr(stp, errs, (flag & STR_PEEK)); in strwaitq()
3049 if ((flag & READWAIT) && (stp->sd_flag & SNDMREAD)) { in strwaitq()
3050 mutex_exit(&stp->sd_lock); in strwaitq()
3053 mutex_enter(&stp->sd_lock); in strwaitq()
3065 stream_willservice(stp); in strwaitq()
3066 putnext(stp->sd_wrq, mp); in strwaitq()
3067 stream_runservice(stp); in strwaitq()
3068 mutex_enter(&stp->sd_lock); in strwaitq()
3074 if (_RD(stp->sd_wrq)->q_first != NULL) { in strwaitq()
3089 stp->sd_flag |= slpflg; in strwaitq()
3092 stp, flag, count, fmode, done); in strwaitq()
3094 rval = str_cv_wait(sleepon, &stp->sd_lock, timout, flag & STR_NOSIG); in strwaitq()
3099 stp, flag, count, fmode, done); in strwaitq()
3103 stp, flag, count, fmode, done); in strwaitq()
3104 stp->sd_flag &= ~slpflg; in strwaitq()
3116 stp, flag, count, fmode, done); in strwaitq()
3129 if ((stp->sd_flag & errs) && !(flag & STR_DELAYERR)) { in strwaitq()
3130 error = strgeterr(stp, errs, (flag & STR_PEEK)); in strwaitq()
3149 straccess(struct stdata *stp, enum jcaccess mode) in straccess() argument
3156 ASSERT(mutex_owned(&stp->sd_lock)); in straccess()
3158 if (stp->sd_sidp == NULL || stp->sd_vnode->v_type == VFIFO) in straccess()
3173 if (sp->s_dev != stp->sd_vnode->v_rdev || in straccess()
3174 p->p_pgidp == stp->sd_pgidp) { in straccess()
3207 mutex_exit(&stp->sd_lock); in straccess()
3209 mutex_enter(&stp->sd_lock); in straccess()
3212 if ((mode == JCWRITE && !(stp->sd_flag & STRTOSTOP)) || in straccess()
3222 mutex_exit(&stp->sd_lock); in straccess()
3224 mutex_enter(&stp->sd_lock); in straccess()
3239 mutex_exit(&stp->sd_lock); in straccess()
3242 mutex_enter(&stp->sd_lock); in straccess()
3246 mutex_enter(&stp->sd_lock); in straccess()
3277 stdata_t *stp; in shalloc() local
3279 stp = kmem_cache_alloc(stream_head_cache, KM_SLEEP); in shalloc()
3281 stp->sd_wrq = _WR(qp); in shalloc()
3282 stp->sd_strtab = NULL; in shalloc()
3283 stp->sd_iocid = 0; in shalloc()
3284 stp->sd_mate = NULL; in shalloc()
3285 stp->sd_freezer = NULL; in shalloc()
3286 stp->sd_refcnt = 0; in shalloc()
3287 stp->sd_wakeq = 0; in shalloc()
3288 stp->sd_anchor = 0; in shalloc()
3289 stp->sd_struiowrq = NULL; in shalloc()
3290 stp->sd_struiordq = NULL; in shalloc()
3291 stp->sd_struiodnak = 0; in shalloc()
3292 stp->sd_struionak = NULL; in shalloc()
3293 stp->sd_t_audit_data = NULL; in shalloc()
3294 stp->sd_rput_opt = 0; in shalloc()
3295 stp->sd_wput_opt = 0; in shalloc()
3296 stp->sd_read_opt = 0; in shalloc()
3297 stp->sd_rprotofunc = strrput_proto; in shalloc()
3298 stp->sd_rmiscfunc = strrput_misc; in shalloc()
3299 stp->sd_rderrfunc = stp->sd_wrerrfunc = NULL; in shalloc()
3300 stp->sd_rputdatafunc = stp->sd_wputdatafunc = NULL; in shalloc()
3301 stp->sd_ciputctrl = NULL; in shalloc()
3302 stp->sd_nciputctrl = 0; in shalloc()
3303 stp->sd_qhead = NULL; in shalloc()
3304 stp->sd_qtail = NULL; in shalloc()
3305 stp->sd_servid = NULL; in shalloc()
3306 stp->sd_nqueues = 0; in shalloc()
3307 stp->sd_svcflags = 0; in shalloc()
3308 stp->sd_copyflag = 0; in shalloc()
3310 return (stp); in shalloc()
3317 shfree(stdata_t *stp) in shfree() argument
3319 ASSERT(MUTEX_NOT_HELD(&stp->sd_lock)); in shfree()
3321 stp->sd_wrq = NULL; in shfree()
3323 mutex_enter(&stp->sd_qlock); in shfree()
3324 while (stp->sd_svcflags & STRS_SCHEDULED) { in shfree()
3326 cv_wait(&stp->sd_qcv, &stp->sd_qlock); in shfree()
3328 mutex_exit(&stp->sd_qlock); in shfree()
3330 if (stp->sd_ciputctrl != NULL) { in shfree()
3331 ASSERT(stp->sd_nciputctrl == n_ciputctrl - 1); in shfree()
3332 SUMCHECK_CIPUTCTRL_COUNTS(stp->sd_ciputctrl, in shfree()
3333 stp->sd_nciputctrl, 0); in shfree()
3335 kmem_cache_free(ciputctrl_cache, stp->sd_ciputctrl); in shfree()
3336 stp->sd_ciputctrl = NULL; in shfree()
3337 stp->sd_nciputctrl = 0; in shfree()
3339 ASSERT(stp->sd_qhead == NULL); in shfree()
3340 ASSERT(stp->sd_qtail == NULL); in shfree()
3341 ASSERT(stp->sd_nqueues == 0); in shfree()
3342 kmem_cache_free(stream_head_cache, stp); in shfree()
4159 strsignal_nolock(stdata_t *stp, int sig, uchar_t band) in strsignal_nolock() argument
4161 ASSERT(MUTEX_HELD(&stp->sd_lock)); in strsignal_nolock()
4164 if (stp->sd_sigflags & S_MSG) in strsignal_nolock()
4165 strsendsig(stp->sd_siglist, S_MSG, band, 0); in strsignal_nolock()
4168 if (stp->sd_pgidp) in strsignal_nolock()
4169 pgsignal(stp->sd_pgidp, sig); in strsignal_nolock()
4175 strsignal(stdata_t *stp, int sig, int32_t band) in strsignal() argument
4178 "strsignal:%p, %X, %X", stp, sig, band); in strsignal()
4180 mutex_enter(&stp->sd_lock); in strsignal()
4183 if (stp->sd_sigflags & S_MSG) in strsignal()
4184 strsendsig(stp->sd_siglist, S_MSG, (uchar_t)band, 0); in strsignal()
4188 if (stp->sd_pgidp) { in strsignal()
4189 pgsignal(stp->sd_pgidp, sig); in strsignal()
4193 mutex_exit(&stp->sd_lock); in strsignal()
4197 strhup(stdata_t *stp) in strhup() argument
4199 ASSERT(mutex_owned(&stp->sd_lock)); in strhup()
4200 pollwakeup(&stp->sd_pollist, POLLHUP); in strhup()
4201 if (stp->sd_sigflags & S_HANGUP) in strhup()
4202 strsendsig(stp->sd_siglist, S_HANGUP, 0, 0); in strhup()
4274 strgeterr(stdata_t *stp, int32_t flags_to_check, int ispeek) in strgeterr() argument
4276 int32_t sd_flag = stp->sd_flag & flags_to_check; in strgeterr()
4279 ASSERT(MUTEX_HELD(&stp->sd_lock)); in strgeterr()
4284 error = stp->sd_rerror; in strgeterr()
4285 if ((stp->sd_flag & STRDERRNONPERSIST) && !ispeek) { in strgeterr()
4290 stp->sd_rerror = 0; in strgeterr()
4291 stp->sd_flag &= ~STRDERR; in strgeterr()
4293 if (error == 0 && stp->sd_rderrfunc != NULL) { in strgeterr()
4296 error = (*stp->sd_rderrfunc)(stp->sd_vnode, ispeek, in strgeterr()
4299 stp->sd_flag &= ~STRDERR; in strgeterr()
4300 stp->sd_rderrfunc = NULL; in strgeterr()
4304 error = stp->sd_werror; in strgeterr()
4305 if ((stp->sd_flag & STWRERRNONPERSIST) && !ispeek) { in strgeterr()
4310 stp->sd_werror = 0; in strgeterr()
4311 stp->sd_flag &= ~STWRERR; in strgeterr()
4313 if (error == 0 && stp->sd_wrerrfunc != NULL) { in strgeterr()
4316 error = (*stp->sd_wrerrfunc)(stp->sd_vnode, ispeek, in strgeterr()
4319 stp->sd_flag &= ~STWRERR; in strgeterr()
4320 stp->sd_wrerrfunc = NULL; in strgeterr()
4325 error = stp->sd_werror; in strgeterr()
4336 strstartplumb(stdata_t *stp, int flag, int cmd) in strstartplumb() argument
4341 if (STRMATED(stp)) { in strstartplumb()
4342 struct stdata *stmatep = stp->sd_mate; in strstartplumb()
4344 STRLOCKMATES(stp); in strstartplumb()
4350 STRUNLOCKMATES(stp); in strstartplumb()
4354 mutex_exit(&stp->sd_lock); in strstartplumb()
4361 STRLOCKMATES(stp); in strstartplumb()
4363 while (stp->sd_flag & (STWOPEN|STRCLOSE|STRPLUMB)) { in strstartplumb()
4366 STRUNLOCKMATES(stp); in strstartplumb()
4371 if (!cv_wait_sig(&stp->sd_monitor, in strstartplumb()
4372 &stp->sd_lock)) { in strstartplumb()
4373 mutex_exit(&stp->sd_lock); in strstartplumb()
4376 mutex_exit(&stp->sd_lock); in strstartplumb()
4377 STRLOCKMATES(stp); in strstartplumb()
4379 if (stp->sd_flag & (STRDERR|STWRERR|STRHUP|STPLEX)) { in strstartplumb()
4380 error = strgeterr(stp, in strstartplumb()
4383 STRUNLOCKMATES(stp); in strstartplumb()
4388 stp->sd_flag |= STRPLUMB; in strstartplumb()
4389 STRUNLOCKMATES(stp); in strstartplumb()
4391 mutex_enter(&stp->sd_lock); in strstartplumb()
4392 while (stp->sd_flag & (STWOPEN|STRCLOSE|STRPLUMB)) { in strstartplumb()
4395 mutex_exit(&stp->sd_lock); in strstartplumb()
4398 if (!cv_wait_sig(&stp->sd_monitor, &stp->sd_lock)) { in strstartplumb()
4399 mutex_exit(&stp->sd_lock); in strstartplumb()
4402 if (stp->sd_flag & (STRDERR|STWRERR|STRHUP|STPLEX)) { in strstartplumb()
4403 error = strgeterr(stp, in strstartplumb()
4406 mutex_exit(&stp->sd_lock); in strstartplumb()
4411 stp->sd_flag |= STRPLUMB; in strstartplumb()
4412 mutex_exit(&stp->sd_lock); in strstartplumb()
4421 strendplumb(stdata_t *stp) in strendplumb() argument
4423 ASSERT(MUTEX_HELD(&stp->sd_lock)); in strendplumb()
4424 ASSERT(stp->sd_flag & STRPLUMB); in strendplumb()
4425 stp->sd_flag &= ~STRPLUMB; in strendplumb()
4426 cv_broadcast(&stp->sd_monitor); in strendplumb()
4559 strlock(struct stdata *stp, sqlist_t *sqlist) in strlock() argument
4566 if (STRMATED(stp)) { in strlock()
4569 STRLOCKMATES(stp); in strlock()
4579 if (&(stp->sd_lock) > &((stp->sd_mate)->sd_lock)) { in strlock()
4580 stp1 = stp; in strlock()
4581 stp2 = stp->sd_mate; in strlock()
4583 stp2 = stp; in strlock()
4584 stp1 = stp->sd_mate; in strlock()
4588 STRUNLOCKMATES(stp); in strlock()
4595 STRUNLOCKMATES(stp); in strlock()
4604 mutex_enter(&stp->sd_lock); in strlock()
4605 mutex_enter(&stp->sd_reflock); in strlock()
4606 while (stp->sd_refcnt > 0) { in strlock()
4607 mutex_exit(&stp->sd_lock); in strlock()
4608 cv_wait(&stp->sd_refmonitor, &stp->sd_reflock); in strlock()
4609 if (mutex_tryenter(&stp->sd_lock) == 0) { in strlock()
4610 mutex_exit(&stp->sd_reflock); in strlock()
4611 mutex_enter(&stp->sd_lock); in strlock()
4612 mutex_enter(&stp->sd_reflock); in strlock()
4615 STREAM_PUTLOCKS_ENTER(stp); in strlock()
4634 if (STRMATED(stp)) { in strlock()
4635 STREAM_PUTLOCKS_EXIT(stp); in strlock()
4636 STREAM_PUTLOCKS_EXIT(stp->sd_mate); in strlock()
4637 STRUNLOCKMATES(stp); in strlock()
4638 mutex_exit(&stp->sd_reflock); in strlock()
4639 mutex_exit(&stp->sd_mate->sd_reflock); in strlock()
4641 STREAM_PUTLOCKS_EXIT(stp); in strlock()
4642 mutex_exit(&stp->sd_lock); in strlock()
4643 mutex_exit(&stp->sd_reflock); in strlock()
4682 strunlock(struct stdata *stp, sqlist_t *sqlist) in strunlock() argument
4686 if (STRMATED(stp)) { in strunlock()
4687 STREAM_PUTLOCKS_EXIT(stp); in strunlock()
4688 STREAM_PUTLOCKS_EXIT(stp->sd_mate); in strunlock()
4689 STRUNLOCKMATES(stp); in strunlock()
4690 mutex_exit(&stp->sd_reflock); in strunlock()
4691 mutex_exit(&stp->sd_mate->sd_reflock); in strunlock()
4693 STREAM_PUTLOCKS_EXIT(stp); in strunlock()
4694 mutex_exit(&stp->sd_lock); in strunlock()
4695 mutex_exit(&stp->sd_reflock); in strunlock()
4746 insertq(struct stdata *stp, queue_t *new) in insertq() argument
4754 ASSERT(stp->sd_vnode->v_type != VFIFO); in insertq()
4758 after = _RD(stp->sd_wrq); in insertq()
4759 wafter = stp->sd_wrq; in insertq()
4767 strlock(stp, NULL); in insertq()
4801 strsetuio(stp); in insertq()
4807 stp->sd_pushcnt++; in insertq()
4809 strunlock(stp, NULL); in insertq()
4855 struct stdata *stp = STREAM(qp); in removeq() local
4862 ASSERT(stp); in removeq()
4915 sqlist = sqlist_build(qp, stp, STRMATED(stp)); in removeq()
4916 strlock(stp, sqlist); in removeq()
4924 stp->sd_wrq->q_next = _RD(stp->sd_wrq); in removeq()
4936 ASSERT(_SAMESTR(stp->sd_wrq) == O_SAMESTR(stp->sd_wrq)); in removeq()
4937 ASSERT(_SAMESTR(_RD(stp->sd_wrq)) == O_SAMESTR(_RD(stp->sd_wrq))); in removeq()
4953 strsetuio(stp); in removeq()
4959 stp->sd_pushcnt--; in removeq()
4961 strunlock(stp, sqlist); in removeq()
5204 sqlist_build(queue_t *q, struct stdata *stp, boolean_t do_twist) in sqlist_build() argument
5206 sqlist_t *sqlist = sqlist_alloc(stp, KM_SLEEP); in sqlist_build()
5216 sqlist_insertall(sqlist, stp->sd_wrq); in sqlist_build()
5218 sqlist_insertall(sqlist, stp->sd_mate->sd_wrq); in sqlist_build()
5224 sqlist_alloc(struct stdata *stp, int kmflag) in sqlist_alloc() argument
5234 sqlist_size = 2 * sizeof (syncql_t) * stp->sd_pushcnt + in sqlist_alloc()
5236 if (STRMATED(stp)) in sqlist_alloc()
5237 sqlist_size += 2 * sizeof (syncql_t) * stp->sd_mate->sd_pushcnt; in sqlist_alloc()
5263 struct stdata *stp; in strblock() local
5269 stp = STREAM(q); in strblock()
5270 ASSERT(stp != NULL); in strblock()
5276 sqlist = sqlist_build(q, stp, B_FALSE); in strblock()
5288 struct stdata *stp; in strunblock() local
5303 stp = STREAM(q); in strunblock()
5304 ASSERT(stp != NULL); in strunblock()
5305 sqlist = sqlist_build(q, stp, B_FALSE); in strunblock()
5619 struct stdata *stp = STREAM(qp); in claimstr() local
5621 mutex_enter(&stp->sd_reflock); in claimstr()
5622 stp->sd_refcnt++; in claimstr()
5623 ASSERT(stp->sd_refcnt != 0); /* Wraparound */ in claimstr()
5624 mutex_exit(&stp->sd_reflock); in claimstr()
5633 struct stdata *stp = STREAM(qp); in releasestr() local
5635 mutex_enter(&stp->sd_reflock); in releasestr()
5636 ASSERT(stp->sd_refcnt != 0); in releasestr()
5637 if (--stp->sd_refcnt == 0) in releasestr()
5638 cv_broadcast(&stp->sd_refmonitor); in releasestr()
5639 mutex_exit(&stp->sd_reflock); in releasestr()
7752 strsetuio(stdata_t *stp) in strsetuio() argument
7756 if (stp->sd_flag & STPLEX) { in strsetuio()
7760 stp->sd_struiowrq = NULL; in strsetuio()
7761 stp->sd_struiordq = NULL; in strsetuio()
7768 wrq = stp->sd_wrq->q_next; in strsetuio()
7782 stp->sd_struiowrq = wrq; in strsetuio()
7787 wrq = stp->sd_wrq->q_next; in strsetuio()
7801 stp->sd_struiordq = wrq ? _RD(wrq) : 0; in strsetuio()
7948 struct stdata *stp = vp->v_stream; in strwaitmark() local
7949 queue_t *rq = _RD(stp->sd_wrq); in strwaitmark()
7952 mutex_enter(&stp->sd_lock); in strwaitmark()
7954 !(stp->sd_flag & (STRATMARK|STRNOTATMARK|STREOF))) { in strwaitmark()
7955 stp->sd_flag |= RSLEEP; in strwaitmark()
7958 if (str_cv_wait(&rq->q_wait, &stp->sd_lock, 100, 1) == -1) { in strwaitmark()
7959 mutex_exit(&stp->sd_lock); in strwaitmark()
7963 if (stp->sd_flag & STRATMARK) in strwaitmark()
7970 mutex_exit(&stp->sd_lock); in strwaitmark()
7982 struct stdata *stp = vp->v_stream; in strsetrerror() local
7984 mutex_enter(&stp->sd_lock); in strsetrerror()
7985 stp->sd_rerror = error; in strsetrerror()
7987 stp->sd_flag &= ~STRDERR; in strsetrerror()
7989 stp->sd_flag |= STRDERR; in strsetrerror()
7991 stp->sd_flag &= ~STRDERRNONPERSIST; in strsetrerror()
7993 stp->sd_flag |= STRDERRNONPERSIST; in strsetrerror()
7995 stp->sd_rderrfunc = errfunc; in strsetrerror()
7997 cv_broadcast(&_RD(stp->sd_wrq)->q_wait); /* readers */ in strsetrerror()
7998 cv_broadcast(&stp->sd_wrq->q_wait); /* writers */ in strsetrerror()
7999 cv_broadcast(&stp->sd_monitor); /* ioctllers */ in strsetrerror()
8001 mutex_exit(&stp->sd_lock); in strsetrerror()
8002 pollwakeup(&stp->sd_pollist, POLLERR); in strsetrerror()
8003 mutex_enter(&stp->sd_lock); in strsetrerror()
8005 if (stp->sd_sigflags & S_ERROR) in strsetrerror()
8006 strsendsig(stp->sd_siglist, S_ERROR, 0, error); in strsetrerror()
8008 mutex_exit(&stp->sd_lock); in strsetrerror()
8018 struct stdata *stp = vp->v_stream; in strsetwerror() local
8020 mutex_enter(&stp->sd_lock); in strsetwerror()
8021 stp->sd_werror = error; in strsetwerror()
8023 stp->sd_flag &= ~STWRERR; in strsetwerror()
8025 stp->sd_flag |= STWRERR; in strsetwerror()
8027 stp->sd_flag &= ~STWRERRNONPERSIST; in strsetwerror()
8029 stp->sd_flag |= STWRERRNONPERSIST; in strsetwerror()
8031 stp->sd_wrerrfunc = errfunc; in strsetwerror()
8033 cv_broadcast(&_RD(stp->sd_wrq)->q_wait); /* readers */ in strsetwerror()
8034 cv_broadcast(&stp->sd_wrq->q_wait); /* writers */ in strsetwerror()
8035 cv_broadcast(&stp->sd_monitor); /* ioctllers */ in strsetwerror()
8037 mutex_exit(&stp->sd_lock); in strsetwerror()
8038 pollwakeup(&stp->sd_pollist, POLLERR); in strsetwerror()
8039 mutex_enter(&stp->sd_lock); in strsetwerror()
8041 if (stp->sd_sigflags & S_ERROR) in strsetwerror()
8042 strsendsig(stp->sd_siglist, S_ERROR, 0, error); in strsetwerror()
8044 mutex_exit(&stp->sd_lock); in strsetwerror()
8054 struct stdata *stp = vp->v_stream; in strseteof() local
8056 mutex_enter(&stp->sd_lock); in strseteof()
8058 stp->sd_flag &= ~STREOF; in strseteof()
8059 mutex_exit(&stp->sd_lock); in strseteof()
8062 stp->sd_flag |= STREOF; in strseteof()
8063 if (stp->sd_flag & RSLEEP) { in strseteof()
8064 stp->sd_flag &= ~RSLEEP; in strseteof()
8065 cv_broadcast(&_RD(stp->sd_wrq)->q_wait); in strseteof()
8068 mutex_exit(&stp->sd_lock); in strseteof()
8069 pollwakeup(&stp->sd_pollist, POLLIN|POLLRDNORM); in strseteof()
8070 mutex_enter(&stp->sd_lock); in strseteof()
8072 if (stp->sd_sigflags & (S_INPUT|S_RDNORM)) in strseteof()
8073 strsendsig(stp->sd_siglist, S_INPUT|S_RDNORM, 0, 0); in strseteof()
8074 mutex_exit(&stp->sd_lock); in strseteof()
8080 struct stdata *stp = vp->v_stream; in strflushrq() local
8082 mutex_enter(&stp->sd_lock); in strflushrq()
8083 flushq(_RD(stp->sd_wrq), flag); in strflushrq()
8084 mutex_exit(&stp->sd_lock); in strflushrq()
8091 struct stdata *stp = vp->v_stream; in strsetrputhooks() local
8093 mutex_enter(&stp->sd_lock); in strsetrputhooks()
8096 stp->sd_rprotofunc = strrput_proto; in strsetrputhooks()
8098 stp->sd_rprotofunc = protofunc; in strsetrputhooks()
8101 stp->sd_rmiscfunc = strrput_misc; in strsetrputhooks()
8103 stp->sd_rmiscfunc = miscfunc; in strsetrputhooks()
8106 stp->sd_rput_opt |= SR_CONSOL_DATA; in strsetrputhooks()
8108 stp->sd_rput_opt &= ~SR_CONSOL_DATA; in strsetrputhooks()
8111 stp->sd_rput_opt |= SR_SIGALLDATA; in strsetrputhooks()
8113 stp->sd_rput_opt &= ~SR_SIGALLDATA; in strsetrputhooks()
8116 stp->sd_rput_opt |= SR_IGN_ZEROLEN; in strsetrputhooks()
8118 stp->sd_rput_opt &= ~SR_IGN_ZEROLEN; in strsetrputhooks()
8120 mutex_exit(&stp->sd_lock); in strsetrputhooks()
8126 struct stdata *stp = vp->v_stream; in strsetwputhooks() local
8128 mutex_enter(&stp->sd_lock); in strsetwputhooks()
8129 stp->sd_closetime = closetime; in strsetwputhooks()
8132 stp->sd_wput_opt |= SW_SIGPIPE; in strsetwputhooks()
8134 stp->sd_wput_opt &= ~SW_SIGPIPE; in strsetwputhooks()
8136 stp->sd_wput_opt |= SW_RECHECK_ERR; in strsetwputhooks()
8138 stp->sd_wput_opt &= ~SW_RECHECK_ERR; in strsetwputhooks()
8140 mutex_exit(&stp->sd_lock); in strsetwputhooks()
8146 struct stdata *stp = vp->v_stream; in strsetrwputdatahooks() local
8148 mutex_enter(&stp->sd_lock); in strsetrwputdatahooks()
8150 stp->sd_rputdatafunc = rdatafunc; in strsetrwputdatahooks()
8151 stp->sd_wputdatafunc = wdatafunc; in strsetrwputdatahooks()
8153 mutex_exit(&stp->sd_lock); in strsetrwputdatahooks()
8160 stdata_t *stp = STREAM(q); in qenable_locked() local
8192 mutex_enter(&stp->sd_qlock); in qenable_locked()
8197 IMPLY(STREAM_NEEDSERVICE(stp), in qenable_locked()
8198 (stp->sd_svcflags & (STRS_WILLSERVICE | STRS_SCHEDULED))); in qenable_locked()
8200 ENQUEUE(q, stp->sd_qhead, stp->sd_qtail, q_link); in qenable_locked()
8201 stp->sd_nqueues++; in qenable_locked()
8207 if (!(stp->sd_svcflags & (STRS_WILLSERVICE | STRS_SCHEDULED))) { in qenable_locked()
8213 stp->sd_svcflags |= STRS_SCHEDULED; in qenable_locked()
8214 stp->sd_servid = (void *)taskq_dispatch(streams_taskq, in qenable_locked()
8215 (task_func_t *)stream_service, stp, TQ_NOSLEEP|TQ_NOQUEUE); in qenable_locked()
8217 if (stp->sd_servid == NULL) { in qenable_locked()
8227 stp->sd_svcflags &= ~STRS_SCHEDULED; in qenable_locked()
8234 ASSERT((stp->sd_qhead == q) && (stp->sd_qtail == q)); in qenable_locked()
8247 stp->sd_qhead = stp->sd_qtail = NULL; in qenable_locked()
8248 stp->sd_nqueues = 0; in qenable_locked()
8256 mutex_exit(&stp->sd_qlock); in qenable_locked()
8347 stream_service(stdata_t *stp) in stream_service() argument
8351 mutex_enter(&stp->sd_qlock); in stream_service()
8353 STR_SERVICE(stp, q); in stream_service()
8355 stp->sd_svcflags &= ~STRS_SCHEDULED; in stream_service()
8356 stp->sd_servid = NULL; in stream_service()
8357 cv_signal(&stp->sd_qcv); in stream_service()
8358 mutex_exit(&stp->sd_qlock); in stream_service()
8365 stream_runservice(stdata_t *stp) in stream_runservice() argument
8369 mutex_enter(&stp->sd_qlock); in stream_runservice()
8375 stp->sd_svcflags |= STRS_WILLSERVICE; in stream_runservice()
8377 STR_SERVICE(stp, q); in stream_runservice()
8379 stp->sd_svcflags &= ~STRS_WILLSERVICE; in stream_runservice()
8380 mutex_exit(&stp->sd_qlock); in stream_runservice()
8395 stream_willservice(stdata_t *stp) in stream_willservice() argument
8397 mutex_enter(&stp->sd_qlock); in stream_willservice()
8398 stp->sd_svcflags |= STRS_WILLSERVICE; in stream_willservice()
8399 mutex_exit(&stp->sd_qlock); in stream_willservice()