Lines Matching refs:group
318 sa_find_group_handle(sa_group_t group) in sa_find_group_handle() argument
320 xmlNodePtr node = (xmlNodePtr)group; in sa_find_group_handle()
461 checksubdirgroup(sa_group_t group, char *newpath, int strictness) in checksubdirgroup() argument
472 for (share = sa_get_share(group, NULL); share != NULL; in checksubdirgroup()
529 sa_group_t group; in checksubdir() local
533 for (group = sa_get_group(handle, NULL); in checksubdir()
534 group != NULL && issub == SA_OK; in checksubdir()
535 group = sa_get_next_group(group)) { in checksubdir()
536 if (sa_group_is_zfs(group)) { in checksubdir()
538 for (subgroup = sa_get_sub_group(group); in checksubdir()
544 issub = checksubdirgroup(group, newpath, strictness); in checksubdir()
608 sa_is_persistent(void *group) in sa_is_persistent() argument
614 type = sa_get_group_attr((sa_group_t)group, "type"); in sa_is_persistent()
621 grp = (sa_is_share(group)) ? sa_get_parent_group(group) : group; in sa_is_persistent()
667 is_zfs_group(sa_group_t group) in is_zfs_group() argument
673 if (strcmp((char *)((xmlNodePtr)group)->name, "share") == 0) in is_zfs_group()
674 parent = (xmlNodePtr)sa_get_parent_group(group); in is_zfs_group()
676 parent = (xmlNodePtr)group; in is_zfs_group()
1216 find_group_by_name(xmlNodePtr node, xmlChar *group) in find_group_by_name() argument
1224 if (group == NULL) in find_group_by_name()
1227 if (name != NULL && xmlStrcmp(name, group) == 0) in find_group_by_name()
1250 char *group = NULL; in sa_get_group() local
1255 group = strdup(groupname); in sa_get_group()
1256 if (group != NULL) { in sa_get_group()
1257 subgroup = strchr(group, '/'); in sa_get_group()
1269 if (group != NULL || groupname == NULL) in sa_get_group()
1271 (xmlChar *)group); in sa_get_group()
1277 if (node != NULL && (char *)group != NULL) in sa_get_group()
1278 (void) sa_get_instance(impl_handle->scfhandle, (char *)group); in sa_get_group()
1279 if (group != NULL) in sa_get_group()
1280 free(group); in sa_get_group()
1290 sa_get_next_group(sa_group_t group) in sa_get_next_group() argument
1293 if (group != NULL) { in sa_get_next_group()
1294 for (ngroup = ((xmlNodePtr)group)->next; ngroup != NULL; in sa_get_next_group()
1309 sa_get_share(sa_group_t group, char *sharepath) in sa_get_share() argument
1319 if (group != NULL) { in sa_get_share()
1320 for (node = ((xmlNodePtr)group)->children; node != NULL; in sa_get_share()
1392 find_share(sa_group_t group, char *sharepath) in find_share() argument
1397 for (share = sa_get_share(group, NULL); share != NULL; in find_share()
1419 sa_get_sub_group(sa_group_t group) in sa_get_sub_group() argument
1421 return ((sa_group_t)_sa_get_child_node((xmlNodePtr)group, in sa_get_sub_group()
1436 sa_group_t group; in sa_find_share() local
1441 for (group = sa_get_group(handle, NULL); group != NULL && !done; in sa_find_share()
1442 group = sa_get_next_group(group)) { in sa_find_share()
1443 if (is_zfs_group(group)) { in sa_find_share()
1445 (sa_group_t)_sa_get_child_node((xmlNodePtr)group, in sa_find_share()
1454 share = find_share(group, sharepath); in sa_find_share()
1475 sa_check_path(sa_group_t group, char *path, int strictness) in sa_check_path() argument
1479 handle = sa_find_group_handle(group); in sa_check_path()
1495 mark_excluded_protos(sa_group_t group, xmlNodePtr share, uint64_t flags) in mark_excluded_protos() argument
1502 for (optionset = sa_get_optionset(group, NULL); in mark_excluded_protos()
1532 get_all_features(sa_group_t group) in get_all_features() argument
1537 for (optionset = sa_get_optionset(group, NULL); in get_all_features()
1563 _sa_add_share(sa_group_t group, char *sharepath, int persist, int *error, in _sa_add_share() argument
1571 node = xmlNewChild((xmlNodePtr)group, NULL, (xmlChar *)"share", NULL); in _sa_add_share()
1582 mark_excluded_protos(group, node, flags); in _sa_add_share()
1591 if (sa_group_is_zfs(group) && in _sa_add_share()
1593 if (sa_get_optionset(group, "nfs") != NULL) in _sa_add_share()
1594 err = sa_zfs_set_sharenfs(group, sharepath, 1); in _sa_add_share()
1595 else if (sa_get_optionset(group, "smb") != NULL) in _sa_add_share()
1596 err = sa_zfs_set_sharesmb(group, sharepath, 1); in _sa_add_share()
1600 (sa_handle_impl_t)sa_find_group_handle(group); in _sa_add_share()
1603 group, (sa_share_t)node); in _sa_add_share()
1639 sa_add_share(sa_group_t group, char *sharepath, int persist, int *error) in sa_add_share() argument
1660 handle = sa_find_group_handle(group); in sa_add_share()
1671 *error = sa_check_path(group, sharepath, strictness); in sa_add_share()
1672 features = get_all_features(group); in sa_add_share()
1684 node = _sa_add_share(group, sharepath, persist, in sa_add_share()
1724 sa_group_t group; in sa_enable_share() local
1727 group = sa_get_parent_group(share); in sa_enable_share()
1729 for (optionset = sa_get_optionset(group, NULL); in sa_enable_share()
1773 sa_group_t group; in sa_disable_share() local
1776 group = sa_get_parent_group(share); in sa_disable_share()
1779 for (optionset = sa_get_optionset(group, NULL); in sa_disable_share()
1810 sa_group_t group; in sa_remove_share() local
1818 group = sa_get_parent_group(share); in sa_remove_share()
1819 zfs = sa_get_group_attr(group, "zfs"); in sa_remove_share()
1820 groupname = sa_get_group_attr(group, "name"); in sa_remove_share()
1836 if (!sa_group_is_zfs(group)) { in sa_remove_share()
1839 sa_find_group_handle(group); in sa_remove_share()
1842 impl_handle->scfhandle, group, in sa_remove_share()
1851 ret = sa_zfs_set_sharenfs(group, in sa_remove_share()
1876 sa_move_share(sa_group_t group, sa_share_t share) in sa_move_share() argument
1884 if (oldgroup != group) { in sa_move_share()
1891 (void) xmlAddChild((xmlNodePtr)group, (xmlNodePtr)share); in sa_move_share()
1893 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_move_share()
1905 group, share); in sa_move_share()
1971 _sa_create_zfs_group(sa_group_t group, char *groupname) in _sa_create_zfs_group() argument
1975 node = xmlNewChild((xmlNodePtr)group, NULL, (xmlChar *)"group", NULL); in _sa_create_zfs_group()
1999 sa_group_t group; in sa_create_group() local
2011 group = sa_get_group(handle, groupname); in sa_create_group()
2012 if (group != NULL) { in sa_create_group()
2107 sa_remove_group(sa_group_t group) in sa_remove_group() argument
2113 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_remove_group()
2115 name = sa_get_group_attr(group, "name"); in sa_remove_group()
2120 xmlUnlinkNode((xmlNodePtr)group); /* make sure unlinked */ in sa_remove_group()
2121 xmlFreeNode((xmlNodePtr)group); /* now it is gone */ in sa_remove_group()
2194 sa_get_group_attr(sa_group_t group, char *tag) in sa_get_group_attr() argument
2196 return (get_node_attr((void *)group, tag)); in sa_get_group_attr()
2210 sa_set_group_attr(sa_group_t group, char *tag, char *value) in sa_set_group_attr() argument
2219 if (sa_group_is_zfs(group)) { in sa_set_group_attr()
2220 set_node_attr((void *)group, tag, value); in sa_set_group_attr()
2224 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_set_group_attr()
2226 groupname = sa_get_group_attr(group, "name"); in sa_set_group_attr()
2229 set_node_attr((void *)group, tag, value); in sa_set_group_attr()
2297 sa_group_t group; in sa_set_share_attr() local
2301 group = sa_get_parent_group(share); in sa_set_share_attr()
2311 resource = sa_get_resource(group, value); in sa_set_share_attr()
2317 if (group != NULL) { in sa_set_share_attr()
2325 group); in sa_set_share_attr()
2328 impl_handle->scfhandle, group, in sa_set_share_attr()
2402 sa_get_optionset(void *group, char *proto) in sa_get_optionset() argument
2407 for (node = ((xmlNodePtr)group)->children; node != NULL; in sa_get_optionset()
2460 sa_get_security(sa_group_t group, char *sectype, char *proto) in sa_get_security() argument
2465 for (node = ((xmlNodePtr)group)->children; node != NULL; in sa_get_security()
2599 sa_group_t group; in sa_set_share_description() local
2620 group = sa_get_parent_group(share); in sa_set_share_description()
2621 if (group != NULL && in sa_set_share_description()
2622 sa_is_persistent(share) && (!sa_group_is_zfs(group))) { in sa_set_share_description()
2624 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_set_share_description()
2626 ret = sa_commit_share(impl_handle->scfhandle, group, in sa_set_share_description()
2699 sa_create_optionset(sa_group_t group, char *proto) in sa_create_optionset() argument
2702 sa_group_t parent = group; in sa_create_optionset()
2707 optionset = sa_get_optionset(group, proto); in sa_create_optionset()
2716 if (sa_is_share(group)) { in sa_create_optionset()
2721 id = sa_get_share_attr((sa_share_t)group, "id"); in sa_create_optionset()
2722 } else if (sa_is_resource(group)) { in sa_create_optionset()
2724 (sa_resource_t)group); in sa_create_optionset()
2728 if (id == NULL && sa_is_persistent(group)) in sa_create_optionset()
2741 optionset = (sa_optionset_t)xmlNewChild((xmlNodePtr)group, in sa_create_optionset()
2755 if (sa_is_share(group)) { in sa_create_optionset()
2756 parent = sa_get_parent_group((sa_share_t)group); in sa_create_optionset()
2757 } else if (sa_is_resource(group)) { in sa_create_optionset()
2759 (sa_resource_t)group); in sa_create_optionset()
2768 if (groupname != NULL && sa_is_persistent(group)) { in sa_create_optionset()
2772 group); in sa_create_optionset()
2872 sa_group_t group; in sa_commit_properties() local
2879 group = sa_get_optionset_parent(optionset); in sa_commit_properties()
2880 if (group != NULL && (sa_is_share(group) || is_zfs_group(group))) { in sa_commit_properties()
2882 parent = sa_get_parent_group(group); in sa_commit_properties()
2885 needsupdate = zfs_needs_update(group); in sa_commit_properties()
2891 ret = sa_zfs_update((sa_share_t)group); in sa_commit_properties()
2893 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_commit_properties()
2923 sa_group_t group; in sa_destroy_optionset() local
2927 group = sa_get_optionset_parent(optionset); in sa_destroy_optionset()
2928 if (group != NULL) { in sa_destroy_optionset()
2929 if (sa_is_resource(group)) { in sa_destroy_optionset()
2930 sa_resource_t resource = group; in sa_destroy_optionset()
2932 group = sa_get_parent_group(share); in sa_destroy_optionset()
2934 } else if (sa_is_share(group)) { in sa_destroy_optionset()
2935 id = sa_get_share_attr((sa_share_t)group, "id"); in sa_destroy_optionset()
2937 ispersist = sa_is_persistent(group); in sa_destroy_optionset()
2942 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_destroy_optionset()
2978 sa_create_security(sa_group_t group, char *sectype, char *proto) in sa_create_security() argument
2985 if (group != NULL && sa_is_share(group)) { in sa_create_security()
2986 id = sa_get_share_attr((sa_share_t)group, "id"); in sa_create_security()
2987 parent = sa_get_parent_group(group); in sa_create_security()
2990 } else if (group != NULL) { in sa_create_security()
2991 groupname = sa_get_group_attr(group, "name"); in sa_create_security()
2994 security = sa_get_security(group, sectype, proto); in sa_create_security()
2999 security = (sa_security_t)xmlNewChild((xmlNodePtr)group, in sa_create_security()
3008 if (groupname != NULL && sa_is_persistent(group)) { in sa_create_security()
3012 group); in sa_create_security()
3043 sa_group_t group; in sa_destroy_security() local
3047 group = sa_get_optionset_parent(security); in sa_destroy_security()
3049 if (group != NULL) in sa_destroy_security()
3050 iszfs = sa_group_is_zfs(group); in sa_destroy_security()
3052 if (group != NULL && !iszfs) { in sa_destroy_security()
3053 if (sa_is_share(group)) in sa_destroy_security()
3054 ispersist = sa_is_persistent(group); in sa_destroy_security()
3055 id = sa_get_share_attr((sa_share_t)group, "id"); in sa_destroy_security()
3062 (sa_handle_impl_t)sa_find_group_handle(group); in sa_destroy_security()
3074 ret = sa_zfs_update(group); in sa_destroy_security()
3160 sa_set_prop_by_prop(sa_optionset_t optionset, sa_group_t group, in sa_set_prop_by_prop() argument
3176 if (!sa_is_persistent(group)) { in sa_set_prop_by_prop()
3183 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_set_prop_by_prop()
3197 if (sa_is_share(group)) { in sa_set_prop_by_prop()
3198 parent = sa_get_parent_group(group); in sa_set_prop_by_prop()
3199 share = (sa_share_t)group; in sa_set_prop_by_prop()
3202 } else if (sa_is_resource(group)) { in sa_set_prop_by_prop()
3203 share = sa_get_parent_group(group); in sa_set_prop_by_prop()
3207 iszfs = is_zfs_group(group); in sa_set_prop_by_prop()
3221 groupname = sa_get_group_attr(group, in sa_set_prop_by_prop()
3260 zfs_set_update((sa_share_t)group); in sa_set_prop_by_prop()
3337 sa_group_t group; in sa_add_property() local
3370 group = sa_get_parent_group(parent); in sa_add_property()
3372 group = sa_get_parent_group(parent); in sa_add_property()
3374 group = parent; in sa_add_property()
3382 if (!is_zfs_group(group)) { in sa_add_property()
3388 group); in sa_add_property()
3470 sa_group_t group; in sa_remove_property() local
3473 group = sa_get_optionset_parent(optionset); in sa_remove_property()
3474 if (group != NULL) { in sa_remove_property()
3475 ret = sa_set_prop_by_prop(optionset, group, in sa_remove_property()
3502 sa_group_t group; in sa_update_property() local
3506 group = sa_get_optionset_parent(optionset); in sa_update_property()
3507 if (group != NULL) { in sa_update_property()
3508 ret = sa_set_prop_by_prop(optionset, group, in sa_update_property()
3861 sa_group_t group; in sa_add_resource() local
3866 group = sa_get_parent_group(share); in sa_add_resource()
3867 handle = sa_find_group_handle(group); in sa_add_resource()
3890 if (!sa_group_is_zfs(group)) { in sa_add_resource()
3896 group); in sa_add_resource()
3899 ihandle->scfhandle, group, in sa_add_resource()
3904 err = sa_zfs_update((sa_share_t)group); in sa_add_resource()
3925 sa_group_t group; in sa_remove_resource() local
3933 group = sa_get_parent_group(share); in sa_remove_resource()
3959 if (!sa_group_is_zfs(group)) { in sa_remove_resource()
3961 ihandle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_remove_resource()
3963 ret = sa_commit_share(ihandle->scfhandle, group, share); in sa_remove_resource()
3967 ret = sa_zfs_update((sa_share_t)group); in sa_remove_resource()
3980 proto_rename_resource(sa_handle_t handle, sa_group_t group, in proto_rename_resource() argument
3987 for (optionset = sa_get_optionset(group, NULL); in proto_rename_resource()
4013 sa_group_t group = NULL; in sa_rename_resource() local
4022 group = sa_get_parent_group(share); in sa_rename_resource()
4023 if (group == NULL) in sa_rename_resource()
4026 handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_rename_resource()
4039 ret = proto_rename_resource(handle, group, resource, newname); in sa_rename_resource()
4045 if (!sa_group_is_zfs(group)) { in sa_rename_resource()
4047 ret = sa_commit_share(ihandle->scfhandle, group, in sa_rename_resource()
4050 ret = sa_zfs_update((sa_share_t)group); in sa_rename_resource()
4107 find_resource(sa_group_t group, char *resname) in find_resource() argument
4114 for (share = sa_get_share(group, NULL); in find_resource()
4143 sa_group_t group; in sa_find_resource() local
4151 for (group = sa_get_group(handle, NULL); group != NULL; in sa_find_resource()
4152 group = sa_get_next_group(group)) { in sa_find_resource()
4154 if (is_zfs_group(group)) { in sa_find_resource()
4156 (sa_group_t)_sa_get_child_node((xmlNodePtr)group, in sa_find_resource()
4163 resource = find_resource(group, name); in sa_find_resource()
4182 sa_get_resource(sa_group_t group, char *resource) in sa_get_resource() argument
4188 for (share = sa_get_share(group, NULL); in sa_get_resource()
4267 sa_group_t group = NULL; in sa_get_active_protocols() local
4284 group = sa_get_parent_group(share); in sa_get_active_protocols()
4287 group = sa_get_parent_group(share); in sa_get_active_protocols()
4289 group = (sa_group_t)group; in sa_get_active_protocols()
4295 if (ret == SA_OK && group != NULL) in sa_get_active_protocols()
4296 ret = get_protocol_list(options, group); in sa_get_active_protocols()
4431 sa_group_t group; in sa_set_resource_description() local
4457 group = sa_get_parent_group(share); in sa_set_resource_description()
4458 if (group != NULL && in sa_set_resource_description()
4459 sa_is_persistent(share) && (!sa_group_is_zfs(group))) { in sa_set_resource_description()
4461 impl_handle = (sa_handle_impl_t)sa_find_group_handle(group); in sa_set_resource_description()
4464 group, share); in sa_set_resource_description()