Lines Matching refs:sib

52 static int smb_idmap_batch_binsid(smb_idmap_batch_t *sib);
77 smb_idmap_batch_t sib; in smb_idmap_getsid() local
80 stat = smb_idmap_batch_create(&sib, 1, SMB_IDMAP_ID2SID); in smb_idmap_getsid()
84 stat = smb_idmap_batch_getsid(sib.sib_idmaph, &sib.sib_maps[0], in smb_idmap_getsid()
88 smb_idmap_batch_destroy(&sib); in smb_idmap_getsid()
93 stat = smb_idmap_batch_getmappings(&sib, NULL); in smb_idmap_getsid()
96 smb_idmap_batch_destroy(&sib); in smb_idmap_getsid()
100 *sid = smb_sid_dup(sib.sib_maps[0].sim_sid); in smb_idmap_getsid()
102 smb_idmap_batch_destroy(&sib); in smb_idmap_getsid()
115 smb_idmap_batch_t sib; in smb_idmap_getid() local
119 stat = smb_idmap_batch_create(&sib, 1, SMB_IDMAP_SID2ID); in smb_idmap_getid()
123 sim = &sib.sib_maps[0]; in smb_idmap_getid()
125 stat = smb_idmap_batch_getid(sib.sib_idmaph, sim, sid, *id_type); in smb_idmap_getid()
127 smb_idmap_batch_destroy(&sib); in smb_idmap_getid()
132 stat = smb_idmap_batch_getmappings(&sib, NULL); in smb_idmap_getid()
135 smb_idmap_batch_destroy(&sib); in smb_idmap_getid()
140 smb_idmap_batch_destroy(&sib); in smb_idmap_getid()
151 smb_idmap_batch_create(smb_idmap_batch_t *sib, uint16_t nmap, int flags) in smb_idmap_batch_create() argument
155 ASSERT(sib != NULL); in smb_idmap_batch_create()
157 bzero(sib, sizeof (smb_idmap_batch_t)); in smb_idmap_batch_create()
158 stat = idmap_get_create(&sib->sib_idmaph); in smb_idmap_batch_create()
165 sib->sib_flags = flags; in smb_idmap_batch_create()
166 sib->sib_nmap = nmap; in smb_idmap_batch_create()
167 sib->sib_size = nmap * sizeof (smb_idmap_t); in smb_idmap_batch_create()
168 sib->sib_maps = kmem_zalloc(sib->sib_size, KM_SLEEP); in smb_idmap_batch_create()
179 smb_idmap_batch_destroy(smb_idmap_batch_t *sib) in smb_idmap_batch_destroy() argument
184 ASSERT(sib != NULL); in smb_idmap_batch_destroy()
185 ASSERT(sib->sib_maps != NULL); in smb_idmap_batch_destroy()
187 if (sib->sib_idmaph) { in smb_idmap_batch_destroy()
188 idmap_get_destroy(sib->sib_idmaph); in smb_idmap_batch_destroy()
189 sib->sib_idmaph = NULL; in smb_idmap_batch_destroy()
192 if (sib->sib_flags & SMB_IDMAP_ID2SID) { in smb_idmap_batch_destroy()
197 for (i = 0; i < sib->sib_nmap; i++) { in smb_idmap_batch_destroy()
198 smb_sid_free(sib->sib_maps[i].sim_sid); in smb_idmap_batch_destroy()
200 free(sib->sib_maps[i].sim_domsid); in smb_idmap_batch_destroy()
202 } else if (sib->sib_flags & SMB_IDMAP_SID2ID) { in smb_idmap_batch_destroy()
207 for (i = 0; i < sib->sib_nmap; i++) { in smb_idmap_batch_destroy()
208 domsid = sib->sib_maps[i].sim_domsid; in smb_idmap_batch_destroy()
214 if (sib->sib_size && sib->sib_maps) { in smb_idmap_batch_destroy()
215 kmem_free(sib->sib_maps, sib->sib_size); in smb_idmap_batch_destroy()
216 sib->sib_maps = NULL; in smb_idmap_batch_destroy()
354 smb_idmap_batch_getmappings(smb_idmap_batch_t *sib, in smb_idmap_batch_getmappings() argument
361 if ((stat = idmap_get_mappings(sib->sib_idmaph)) != IDMAP_SUCCESS) { in smb_idmap_batch_getmappings()
369 for (i = 0, sim = sib->sib_maps; i < sib->sib_nmap; i++, sim++) { in smb_idmap_batch_getmappings()
371 sib->sib_nerr++; in smb_idmap_batch_getmappings()
373 errcb(sib, sim); in smb_idmap_batch_getmappings()
374 if ((sib->sib_flags & SMB_IDMAP_SKIP_ERRS) == 0) { in smb_idmap_batch_getmappings()
380 if (smb_idmap_batch_binsid(sib) != 0) in smb_idmap_batch_getmappings()
394 smb_idmap_batch_binsid(smb_idmap_batch_t *sib) in smb_idmap_batch_binsid() argument
400 if (sib->sib_flags & SMB_IDMAP_SID2ID) in smb_idmap_batch_binsid()
404 sim = sib->sib_maps; in smb_idmap_batch_binsid()
405 for (i = 0; i < sib->sib_nmap; sim++, i++) { in smb_idmap_batch_binsid()