Lines Matching refs:sh

63 	sh->sh_##field = kmem_alloc(len + 1, KM_SLEEP);			\
64 bcopy(buf, sh->sh_##field, len); \
65 sh->sh_##field[len] = '\0'; \
67 sh->sh_size += shl.shl_##field; /* Debug counting */
70 if (sh->sh_##field != NULL) { \
71 kmem_free(sh->sh_##field, \
73 strlen(sh->sh_##field) + 1); \
84 sharefree(share_t *sh, sharefs_lens_t *shl) in sharefree() argument
86 if (sh == NULL) in sharefree()
95 kmem_free(sh, sizeof (*sh)); in sharefree()
103 sharefs_remove(sharetab_globals_t *sg, share_t *sh, sharefs_lens_t *shl) in sharefs_remove() argument
110 if (!sh) in sharefs_remove()
115 if (strcmp(sh->sh_fstype, sht->s_fstype) == 0) in sharefs_remove()
128 iPath = shl != NULL ? shl->shl_path : strlen(sh->sh_path); in sharefs_remove()
129 iHash = pkp_tab_hash(sh->sh_path, strlen(sh->sh_path)); in sharefs_remove()
139 if (strcmp(sh->sh_path, s->sh_path) == 0 && in sharefs_remove()
172 sharefree(sh, shl); in sharefs_remove()
181 sharefs_add(sharetab_globals_t *sg, share_t *sh, sharefs_lens_t *shl) in sharefs_add() argument
189 if (sh == NULL) in sharefs_add()
195 if (strcmp(sh->sh_fstype, sht->s_fstype) == 0) in sharefs_add()
202 n = strlen(sh->sh_fstype); in sharefs_add()
204 (void) strncpy(sht->s_fstype, sh->sh_fstype, n); in sharefs_add()
211 iPath = shl != NULL ? shl->shl_path : strlen(sh->sh_path); in sharefs_add()
212 iHash = pkp_tab_hash(sh->sh_path, strlen(sh->sh_path)); in sharefs_add()
215 sh->sh_size = shl->shl_path + shl->shl_res + in sharefs_add()
218 sh->sh_size = strlen(sh->sh_path) + in sharefs_add()
219 strlen(sh->sh_res) + strlen(sh->sh_fstype) + in sharefs_add()
220 strlen(sh->sh_opts) + strlen(sh->sh_descr); in sharefs_add()
224 sh->sh_size += 5; in sharefs_add()
236 if (strcmp(sh->sh_path, s->sh_path) == 0 && in sharefs_add()
239 p->sh_next = sh; in sharefs_add()
241 sht->s_buckets[iHash].ssh_sh = sh; in sharefs_add()
243 sh->sh_next = s->sh_next; in sharefs_add()
247 sg->sharetab_size += sh->sh_size; in sharefs_add()
268 sh->sh_next = sht->s_buckets[iHash].ssh_sh; in sharefs_add()
269 sht->s_buckets[iHash].ssh_sh = sh; in sharefs_add()
273 sg->sharetab_size += sh->sh_size; in sharefs_add()
356 share_t *sh; in sharefs_impl() local
395 sh = kmem_zalloc(sizeof (share_t), KM_SLEEP); in sharefs_impl()
411 error = sharefs_add(sg, sh, &shl); in sharefs_impl()
414 error = sharefs_remove(sg, sh, &shl); in sharefs_impl()
430 sharefree(sh, &shl); in sharefs_impl()