Print this page
10120 smatch indenting fixes for usr/src/cmd
Reviewed by: Gergő Doma <domag02@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@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 ↓ 5648 lines elided ↑ open up ↑
5649 5649                   * it exists, make sure it belongs to the
5650 5650                   * current share. If it doesn't exist, attempt
5651 5651                   * to create it.
5652 5652                   */
5653 5653  
5654 5654                  if (ret == SA_OK && resource != NULL) {
5655 5655                          rsrc = sa_find_resource(handle, resource);
5656 5656                          if (rsrc != NULL) {
5657 5657                                  if (share != sa_get_resource_parent(rsrc))
5658 5658                                          ret = SA_DUPLICATE_NAME;
5659      -                                } else {
5660      -                                        rsrc = sa_add_resource(share, resource,
5661      -                                            persist, &ret);
5662      -                                }
5663      -                                if (features & SA_FEATURE_RESOURCE)
5664      -                                        share = rsrc;
     5659 +                        } else {
     5660 +                                rsrc = sa_add_resource(share, resource,
     5661 +                                    persist, &ret);
5665 5662                          }
     5663 +                        if (features & SA_FEATURE_RESOURCE)
     5664 +                                share = rsrc;
     5665 +                }
5666 5666  
5667      -                        /* Have a group to hold this share path */
5668      -                        if (ret == SA_OK && options != NULL &&
5669      -                            strlen(options) > 0) {
5670      -                                ret = sa_parse_legacy_options(share,
5671      -                                    options,
     5667 +                /* Have a group to hold this share path */
     5668 +                if (ret == SA_OK && options != NULL &&
     5669 +                    strlen(options) > 0) {
     5670 +                        ret = sa_parse_legacy_options(share,
     5671 +                            options,
     5672 +                            protocol);
     5673 +                }
     5674 +                if (!zfs) {
     5675 +                        /*
     5676 +                         * ZFS shares never have a description
     5677 +                         * and we can't store the values so
     5678 +                         * don't try.
     5679 +                         */
     5680 +                        if (ret == SA_OK && description != NULL)
     5681 +                                ret = sa_set_share_description(share,
     5682 +                                    description);
     5683 +                }
     5684 +                if (ret == SA_OK &&
     5685 +                    strcmp(groupstatus, "enabled") == 0) {
     5686 +                        if (rsrc != share)
     5687 +                                ret = sa_enable_share(share, protocol);
     5688 +                        else
     5689 +                                ret = sa_enable_resource(rsrc,
5672 5690                                      protocol);
5673      -                        }
5674      -                        if (!zfs) {
5675      -                                /*
5676      -                                 * ZFS shares never have a description
5677      -                                 * and we can't store the values so
5678      -                                 * don't try.
5679      -                                 */
5680      -                                if (ret == SA_OK && description != NULL)
5681      -                                        ret = sa_set_share_description(share,
5682      -                                            description);
5683      -                        }
5684 5691                          if (ret == SA_OK &&
5685      -                            strcmp(groupstatus, "enabled") == 0) {
5686      -                                if (rsrc != share)
5687      -                                        ret = sa_enable_share(share, protocol);
5688      -                                else
5689      -                                        ret = sa_enable_resource(rsrc,
5690      -                                            protocol);
5691      -                                if (ret == SA_OK &&
5692      -                                    persist == SA_SHARE_PERMANENT) {
5693      -                                        (void) sa_update_legacy(share,
5694      -                                            protocol);
5695      -                                }
5696      -                                if (ret == SA_OK)
5697      -                                        ret = sa_update_config(handle);
     5692 +                            persist == SA_SHARE_PERMANENT) {
     5693 +                                (void) sa_update_legacy(share,
     5694 +                                    protocol);
5698 5695                          }
     5696 +                        if (ret == SA_OK)
     5697 +                                ret = sa_update_config(handle);
     5698 +                }
5699 5699          }
5700 5700  err:
5701 5701          if (ret != SA_OK) {
5702 5702                  (void) fprintf(stderr, gettext("Could not share: %s: %s\n"),
5703 5703                      sharepath, sa_errorstr(ret));
5704 5704                  ret = SA_LEGACY_ERR;
5705 5705          }
5706 5706          return (ret);
5707 5707  }
5708 5708  
↓ open down ↓ 308 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX