Print this page
11945 pool import performance regression due to repeated libshare initialization
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libshare/common/libshare.c
          +++ new/usr/src/lib/libshare/common/libshare.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  25   25   * Copyright (c) 2016 by Delphix. All rights reserved.
  26   26   */
  27   27  
  28   28  /*
  29   29   * Share control API
  30   30   */
  31   31  #include <stdio.h>
  32   32  #include <string.h>
  33   33  #include <ctype.h>
  34   34  #include <sys/types.h>
↓ open down ↓ 1110 lines elided ↑ open up ↑
1145 1145  
1146 1146                  sa_scf_fini(impl_handle->scfhandle);
1147 1147                  sa_zfs_fini(impl_handle);
1148 1148  
1149 1149                  /* Make sure we free the handle */
1150 1150                  free(impl_handle);
1151 1151  
1152 1152          }
1153 1153  }
1154 1154  
     1155 +/*
     1156 + * sa_service(sa_handle_t handle)
     1157 + *
     1158 + * Returns the service for which the handle is currently initialized.
     1159 + */
     1160 +int
     1161 +sa_service(sa_handle_t handle)
     1162 +{
     1163 +        if (handle == NULL)
     1164 +                return (0);
     1165 +
     1166 +        return (((sa_handle_impl_t)handle)->sa_service);
     1167 +}
     1168 +
1155 1169  /*
1156 1170   * sa_get_protocols(char **protocol)
1157 1171   *      Get array of protocols that are supported
1158 1172   *      Returns pointer to an allocated and NULL terminated
1159 1173   *      array of strings.  Caller must free.
1160 1174   *      This really should be determined dynamically.
1161 1175   *      If there aren't any defined, return -1.
1162 1176   *      Use free() to return memory.
1163 1177   */
1164 1178  
↓ open down ↓ 3316 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX