Lines Matching refs:name

18  * information: Portions Copyright [yyyy] [name of copyright owner]
54 * The name and attribute maps use hesarch() for faster lookup
60 * structs which map a device name to attributes. The
61 * device name is the unique device name returned from
63 * not be confused with the "display" name of the device
64 * which is typically a CTD or DID name.
67 char *name;
74 * The name cache is maintained via a list of these structs
75 * which map a descriptor to its name.
80 char *name;
86 * structs which map a device display name (CTD or DID)
90 char *name;
101 * The desc_cache_t map alters the device name by prepending
119 static nvlist_t *find_cached_attrs(char *name);
182 free(((desc_cache_t *)obj)->name);
191 * PURPOSE: Frees all entries in the name cache.
205 * FUNCTION: add_cached_descriptor(char *name, dm_descriptor_t desc)
207 * INPUT: name - a device name
214 * descriptor and name.
220 * The desc_cache_t map alters the device name to avoid collisions.
224 char *name,
239 (void) snprintf(buf, MAXNAMELEN, "%s-%s", DESC_CACHE_KEY_PREFIX, name);
240 dcp->name = strdup(buf);
241 if (dcp->name == NULL) {
252 entry.key = dcp->name;
268 * FUNCTION: dm_descriptor_t find_cached_descriptor(char *name)
270 * INPUT: char * - pointer to a name or alias.
273 * input name if a match is found. A null descriptor
277 * the input device name.
283 * The desc_cache_t map alters the device name to avoid collisions.
287 char *name)
294 (void) snprintf(buf, MAXNAMELEN, "%s-%s", DESC_CACHE_KEY_PREFIX, name);
297 /* get descriptor associated with this name */
312 * name cache.
326 free(((name_cache_t *)obj)->name);
336 * PURPOSE: Frees all entries in the name cache.
342 gettext(" destroying name cache (%d items)\n"),
350 * FUNCTION: add_cached_name(dm_descriptor_t desc, char *name)
353 * name - a device name
358 * PURPOSE: Adds an entry to the name cache using the input
359 * descriptor and name.
364 char *name)
383 ncp->name = strdup(name);
384 if (ncp->name == NULL) {
403 free(ncp->name);
418 * RETURNS: char * - pointer to the name cached for the descriptor.
421 * PURPOSE: Searches for the name that has been cached for
433 char *name = NULL;
438 /* get name associated with this descriptor */
441 name = ((name_cache_t *)cached_item->data)->name;
444 return (name);
449 * char_t **name)
453 * OUTPUT: name - pointer to char * to hold the name
458 * PURPOSE: Searches for the name that has been cached for the
462 * If no name has yet been cached, it is retrieved from
465 * Names are cached so that all name strings obtained from
471 char **name)
478 (*name = find_cached_name(desc)) == NULL) {
480 /* not in descriptor->name cache/map, add it */
486 *name = dm_get_name(desc, &error);
489 gettext("failed to get name for descriptor: %d\n"),
496 * assign a unique internal name if necessary
498 if (*name == NULL) {
502 (void) snprintf(buf, MAXNAMELEN-1, "temp-name-%lu",
504 *name = strdup(buf);
505 if (*name == NULL) {
507 gettext("failed to get name for descriptor: %d\n"),
513 desc, *name);
517 * media can have the same name as the associated drive
522 (void) snprintf(buf, MAXNAMELEN-1, "%s-%d", *name, type);
525 error = add_cached_name(desc, *name);
528 dm_free_name(*name);
530 free(*name);
533 /* return copied name */
534 *name = find_cached_name(desc);
536 *name = NULL;
590 * FUNCTION: add_cached_attributes(char *name, nvlist_t *attrs)
592 * INPUT: name - a device name
599 * name and attributes.
606 char *name,
615 entry.key = name;
627 acp->name = name;
642 * FUNCTION: nvlist_t *find_cached_attrs(char *name)
644 * INPUT: name - a device name
647 * cached under 'name'. Null otherwise.
650 * cached for the input name.
654 char *name)
660 item.key = name;
662 /* get attributes cached under this name */
685 * Attributes are cached using the name associated with
699 char *name = NULL;
702 (error = get_name(desc, &name)) == 0) {
704 if ((*attrs = find_cached_attrs(name)) == NULL) {
708 error = add_cached_attributes(name, *attrs);