Lines Matching refs:info
314 dfs_info_t info; in dfs_namespace_add() local
344 bzero(&info, sizeof (info)); in dfs_namespace_add()
346 (void) strlcpy(info.i_comment, cmnt, sizeof (info.i_comment)); in dfs_namespace_add()
347 info.i_state = DFS_VOLUME_STATE_OK | DFS_VOLUME_FLAVOR_STANDALONE; in dfs_namespace_add()
348 info.i_timeout = DFS_ROOT_TIMEOUT; in dfs_namespace_add()
349 info.i_propflags = 0; in dfs_namespace_add()
352 uuid_unparse(uuid, info.i_guid); in dfs_namespace_add()
356 info.i_ntargets = 1; in dfs_namespace_add()
357 info.i_targets = &t; in dfs_namespace_add()
359 if ((status = dfs_root_add(si.shr_path, &info)) != ERROR_SUCCESS) { in dfs_namespace_add()
427 dfs_info_t info; in dfs_namespace_getflavor() local
433 if (dfs_root_getinfo(rootdir, &info, 2) != ERROR_SUCCESS) in dfs_namespace_getflavor()
436 return (info.i_state & DFS_VOLUME_FLAVORS); in dfs_namespace_getflavor()
453 dfs_root_getinfo(const char *rootdir, dfs_info_t *info, uint32_t infolvl) in dfs_root_getinfo() argument
458 bzero(info, sizeof (dfs_info_t)); in dfs_root_getinfo()
459 info->i_type = DFS_OBJECT_ROOT; in dfs_root_getinfo()
466 status = dfs_root_xread(xfd, info, infolvl); in dfs_root_getinfo()
482 dfs_root_setinfo(const char *rootdir, dfs_info_t *info, uint32_t infolvl) in dfs_root_setinfo() argument
501 status = dfs_modinfo(DFS_OBJECT_ROOT, &curinfo, info, infolvl); in dfs_root_setinfo()
554 dfs_info_t info; in dfs_link_add() local
570 status = dfs_link_getinfo(NULL, &info, DFS_INFO_ALL); in dfs_link_add()
574 (void) strlcpy(info.i_comment, (cmnt) ? cmnt : "", in dfs_link_add()
575 sizeof (info.i_comment)); in dfs_link_add()
585 status = dfs_link_getinfo(path, &info, DFS_INFO_ALL); in dfs_link_add()
600 ntargets = info.i_ntargets; in dfs_link_add()
601 if (dfs_target_find(info.i_targets, ntargets, server, share) != -1) { in dfs_link_add()
602 dfs_info_free(&info); in dfs_link_add()
607 t = realloc(info.i_targets, (ntargets + 1) * sizeof (dfs_target_t)); in dfs_link_add()
609 dfs_info_free(&info); in dfs_link_add()
613 info.i_targets = t; in dfs_link_add()
614 dfs_target_init(&info.i_targets[ntargets], server, share, in dfs_link_add()
616 info.i_ntargets++; in dfs_link_add()
618 status = dfs_link_commit(path, &info); in dfs_link_add()
620 dfs_info_free(&info); in dfs_link_add()
635 dfs_info_t info; in dfs_link_remove() local
655 status = dfs_link_getinfo(path, &info, DFS_INFO_ALL); in dfs_link_remove()
660 idx = dfs_target_find(info.i_targets, info.i_ntargets, server, share); in dfs_link_remove()
662 bcopy(&info.i_targets[idx + 1], &info.i_targets[idx], in dfs_link_remove()
663 (info.i_ntargets - idx - 1) * sizeof (dfs_target_t)); in dfs_link_remove()
664 info.i_ntargets--; in dfs_link_remove()
666 dfs_info_free(&info); in dfs_link_remove()
670 if (info.i_ntargets == 0) { in dfs_link_remove()
675 status = dfs_link_commit(path, &info); in dfs_link_remove()
678 dfs_info_free(&info); in dfs_link_remove()
690 dfs_link_setinfo(const char *path, dfs_info_t *info, uint32_t infolvl) in dfs_link_setinfo() argument
699 status = dfs_modinfo(DFS_OBJECT_LINK, &curinfo, info, infolvl); in dfs_link_setinfo()
717 dfs_link_getinfo(const char *path, dfs_info_t *info, uint32_t infolvl) in dfs_link_getinfo() argument
724 bzero(info, sizeof (dfs_info_t)); in dfs_link_getinfo()
725 info->i_type = DFS_OBJECT_LINK; in dfs_link_getinfo()
728 info->i_state = DFS_VOLUME_STATE_OK; in dfs_link_getinfo()
729 info->i_timeout = DFS_LINK_TIMEOUT; in dfs_link_getinfo()
730 info->i_propflags = 0; in dfs_link_getinfo()
732 uuid_unparse(uuid, info->i_guid); in dfs_link_getinfo()
743 status = dfs_link_decode(info, link_data, infolvl); in dfs_link_getinfo()
809 dfs_cache_getinfo(dfs_nscnode_t *dn, dfs_info_t *info, uint32_t infolvl) in dfs_cache_getinfo() argument
814 status = dfs_link_getinfo(dn->nsc_fspath, info, infolvl); in dfs_cache_getinfo()
816 status = dfs_root_getinfo(dn->nsc_fspath, info, infolvl); in dfs_cache_getinfo()
818 (void) strlcpy(info->i_uncpath, dn->nsc_uncpath, in dfs_cache_getinfo()
819 sizeof (info->i_uncpath)); in dfs_cache_getinfo()
822 dfs_info_trace("dfs_cache_getinfo", info); in dfs_cache_getinfo()
1011 dfs_info_free(dfs_info_t *info) in dfs_info_free() argument
1013 if (info) in dfs_info_free()
1014 free(info->i_targets); in dfs_info_free()
1021 dfs_info_trace(const char *msg, dfs_info_t *info) in dfs_info_trace() argument
1027 if (info == NULL) in dfs_info_trace()
1030 smb_tracef("UNC\t%s", info->i_uncpath); in dfs_info_trace()
1031 smb_tracef("comment\t%s", info->i_comment); in dfs_info_trace()
1032 smb_tracef("GUID\t%s", info->i_guid); in dfs_info_trace()
1033 smb_tracef("state\t%X", info->i_state); in dfs_info_trace()
1034 smb_tracef("timeout\t%d", info->i_timeout); in dfs_info_trace()
1035 smb_tracef("props\t%X", info->i_propflags); in dfs_info_trace()
1036 smb_tracef("# targets\t%X", info->i_ntargets); in dfs_info_trace()
1038 if (info->i_targets == NULL) in dfs_info_trace()
1041 for (i = 0, t = info->i_targets; i < info->i_ntargets; i++, t++) { in dfs_info_trace()
1144 dfs_root_add(const char *rootdir, dfs_info_t *info) in dfs_root_add() argument
1151 status = dfs_root_xwrite(xfd, info); in dfs_root_add()
1232 dfs_root_xwrite(int xfd, dfs_info_t *info) in dfs_root_xwrite() argument
1239 if ((status = dfs_root_encode(info, &buf, &buflen)) != ERROR_SUCCESS) in dfs_root_xwrite()
1254 dfs_root_xread(int xfd, dfs_info_t *info, uint32_t infolvl) in dfs_root_xread() argument
1267 status = dfs_root_decode(info, buf, statbuf.st_size, infolvl); in dfs_root_xread()
1282 dfs_root_encode(dfs_info_t *info, char **buf, size_t *bufsz) in dfs_root_encode() argument
1291 rc = nvlist_add_string(nvl, "comment", info->i_comment); in dfs_root_encode()
1292 rc |= nvlist_add_string(nvl, "guid", info->i_guid); in dfs_root_encode()
1293 rc |= nvlist_add_uint32(nvl, "state", info->i_state); in dfs_root_encode()
1294 rc |= nvlist_add_uint32(nvl, "timeout", info->i_timeout); in dfs_root_encode()
1295 rc |= nvlist_add_uint32(nvl, "propflags", info->i_propflags); in dfs_root_encode()
1296 t = info->i_targets; in dfs_root_encode()
1318 dfs_root_decode(dfs_info_t *info, char *buf, size_t bufsz, uint32_t infolvl) in dfs_root_decode() argument
1334 rc |= nvlist_lookup_uint32(nvl, "state", &info->i_state); in dfs_root_decode()
1335 rc |= nvlist_lookup_uint32(nvl, "timeout", &info->i_timeout); in dfs_root_decode()
1336 rc |= nvlist_lookup_uint32(nvl, "propflags", &info->i_propflags); in dfs_root_decode()
1343 (void) strlcpy(info->i_comment, (cmnt) ? cmnt : "", in dfs_root_decode()
1344 sizeof (info->i_comment)); in dfs_root_decode()
1345 (void) strlcpy(info->i_guid, (guid) ? guid : "", sizeof (info->i_guid)); in dfs_root_decode()
1347 info->i_targets = NULL; in dfs_root_decode()
1348 info->i_ntargets = 1; in dfs_root_decode()
1366 info->i_targets = malloc(sizeof (dfs_target_t)); in dfs_root_decode()
1367 if (info->i_targets == NULL) { in dfs_root_decode()
1377 free(info->i_targets); in dfs_root_decode()
1380 dfs_target_init(info->i_targets, t_server, t_share, t_state); in dfs_root_decode()
1391 free(info->i_targets); in dfs_root_decode()
1394 info->i_targets->t_priority.p_class = t_priority_class; in dfs_root_decode()
1395 info->i_targets->t_priority.p_rank = t_priority_rank; in dfs_root_decode()
1437 dfs_link_decode(dfs_info_t *info, char *buf, uint32_t infolvl) in dfs_link_decode() argument
1460 info->i_state = strtoul(lfield[i++], NULL, 10); in dfs_link_decode()
1461 info->i_propflags = strtoul(lfield[i++], NULL, 10); in dfs_link_decode()
1462 info->i_timeout = strtoul(lfield[i++], NULL, 10); in dfs_link_decode()
1463 (void) strlcpy(info->i_guid, lfield[i++], sizeof (info->i_guid)); in dfs_link_decode()
1464 info->i_ntargets = strtoul(lfield[i++], NULL, 10); in dfs_link_decode()
1465 info->i_targets = NULL; in dfs_link_decode()
1469 if (cmntlen > sizeof (info->i_comment)) in dfs_link_decode()
1470 cpylen = sizeof (info->i_comment); in dfs_link_decode()
1474 (void) strlcpy(info->i_comment, buf, cpylen); in dfs_link_decode()
1489 info->i_targets = calloc(info->i_ntargets, sizeof (dfs_target_t)); in dfs_link_decode()
1490 if (info->i_targets == NULL) in dfs_link_decode()
1497 for (i = 0, t = info->i_targets; i < info->i_ntargets; i++, t++) { in dfs_link_decode()
1500 dfs_info_free(info); in dfs_link_decode()
1519 dfs_link_encode(dfs_info_t *info, char *buf, size_t bufsz) in dfs_link_encode() argument
1530 DFS_LINK_V1, info->i_state, info->i_propflags, info->i_timeout, in dfs_link_encode()
1531 info->i_guid, info->i_ntargets, in dfs_link_encode()
1532 strlen(info->i_comment), info->i_comment); in dfs_link_encode()
1536 dfs_info_trace("DFS link encode", info); in dfs_link_encode()
1545 for (i = 0, t = info->i_targets; i < info->i_ntargets; i++, t++) { in dfs_link_encode()
1554 dfs_info_trace("DFS link encode", info); in dfs_link_encode()
1568 dfs_link_commit(const char *path, dfs_info_t *info) in dfs_link_commit() argument
1574 status = dfs_link_encode(info, linkdata, MAXREPARSELEN); in dfs_link_commit()
1887 dfs_modinfo(uint32_t type, dfs_info_t *info, dfs_info_t *newinfo, in dfs_modinfo() argument
1896 target_idx = dfs_target_find(info->i_targets, info->i_ntargets, in dfs_modinfo()
1905 (void) strlcpy(info->i_comment, newinfo->i_comment, in dfs_modinfo()
1923 info->i_state = state; in dfs_modinfo()
1925 info->i_targets[target_idx].t_state = state; in dfs_modinfo()
1930 info->i_timeout = newinfo->i_timeout; in dfs_modinfo()
1934 info->i_propflags = newinfo->i_propflags; in dfs_modinfo()
1938 info->i_targets[target_idx].t_priority = in dfs_modinfo()
1952 (void) strlcpy(info->i_comment, newinfo->i_comment, in dfs_modinfo()
1955 info->i_state = newinfo->i_state; in dfs_modinfo()
1956 info->i_timeout = newinfo->i_timeout; in dfs_modinfo()
1957 info->i_propflags = newinfo->i_propflags; in dfs_modinfo()