Print this page
4095 minor cleanup up libshare

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libshare/common/libshare.h
          +++ new/usr/src/lib/libshare/common/libshare.h
↓ 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 (c) 2013 RackTop Systems.
  24   25   */
  25   26  
  26   27  /*
  27   28   * basic API declarations for share management
  28   29   */
  29   30  
  30   31  #ifndef _LIBSHARE_H
  31   32  #define _LIBSHARE_H
  32   33  
  33   34  #ifdef  __cplusplus
↓ open down ↓ 7 lines elided ↑ open up ↑
  41   42   * Basic datatypes for most functions
  42   43   */
  43   44  typedef void *sa_group_t;
  44   45  typedef void *sa_share_t;
  45   46  typedef void *sa_property_t;
  46   47  typedef void *sa_optionset_t;
  47   48  typedef void *sa_security_t;
  48   49  typedef void *sa_protocol_properties_t;
  49   50  typedef void *sa_resource_t;
  50   51  
  51      -typedef void *sa_handle_t;      /* opaque handle to access core functions */
       52 +typedef struct sa_handle *sa_handle_t;  /* opaque handle to access core functions */
  52   53  
  53   54  /*
  54   55   * defined error values
  55   56   */
  56   57  
  57   58  #define SA_OK                   0
  58   59  #define SA_NO_SUCH_PATH         1       /* provided path doesn't exist */
  59   60  #define SA_NO_MEMORY            2       /* no memory for data structures */
  60   61  #define SA_DUPLICATE_NAME       3       /* object name is already in use */
  61   62  #define SA_BAD_PATH             4       /* not a full path */
↓ open down ↓ 108 lines elided ↑ open up ↑
 170  171  extern sa_share_t sa_get_share(sa_group_t, char *);
 171  172  extern sa_share_t sa_find_share(sa_handle_t, char *);
 172  173  extern sa_share_t sa_get_next_share(sa_share_t);
 173  174  extern char *sa_get_share_attr(sa_share_t, char *);
 174  175  extern char *sa_get_share_description(sa_share_t);
 175  176  extern sa_group_t sa_get_parent_group(sa_share_t);
 176  177  extern int sa_set_share_attr(sa_share_t, char *, char *);
 177  178  extern int sa_set_share_description(sa_share_t, char *);
 178  179  extern int sa_enable_share(sa_group_t, char *);
 179  180  extern int sa_disable_share(sa_share_t, char *);
 180      -extern int sa_is_share(void *);
      181 +extern boolean_t sa_is_share(void *);
 181  182  
 182  183  /* resource name related */
 183  184  extern sa_resource_t sa_find_resource(sa_handle_t, char *);
 184  185  extern sa_resource_t sa_get_resource(sa_group_t, char *);
 185  186  extern sa_resource_t sa_get_next_resource(sa_resource_t);
 186  187  extern sa_share_t sa_get_resource_parent(sa_resource_t);
 187  188  extern sa_resource_t sa_get_share_resource(sa_share_t, char *);
 188  189  extern sa_resource_t sa_add_resource(sa_share_t, char *, int, int *);
 189  190  extern int sa_remove_resource(sa_resource_t);
 190  191  extern char *sa_get_resource_attr(sa_resource_t, char *);
↓ open down ↓ 24 lines elided ↑ open up ↑
 215  216  extern sa_property_t sa_get_next_property(sa_group_t);
 216  217  extern char *sa_get_property_attr(sa_property_t, char *);
 217  218  extern sa_property_t sa_create_section(char *, char *);
 218  219  extern void sa_set_section_attr(sa_property_t, char *, char *);
 219  220  extern sa_property_t sa_create_property(char *, char *);
 220  221  extern int sa_add_property(void *, sa_property_t);
 221  222  extern int sa_update_property(sa_property_t, char *);
 222  223  extern int sa_remove_property(sa_property_t);
 223  224  extern int sa_commit_properties(sa_optionset_t, int);
 224  225  extern int sa_valid_property(sa_handle_t, void *, char *, sa_property_t);
 225      -extern int sa_is_persistent(void *);
      226 +extern boolean_t sa_is_persistent(void *);
 226  227  
 227  228  /* security control */
 228  229  extern sa_security_t sa_get_security(sa_group_t, char *, char *);
 229  230  extern sa_security_t sa_get_next_security(sa_security_t);
 230  231  extern char *sa_get_security_attr(sa_optionset_t, char *);
 231  232  extern sa_security_t sa_create_security(sa_group_t, char *, char *);
 232  233  extern int sa_destroy_security(sa_security_t);
 233  234  extern void sa_set_security_attr(sa_security_t, char *, char *);
 234  235  extern sa_optionset_t sa_get_all_security_types(void *, char *, int);
 235  236  extern sa_security_t sa_get_derived_security(void *, char *, char *, int);
 236  237  extern void sa_free_derived_security(sa_security_t);
 237  238  
 238  239  /* protocol specific interfaces */
 239  240  extern int sa_parse_legacy_options(sa_group_t, char *, char *);
 240  241  extern char *sa_proto_legacy_format(char *, sa_group_t, int);
 241      -extern int sa_is_security(char *, char *);
      242 +extern boolean_t sa_is_security(char *, char *);
 242  243  extern sa_protocol_properties_t sa_proto_get_properties(char *);
 243  244  extern uint64_t sa_proto_get_featureset(char *);
 244  245  extern sa_property_t sa_get_protocol_section(sa_protocol_properties_t, char *);
 245  246  extern sa_property_t sa_get_next_protocol_section(sa_property_t, char *);
 246  247  extern sa_property_t sa_get_protocol_property(sa_protocol_properties_t, char *);
 247  248  extern sa_property_t sa_get_next_protocol_property(sa_property_t, char *);
 248  249  extern int sa_set_protocol_property(sa_property_t, char *, char *);
 249  250  extern char *sa_get_protocol_status(char *);
 250  251  extern void sa_format_free(char *);
 251  252  extern sa_protocol_properties_t sa_create_protocol_properties(char *);
↓ open down ↓ 7 lines elided ↑ open up ↑
 259  260  extern int sa_proto_change_notify(sa_share_t, char *);
 260  261  extern int sa_proto_delete_section(char *, char *);
 261  262  
 262  263  /* handle legacy (dfstab/sharetab) files */
 263  264  extern int sa_delete_legacy(sa_share_t, char *);
 264  265  extern int sa_update_legacy(sa_share_t, char *);
 265  266  extern int sa_update_sharetab(sa_share_t, char *);
 266  267  extern int sa_delete_sharetab(sa_handle_t, char *, char *);
 267  268  
 268  269  /* ZFS functions */
 269      -extern int sa_zfs_is_shared(sa_handle_t, char *);
 270      -extern int sa_group_is_zfs(sa_group_t);
 271      -extern int sa_path_is_zfs(char *);
      270 +extern boolean_t sa_zfs_is_shared(sa_handle_t, char *);
      271 +extern boolean_t sa_group_is_zfs(sa_group_t);
      272 +extern boolean_t sa_path_is_zfs(char *);
 272  273  extern int sa_zfs_setprop(sa_handle_t, char *, nvlist_t *);
 273  274  
 274  275  /* SA Handle specific functions */
 275  276  extern sa_handle_t sa_find_group_handle(sa_group_t);
 276  277  
 277  278  #ifdef  __cplusplus
 278  279  }
 279  280  #endif
 280  281  
 281  282  #endif /* _LIBSHARE_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX