Lines Matching refs:tiptr

64 static void _t_free_lookbufs(struct _ti_user *tiptr);
66 static int _t_cbuf_alloc(struct _ti_user *tiptr, char **retbuf);
67 static int _t_rbuf_alloc(struct _ti_user *tiptr, char **retbuf);
69 static int _t_alloc_bufs(int fd, struct _ti_user *tiptr,
81 struct _ti_user *tiptr; in _t_checkfd() local
91 tiptr = find_tilink(fd); in _t_checkfd()
93 if (tiptr != NULL) in _t_checkfd()
94 return (tiptr); in _t_checkfd()
155 tiptr = _t_create(fd, NULL, api_semantics, NULL); in _t_checkfd()
156 if (tiptr == NULL) { in _t_checkfd()
171 return (tiptr); in _t_checkfd()
216 struct _ti_user *tiptr, in _t_register_lookevent() argument
225 assert(MUTEX_HELD(&tiptr->ti_lock)); in _t_register_lookevent()
227 cbuf_size = tiptr->ti_ctlsize; in _t_register_lookevent()
228 dbuf_size = tiptr->ti_rcvsize; in _t_register_lookevent()
242 if (tiptr->ti_lookcnt > 0) { /* something already on looklist */ in _t_register_lookevent()
247 assert(tiptr->ti_servtype != T_CLTS); in _t_register_lookevent()
249 if (*(t_scalar_t *)tiptr->ti_lookbufs.tl_lookcbuf == in _t_register_lookevent()
254 _t_free_looklist_head(tiptr); in _t_register_lookevent()
258 tlbs = &tiptr->ti_lookbufs; in _t_register_lookevent()
259 if (tiptr->ti_lookcnt > 0) { in _t_register_lookevent()
269 assert(tiptr->ti_lookcnt == listcount); in _t_register_lookevent()
303 tiptr->ti_lookcnt++; in _t_register_lookevent()
313 _t_is_event(int fd, struct _ti_user *tiptr) in _t_is_event() argument
317 assert(MUTEX_HELD(&tiptr->ti_lock)); in _t_is_event()
323 if ((retval > 0) || (tiptr->ti_lookcnt > 0)) { in _t_is_event()
335 _t_is_ok(int fd, struct _ti_user *tiptr, t_scalar_t type) in _t_is_ok() argument
345 assert(MUTEX_HELD(&tiptr->ti_lock)); in _t_is_ok()
350 if (_t_acquire_ctlbuf(tiptr, &ctlbuf, &didalloc) < 0) in _t_is_ok()
355 if (_t_acquire_databuf(tiptr, &databuf, &didralloc) < 0) { in _t_is_ok()
359 tiptr->ti_ctlbuf = ctlbuf.buf; in _t_is_ok()
419 tiptr->ti_ctlbuf = ctlbuf.buf; in _t_is_ok()
423 tiptr->ti_rcvbuf = databuf.buf; in _t_is_ok()
462 tiptr->ti_ctlbuf = ctlbuf.buf; in _t_is_ok()
466 tiptr->ti_rcvbuf = databuf.buf; in _t_is_ok()
505 _t_alloc_bufs(int fd, struct _ti_user *tiptr, struct T_info_ack *tsap) in _t_alloc_bufs() argument
573 tiptr->ti_rcvsize = size1; in _t_alloc_bufs()
574 tiptr->ti_rcvbuf = rcvbuf; in _t_alloc_bufs()
575 tiptr->ti_ctlsize = size2; in _t_alloc_bufs()
576 tiptr->ti_ctlbuf = ctlbuf; in _t_alloc_bufs()
583 tiptr->ti_lookbufs.tl_lookclen = 0; in _t_alloc_bufs()
584 tiptr->ti_lookbufs.tl_lookcbuf = lookcbuf; in _t_alloc_bufs()
585 tiptr->ti_lookbufs.tl_lookdlen = 0; in _t_alloc_bufs()
586 tiptr->ti_lookbufs.tl_lookdbuf = lookdbuf; in _t_alloc_bufs()
621 _t_reinit_tiptr(struct _ti_user *tiptr) in _t_reinit_tiptr() argument
634 tiptr->ti_flags = 0; in _t_reinit_tiptr()
635 tiptr->ti_rcvsize = 0; in _t_reinit_tiptr()
636 tiptr->ti_rcvbuf = NULL; in _t_reinit_tiptr()
637 tiptr->ti_ctlsize = 0; in _t_reinit_tiptr()
638 tiptr->ti_ctlbuf = NULL; in _t_reinit_tiptr()
639 tiptr->ti_lookbufs.tl_lookdbuf = NULL; in _t_reinit_tiptr()
640 tiptr->ti_lookbufs.tl_lookcbuf = NULL; in _t_reinit_tiptr()
641 tiptr->ti_lookbufs.tl_lookdlen = 0; in _t_reinit_tiptr()
642 tiptr->ti_lookbufs.tl_lookclen = 0; in _t_reinit_tiptr()
643 tiptr->ti_lookbufs.tl_next = NULL; in _t_reinit_tiptr()
644 tiptr->ti_maxpsz = 0; in _t_reinit_tiptr()
645 tiptr->ti_tsdusize = 0; in _t_reinit_tiptr()
646 tiptr->ti_etsdusize = 0; in _t_reinit_tiptr()
647 tiptr->ti_cdatasize = 0; in _t_reinit_tiptr()
648 tiptr->ti_ddatasize = 0; in _t_reinit_tiptr()
649 tiptr->ti_servtype = 0; in _t_reinit_tiptr()
650 tiptr->ti_lookcnt = 0; in _t_reinit_tiptr()
651 tiptr->ti_state = 0; in _t_reinit_tiptr()
652 tiptr->ti_ocnt = 0; in _t_reinit_tiptr()
653 tiptr->ti_prov_flag = 0; in _t_reinit_tiptr()
654 tiptr->ti_qlen = 0; in _t_reinit_tiptr()
676 struct _ti_user *tiptr; in add_tilink() local
724 if ((tiptr = malloc(sizeof (*tiptr))) == NULL) in add_tilink()
730 _t_reinit_tiptr(tiptr); in add_tilink()
731 prevptr->ti_next = tiptr; in add_tilink()
732 tiptr->ti_prev = prevptr; in add_tilink()
737 if ((tiptr = malloc(sizeof (*tiptr))) == NULL) in add_tilink()
739 _t_reinit_tiptr(tiptr); in add_tilink()
740 hash_bucket[x] = tiptr; in add_tilink()
741 tiptr->ti_prev = NULL; in add_tilink()
743 tiptr->ti_next = NULL; in add_tilink()
744 tiptr->ti_fd = s; in add_tilink()
745 tiptr->ti_rdev = stbuf.st_rdev; in add_tilink()
746 tiptr->ti_ino = stbuf.st_ino; in add_tilink()
747 (void) mutex_init(&tiptr->ti_lock, USYNC_THREAD, NULL); in add_tilink()
748 return (tiptr); in add_tilink()
1189 _t_cbuf_alloc(struct _ti_user *tiptr, char **retbuf) in _t_cbuf_alloc() argument
1193 assert(MUTEX_HELD(&tiptr->ti_lock)); in _t_cbuf_alloc()
1194 size2 = tiptr->ti_ctlsize; /* same size as default ctlbuf */ in _t_cbuf_alloc()
1208 _t_rbuf_alloc(struct _ti_user *tiptr, char **retbuf) in _t_rbuf_alloc() argument
1212 assert(MUTEX_HELD(&tiptr->ti_lock)); in _t_rbuf_alloc()
1213 size1 = tiptr->ti_rcvsize; /* same size as default rcvbuf */ in _t_rbuf_alloc()
1226 _t_free_lookbufs(struct _ti_user *tiptr) in _t_free_lookbufs() argument
1238 assert(MUTEX_HELD(&tiptr->ti_lock) || MUTEX_HELD(&_ti_userlock)); in _t_free_lookbufs()
1243 head_tlbs = &tiptr->ti_lookbufs; in _t_free_lookbufs()
1276 _t_free_looklist_head(struct _ti_user *tiptr) in _t_free_looklist_head() argument
1280 tlbs = &tiptr->ti_lookbufs; in _t_free_looklist_head()
1303 tiptr->ti_lookcnt--; in _t_free_looklist_head()
1304 assert(tiptr->ti_lookcnt > 0); in _t_free_looklist_head()
1310 assert(tiptr->ti_lookcnt == 1); in _t_free_looklist_head()
1311 tiptr->ti_lookcnt = 0; in _t_free_looklist_head()
1320 _t_flush_lookevents(struct _ti_user *tiptr) in _t_flush_lookevents() argument
1328 assert(MUTEX_HELD(&tiptr->ti_lock)); in _t_flush_lookevents()
1329 tiptr->ti_lookcnt = 0; in _t_flush_lookevents()
1333 tlbs = tiptr->ti_lookbufs.tl_next; in _t_flush_lookevents()
1334 tiptr->ti_lookbufs.tl_next = NULL; in _t_flush_lookevents()
1355 struct _ti_user *tiptr, in _t_acquire_ctlbuf() argument
1362 if (tiptr->ti_ctlbuf) { in _t_acquire_ctlbuf()
1363 ctlbufp->buf = tiptr->ti_ctlbuf; in _t_acquire_ctlbuf()
1364 tiptr->ti_ctlbuf = NULL; in _t_acquire_ctlbuf()
1365 ctlbufp->maxlen = tiptr->ti_ctlsize; in _t_acquire_ctlbuf()
1371 if ((ctlbufp->maxlen = _t_cbuf_alloc(tiptr, in _t_acquire_ctlbuf()
1395 struct _ti_user *tiptr, in _t_acquire_databuf() argument
1402 if (tiptr->ti_rcvbuf) { in _t_acquire_databuf()
1403 assert(tiptr->ti_rcvsize != 0); in _t_acquire_databuf()
1404 databufp->buf = tiptr->ti_rcvbuf; in _t_acquire_databuf()
1405 tiptr->ti_rcvbuf = NULL; in _t_acquire_databuf()
1406 databufp->maxlen = tiptr->ti_rcvsize; in _t_acquire_databuf()
1407 } else if (tiptr->ti_rcvsize == 0) { in _t_acquire_databuf()
1415 if ((databufp->maxlen = _t_rbuf_alloc(tiptr, in _t_acquire_databuf()
1634 _t_do_postconn_sync(int fd, struct _ti_user *tiptr) in _t_do_postconn_sync() argument
1698 tiptr->ti_maxpsz = tiap->TIDU_size; in _t_do_postconn_sync()
1700 tiptr->ti_tsdusize = tiap->TSDU_size; in _t_do_postconn_sync()
1702 tiptr->ti_etsdusize = tiap->ETSDU_size; in _t_do_postconn_sync()
1704 tiptr->ti_cdatasize = tiap->CDATA_size; in _t_do_postconn_sync()
1706 tiptr->ti_ddatasize = tiap->DDATA_size; in _t_do_postconn_sync()
1707 tiptr->ti_prov_flag = tiap->PROVIDER_flag; in _t_do_postconn_sync()