Lines Matching refs:opipe

43  * Allocate a new opipe and return it, or NULL, in which case
50 smb_opipe_t *opipe;
57 opipe = kmem_cache_alloc(smb_cache_opipe, KM_SLEEP);
59 bzero(opipe, sizeof (smb_opipe_t));
60 mutex_init(&opipe->p_mutex, NULL, MUTEX_DEFAULT, NULL);
61 cv_init(&opipe->p_cv, NULL, CV_DEFAULT, NULL);
62 opipe->p_magic = SMB_OPIPE_MAGIC;
63 opipe->p_server = sv;
64 opipe->p_refcnt = 1;
65 opipe->p_socket = sock;
67 return (opipe);
71 * Destroy an opipe. This is normally called from smb_ofile_delete
74 * the opipe is installed under an ofile.
77 smb_opipe_dealloc(smb_opipe_t *opipe)
81 SMB_OPIPE_VALID(opipe);
82 sv = opipe->p_server;
89 if (opipe->p_socket != NULL)
90 (void) ksocket_close(opipe->p_socket, zone_kcred());
92 opipe->p_magic = (uint32_t)~SMB_OPIPE_MAGIC;
93 cv_destroy(&opipe->p_cv);
94 mutex_destroy(&opipe->p_mutex);
96 kmem_cache_free(smb_cache_opipe, opipe);
103 smb_opipe_connect(smb_request_t *sr, smb_opipe_t *opipe)
116 (void) strlcpy(opipe->p_name, name, SMB_OPIPE_MAXNAME);
117 (void) smb_strlwr(opipe->p_name);
122 "%s/%s", SMB_PIPE_DIR, opipe->p_name);
123 rc = ksocket_connect(opipe->p_socket, (struct sockaddr *)&saddr,
140 smb_opipe_send_userinfo(smb_request_t *sr, smb_opipe_t *opipe,
177 rc = ksocket_send(opipe->p_socket, buf, buflen, 0,
184 rc = ksocket_recv(opipe->p_socket, &status, sizeof (status), 0,
216 smb_opipe_t *opipe;
219 opipe = smb_opipe_alloc(sr);
220 if (opipe == NULL)
223 if (smb_opipe_connect(sr, opipe) != 0) {
224 smb_opipe_dealloc(opipe);
228 smb_opipe_send_userinfo(sr, opipe, &err);
230 smb_opipe_dealloc(opipe);
239 op->pipe = opipe;
244 smb_opipe_dealloc(opipe);
249 opipe->p_ofile = ofile;
277 smb_opipe_t *opipe;
282 opipe = of->f_pipe;
283 SMB_OPIPE_VALID(opipe);
285 mutex_enter(&opipe->p_mutex);
286 sock = opipe->p_socket;
287 opipe->p_socket = NULL;
288 mutex_exit(&opipe->p_mutex);
307 smb_opipe_t *opipe;
314 opipe = ofile->f_pipe;
315 SMB_OPIPE_VALID(opipe);
317 mutex_enter(&opipe->p_mutex);
318 sock = opipe->p_socket;
321 mutex_exit(&opipe->p_mutex);
357 smb_opipe_t *opipe;
364 opipe = ofile->f_pipe;
365 SMB_OPIPE_VALID(opipe);
367 mutex_enter(&opipe->p_mutex);
368 sock = opipe->p_socket;
371 mutex_exit(&opipe->p_mutex);
406 smb_opipe_t *opipe;
412 opipe = ofile->f_pipe;
413 SMB_OPIPE_VALID(opipe);
415 mutex_enter(&opipe->p_mutex);
416 sock = opipe->p_socket;
419 mutex_exit(&opipe->p_mutex);
452 smb_opipe_t *opipe;
454 if ((opipe = of->f_pipe) == NULL)
457 (void) snprintf(buf, buflen, "\\%s", opipe->p_name);