Lines Matching defs:share

92  * with a group or share and find the library handle needed for
208 ret = dgettext(TEXT_DOMAIN, "path is a subpath of share");
211 ret = dgettext(TEXT_DOMAIN, "path is parent of a share");
397 * is_shared(share)
399 * determine if the specified share is currently shared or not.
402 is_shared(sa_share_t share)
407 shared = sa_get_share_attr(share, "shared");
417 * excluded_protocol(share, proto)
425 excluded_protocol(sa_share_t share, char *proto)
431 protolist = sa_get_share_attr(share, "exclude");
460 sa_share_t share;
469 for (share = sa_get_share(group, NULL); share != NULL;
470 share = sa_get_next_share(share)) {
472 * The original behavior of share never checked
479 if (strictness == SA_CHECK_NORMAL && !is_shared(share))
482 path = sa_get_share_attr(share, "path");
484 * If path is NULL, then a share is in the process of
487 * ignored. issubdir() comes from the original share
516 * subdirectory of another share. It calls checksubdirgroup() to do
551 * determine if the provided path is valid for a share. It shouldn't
553 * share path.
560 sa_share_t share;
569 share = sa_find_share(handle, path);
570 if (share != NULL)
598 * check to see if group/share is persistent.
602 * If the share is a ZFS share, mark it as persistent.
670 if (strcmp((char *)((xmlNodePtr)group)->name, "share") == 0)
698 else if (xmlStrcmp(node->name, (xmlChar *)"share") == 0)
714 * will have the GUID value for a share and should be used
764 * have the GUID value for a share and should be used instead of the
1213 * Return the share object for the share specified. The share
1230 if (xmlStrcmp(node->name, (xmlChar *)"share") == 0) {
1234 /* is it the correct share? */
1252 * sa_get_next_share(share)
1253 * Return the next share following the specified share
1259 sa_get_next_share(sa_share_t share)
1263 if (share != NULL) {
1264 for (node = ((xmlNodePtr)share)->next; node != NULL;
1266 if (xmlStrcmp(node->name, (xmlChar *)"share") == 0) {
1302 sa_share_t share;
1305 for (share = sa_get_share(group, NULL); share != NULL;
1306 share = sa_get_next_share(share)) {
1307 path = sa_get_share_attr(share, "path");
1315 return (share);
1335 * Finds a share regardless of group. In the future, this
1346 sa_share_t share = NULL;
1357 share = find_share(zgroup, sharepath);
1358 if (share != NULL)
1362 share = find_share(group, sharepath);
1364 if (share != NULL)
1367 return (share);
1395 * mark_excluded_protos(group, share, flags)
1398 * see if the share has any of them should be in the exclude list
1400 * "exclude" property to the share.
1403 mark_excluded_protos(sa_group_t group, xmlNodePtr share, uint64_t flags)
1429 (void) xmlSetProp(share, (xmlChar *)"exclude",
1479 node = xmlNewChild((xmlNodePtr)group, NULL, (xmlChar *)"share", NULL);
1497 * subgroup and then setup the share appropriately.
1540 * Add a new share object to the specified group. The share will
1556 * If the share is to be permanent, use strict checking so a
1571 * need to determine if the share is valid. The rules are:
1602 * sa_enable_share(share, protocol)
1603 * Enable the specified share to the specified protocol.
1607 sa_enable_share(sa_share_t share, char *protocol)
1614 sharepath = sa_get_share_attr(share, "path");
1620 /* tell the server about the share */
1622 if (excluded_protocol(share, protocol))
1626 err = sa_proto_share(protocol, share);
1628 (void) sa_set_share_attr(share,
1631 /* Tell all protocols about the share */
1635 group = sa_get_parent_group(share);
1644 if (!excluded_protocol(share, proto)) {
1646 share);
1653 (void) sa_set_share_attr(share, "shared", "true");
1663 * sa_disable_share(share, protocol)
1664 * Disable the specified share to the specified protocol. If
1666 * share should be disabled.
1669 sa_disable_share(sa_share_t share, char *protocol)
1675 path = sa_get_share_attr(share, "path");
1678 ret = sa_proto_unshare(share, protocol, path);
1684 group = sa_get_parent_group(share);
1686 /* Tell all protocols about the share */
1694 err = sa_proto_unshare(share, proto, path);
1702 (void) sa_set_share_attr(share, "shared", NULL);
1709 * sa_remove_share(share)
1711 * remove the specified share from its containing group.
1716 sa_remove_share(sa_share_t share)
1725 type = sa_get_share_attr(share, "type");
1726 group = sa_get_parent_group(share);
1742 ret = sa_delete_legacy(share, NULL);
1751 share);
1756 char *sharepath = sa_get_share_attr(share,
1771 xmlUnlinkNode((xmlNodePtr)share);
1772 xmlFreeNode((xmlNodePtr)share);
1777 * sa_move_share(group, share)
1779 * move the specified share to the specified group. Update SMF
1784 sa_move_share(sa_group_t group, sa_share_t share)
1791 oldgroup = sa_get_parent_group(share);
1794 xmlUnlinkNode((xmlNodePtr)share);
1796 * now that the share isn't in its old group, add to
1799 (void) xmlAddChild((xmlNodePtr)group, (xmlNodePtr)share);
1806 * need to avoid having the share in two groups at the
1810 share);
1813 group, share);
1822 * sa_get_parent_group(share)
1824 * Return the containing group for the share. If a group was actually
1829 sa_get_parent_group(sa_share_t share)
1832 if (share != NULL) {
1833 node = ((xmlNodePtr)share)->parent;
2163 * sa_get_share_attr(share, tag)
2166 * share. Returns NULL if the tag doesn't exist.
2170 sa_get_share_attr(sa_share_t share, char *tag)
2172 return (get_node_attr((void *)share, tag));
2176 * _sa_set_share_description(share, description)
2178 * Add a description tag with text contents to the specified share. A
2184 _sa_set_share_description(void *share, char *content)
2187 node = xmlNewChild((xmlNodePtr)share, NULL, (xmlChar *)"description",
2194 * sa_set_share_attr(share, tag, value)
2196 * Set the share attribute specified by tag to the specified value. In
2198 * the share is not transient, commit the changes to the repository
2199 * else just update the share internally.
2203 sa_set_share_attr(sa_share_t share, char *tag, char *value)
2209 group = sa_get_parent_group(share);
2220 if (resource != share && resource != NULL)
2224 set_node_attr((void *)share, tag, value);
2228 type = sa_get_share_attr(share, "type");
2237 share);
2498 * sa_set_share_description(share, content)
2500 * Set the description of share to content.
2504 sa_set_share_description(sa_share_t share, char *content)
2510 for (node = ((xmlNodePtr)share)->children; node != NULL;
2519 node = _sa_set_share_description(share, content);
2528 group = sa_get_parent_group(share);
2530 sa_is_persistent(share) && (!sa_group_is_zfs(group))) {
2535 share);
2562 * sa_get_share_description(share)
2564 * Return the description text for the specified share if it
2569 sa_get_share_description(sa_share_t share)
2574 for (node = ((xmlNodePtr)share)->children; node != NULL;
2611 sa_share_t share = NULL;
2631 share = sa_get_resource_parent(
2633 id = sa_get_resource_attr(share, "id");
2641 * Couldn't get the id for the share or
2661 * the share if this is a resource.
2666 share = sa_get_resource_parent(
2668 parent = sa_get_parent_group(share);
2720 * or a share.
2734 * zfs_needs_update(share)
2736 * In order to avoid making multiple updates to a ZFS share when
2737 * setting properties, the share attribute "changed" will be set to
2744 zfs_needs_update(sa_share_t share)
2749 attr = sa_get_share_attr(share, "changed");
2754 set_node_attr((void *)share, "changed", NULL);
2759 * zfs_set_update(share)
2761 * Set the changed attribute of the share to true.
2765 zfs_set_update(sa_share_t share)
2767 set_node_attr((void *)share, "changed", "true");
2789 /* only update ZFS if on a share */
2839 sa_share_t share = sa_get_resource_parent(resource);
2840 group = sa_get_parent_group(share);
2841 id = sa_get_share_attr(share, "id");
3062 * share. If a share, sort out which property group based on GUID. In
3063 * all cases, the appropriate transaction is set (or ZFS share is
3080 sa_share_t share = NULL;
3086 * if the group/share is not persistent we don't need
3101 * Check for share vs. resource since they need slightly
3107 share = (sa_share_t)group;
3111 share = sa_get_parent_group(group);
3112 if (share != NULL)
3113 parent = sa_get_parent_group(share);
3121 if (share != NULL) {
3127 (sa_share_t)share, "id");
3273 * Resources are children of share. Need to go up two
3275 * the share at this point in order to get the "id".
3356 * mark the share as "changed"
3430 * the protocol and not specific to a group or share.
3525 * the protocol and not specific to a group or share.
3664 * sa_get_share_resource(share, resource)
3666 * Get the named resource from the share, if it exists. If resource is
3671 sa_get_share_resource(sa_share_t share, char *resource)
3676 if (share != NULL) {
3677 for (node = ((xmlNodePtr)share)->children; node != NULL;
3688 /* is it the correct share? */
3707 * Return the next share following the specified share
3728 * _sa_get_next_resource_index(share)
3734 _sa_get_next_resource_index(sa_share_t share)
3740 for (resource = sa_get_share_resource(share, NULL);
3757 * sa_add_resource(share, resource, persist, &err)
3759 * Adds a new resource name associated with share. The resource name
3764 sa_add_resource(sa_share_t share, char *resource, int persist, int *error)
3774 group = sa_get_parent_group(share);
3781 node = xmlNewChild((xmlNodePtr)share, NULL,
3789 index = _sa_get_next_resource_index(share);
3795 if (!sa_is_persistent((sa_group_t)share))
3808 share);
3826 * Remove the resource name from the share (and the system)
3832 sa_share_t share;
3839 share = sa_get_resource_parent(resource);
3840 type = sa_get_share_attr(share, "type");
3841 group = sa_get_parent_group(share);
3859 /* Remove from the share */
3871 ret = sa_commit_share(ihandle->scfhandle, group, share);
3920 sa_share_t share;
3926 share = sa_get_resource_parent(resource);
3927 if (share == NULL)
3930 group = sa_get_parent_group(share);
3944 * point. Change the name of the active share and then
3945 * update the share in the appropriate repository.
3950 if (!sa_is_persistent((sa_group_t)share))
3956 share);
3995 * Returns the share associated with the resource.
4001 sa_share_t share = NULL;
4004 share = (sa_share_t)((xmlNodePtr)resource)->parent;
4005 return (share);
4017 sa_share_t share;
4022 for (share = sa_get_share(group, NULL);
4023 share != NULL && resource == NULL;
4024 share = sa_get_next_share(share)) {
4025 for (resource = sa_get_share_resource(share, NULL);
4082 * Search all the shares in the specified group for a share with a
4092 sa_share_t share = NULL;
4096 for (share = sa_get_share(group, NULL);
4097 share != NULL && res == NULL;
4098 share = sa_get_next_share(share)) {
4099 res = sa_get_share_resource(share, resource);
4174 sa_share_t share = NULL;
4191 share = sa_get_resource_parent(resource);
4192 group = sa_get_parent_group(share);
4194 share = (sa_share_t)object;
4195 group = sa_get_parent_group(share);
4201 if (ret == SA_OK && share != NULL)
4202 ret = get_protocol_list(options, share);
4220 * Disable the specified share to the specified protocol.
4264 * Disable the specified share for the specified protocol. If
4267 * disable at the share level.
4282 * unshare the share.
4332 * Set the description of share to content.
4340 sa_share_t share;
4364 share = sa_get_resource_parent(resource);
4365 group = sa_get_parent_group(share);
4367 sa_is_persistent(share) && (!sa_group_is_zfs(group))) {
4372 group, share);
4380 * sa_get_resource_description(share)
4382 * Return the description text for the specified share if it