Lines Matching defs:sh
60 sh->sh_##field = kmem_alloc(len + 1, KM_SLEEP); \
61 bcopy(buf, sh->sh_##field, len); \
62 sh->sh_##field[len] = '\0'; \
64 sh->sh_size += shl.shl_##field; /* Debug counting */
67 if (sh->sh_##field) { \
68 kmem_free(sh->sh_##field, \
70 strlen(sh->sh_##field) + 1); \
92 sharefree(share_t *sh, sharefs_lens_t *shl)
94 if (!sh)
103 kmem_free(sh, sizeof (share_t));
111 sharefs_remove(share_t *sh, sharefs_lens_t *shl)
118 if (!sh)
123 if (strcmp(sh->sh_fstype, sht->s_fstype) == 0) {
137 iPath = shl ? shl->shl_path : strlen(sh->sh_path);
138 iHash = pkp_tab_hash(sh->sh_path, strlen(sh->sh_path));
148 if (strcmp(sh->sh_path, s->sh_path) == 0 &&
185 sharefree(sh, shl);
194 sharefs_add(share_t *sh, sharefs_lens_t *shl)
202 if (!sh) {
211 if (strcmp(sh->sh_fstype, sht->s_fstype) == 0) {
222 n = strlen(sh->sh_fstype);
224 (void) strncpy(sht->s_fstype, sh->sh_fstype, n);
233 iHash = pkp_tab_hash(sh->sh_path, strlen(sh->sh_path));
235 iPath = shl ? shl->shl_path : strlen(sh->sh_path);
238 sh->sh_size = shl->shl_path + shl->shl_res +
241 sh->sh_size = strlen(sh->sh_path) +
242 strlen(sh->sh_res) + strlen(sh->sh_fstype) +
243 strlen(sh->sh_opts) + strlen(sh->sh_descr);
250 sh->sh_size += 5;
264 if (strcmp(sh->sh_path, s->sh_path) == 0 &&
267 p->sh_next = sh;
269 sht->s_buckets[iHash].ssh_sh = sh;
272 sh->sh_next = s->sh_next;
276 sharetab_size += sh->sh_size;
299 sh->sh_next = sht->s_buckets[iHash].ssh_sh;
300 sht->s_buckets[iHash].ssh_sh = sh;
304 sharetab_size += sh->sh_size;
334 share_t *sh;
378 sh = kmem_zalloc(sizeof (share_t), KM_SLEEP);
399 error = sharefs_add(sh, &shl);
404 error = sharefs_remove(sh, &shl);
422 sharefree(sh, &shl);