Print this page
NEX-15279 support NFS server in zone
NEX-15520 online NFS shares cause zoneadm halt to hang in nfs_export_zone_fini
Portions contributed by: Dan Kruchinin dan.kruchinin@nexenta.com
Portions contributed by: Stepan Zastupov stepan.zastupov@gmail.com
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dfs.cmds/sharemgr/commands.c
          +++ new/usr/src/cmd/dfs.cmds/sharemgr/commands.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + */
       26 +
       27 +/*
  25   28   * Copyright 2012 Milan Jurik. All rights reserved.
       29 + * Copyright 2018 Nexenta Systems, Inc.
  26   30   */
  27   31  
  28   32  #include <sys/types.h>
  29   33  #include <sys/stat.h>
  30   34  #include <fcntl.h>
  31   35  #include <stdlib.h>
  32   36  #include <stdio.h>
  33   37  #include <string.h>
  34   38  #include <ctype.h>
  35   39  #include <unistd.h>
↓ open down ↓ 2123 lines elided ↑ open up ↑
2159 2163  /*
2160 2164   * show_group(group, verbose, properties, proto, subgroup)
2161 2165   *
2162 2166   * helper function to show the contents of a group.
2163 2167   */
2164 2168  
2165 2169  static void
2166 2170  show_group(sa_group_t group, int verbose, int properties, char *proto,
2167 2171      char *subgroup)
2168 2172  {
2169      -        sa_share_t share;
2170 2173          char *groupname;
2171 2174          char *zfs = NULL;
2172 2175          int iszfs = 0;
2173 2176          char *sharepath;
2174 2177  
2175 2178          groupname = sa_get_group_attr(group, "name");
2176 2179          if (groupname != NULL) {
     2180 +                sa_share_t share;
     2181 +
2177 2182                  if (proto != NULL && !has_protocol(group, proto)) {
2178 2183                          sa_free_attr_string(groupname);
2179 2184                          return;
2180 2185                  }
2181 2186                  /*
2182 2187                   * check to see if the group is managed by ZFS. If
2183 2188                   * there is an attribute, then it is. A non-NULL zfs
2184 2189                   * variable will trigger the different way to display
2185 2190                   * and will remove the transient property indicator
2186 2191                   * from the output.
2187 2192                   */
2188 2193                  zfs = sa_get_group_attr(group, "zfs");
2189 2194                  if (zfs != NULL) {
2190 2195                          iszfs = 1;
2191 2196                          sa_free_attr_string(zfs);
2192 2197                  }
2193      -                share = sa_get_share(group, NULL);
     2198 +
2194 2199                  if (subgroup == NULL)
2195 2200                          (void) printf("%s", groupname);
2196 2201                  else
2197 2202                          (void) printf("    %s/%s", subgroup, groupname);
2198 2203                  if (properties)
2199 2204                          show_properties(group, proto, "");
2200 2205                  (void) printf("\n");
2201 2206                  if (strcmp(groupname, "zfs") == 0) {
2202 2207                          sa_group_t zgroup;
2203 2208  
↓ open down ↓ 3813 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX