Lines Matching refs:sib

72 static int smb_idmap_batch_binsid(smb_idmap_batch_t *sib);
184 smb_idmap_batch_create(smb_idmap_batch_t *sib, uint16_t nmap, int flags) in smb_idmap_batch_create() argument
186 ASSERT(sib != NULL); in smb_idmap_batch_create()
188 bzero(sib, sizeof (smb_idmap_batch_t)); in smb_idmap_batch_create()
190 sib->sib_idmaph = kidmap_get_create(curzone); in smb_idmap_batch_create()
192 sib->sib_flags = flags; in smb_idmap_batch_create()
193 sib->sib_nmap = nmap; in smb_idmap_batch_create()
194 sib->sib_size = nmap * sizeof (smb_idmap_t); in smb_idmap_batch_create()
195 sib->sib_maps = kmem_zalloc(sib->sib_size, KM_SLEEP); in smb_idmap_batch_create()
208 smb_idmap_batch_destroy(smb_idmap_batch_t *sib) in smb_idmap_batch_destroy() argument
213 ASSERT(sib != NULL); in smb_idmap_batch_destroy()
214 ASSERT(sib->sib_maps != NULL); in smb_idmap_batch_destroy()
216 if (sib->sib_idmaph) { in smb_idmap_batch_destroy()
217 kidmap_get_destroy(sib->sib_idmaph); in smb_idmap_batch_destroy()
218 sib->sib_idmaph = NULL; in smb_idmap_batch_destroy()
221 if (sib->sib_flags & SMB_IDMAP_ID2SID) { in smb_idmap_batch_destroy()
226 for (i = 0; i < sib->sib_nmap; i++) in smb_idmap_batch_destroy()
227 smb_sid_free(sib->sib_maps[i].sim_sid); in smb_idmap_batch_destroy()
228 } else if (sib->sib_flags & SMB_IDMAP_SID2ID) { in smb_idmap_batch_destroy()
233 for (i = 0; i < sib->sib_nmap; i++) { in smb_idmap_batch_destroy()
234 domsid = sib->sib_maps[i].sim_domsid; in smb_idmap_batch_destroy()
240 if (sib->sib_size && sib->sib_maps) { in smb_idmap_batch_destroy()
241 kmem_free(sib->sib_maps, sib->sib_size); in smb_idmap_batch_destroy()
242 sib->sib_maps = NULL; in smb_idmap_batch_destroy()
373 smb_idmap_batch_getmappings(smb_idmap_batch_t *sib, in smb_idmap_batch_getmappings() argument
380 idm_stat = kidmap_get_mappings(sib->sib_idmaph); in smb_idmap_batch_getmappings()
387 for (i = 0, sim = sib->sib_maps; i < sib->sib_nmap; i++, sim++) { in smb_idmap_batch_getmappings()
389 sib->sib_nerr++; in smb_idmap_batch_getmappings()
391 errcb(sib, sim); in smb_idmap_batch_getmappings()
392 if ((sib->sib_flags & SMB_IDMAP_SKIP_ERRS) == 0) { in smb_idmap_batch_getmappings()
398 if (smb_idmap_batch_binsid(sib) != 0) in smb_idmap_batch_getmappings()
412 smb_idmap_batch_binsid(smb_idmap_batch_t *sib) in smb_idmap_batch_binsid() argument
418 if (sib->sib_flags & SMB_IDMAP_SID2ID) in smb_idmap_batch_binsid()
422 sim = sib->sib_maps; in smb_idmap_batch_binsid()
423 for (i = 0; i < sib->sib_nmap; sim++, i++) { in smb_idmap_batch_binsid()