Print this page
4095 minor cleanup up libshare

@@ -22,10 +22,14 @@
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright (c) 2013 RackTop Systems.
+ */
+
 /* helper functions for using libscf with sharemgr */
 
 #include <libscf.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>

@@ -41,12 +45,12 @@
 #include <sys/time.h>
 #include <libintl.h>
 
 ssize_t scf_max_name_len;
 extern struct sa_proto_plugin *sap_proto_list;
-extern sa_handle_impl_t get_handle_for_root(xmlNodePtr);
-static void set_transaction_tstamp(sa_handle_impl_t);
+extern sa_handle_t get_handle_for_root(xmlNodePtr);
+static void set_transaction_tstamp(sa_handle_t);
 /*
  * The SMF facility uses some properties that must exist. We want to
  * skip over these when processing protocol options.
  */
 static char *skip_props[] = {

@@ -95,11 +99,11 @@
  * Must be called before using any of the SCF functions. Called by
  * sa_init() during the API setup.
  */
 
 scfutilhandle_t *
-sa_scf_init(sa_handle_impl_t ihandle)
+sa_scf_init(sa_handle_t ihandle)
 {
         scfutilhandle_t *handle;
 
         scf_max_name_len = scf_limit(SCF_LIMIT_MAX_NAME_LENGTH);
         if (scf_max_name_len <= 0)

@@ -139,11 +143,11 @@
                 goto err;
 
         handle->scf_state = SCH_STATE_INIT;
         if (sa_get_instance(handle, "default") != SA_OK) {
                 sa_group_t defgrp;
-                defgrp = sa_create_group((sa_handle_t)ihandle, "default", NULL);
+                defgrp = sa_create_group(ihandle, "default", NULL);
                 /* Only NFS enabled for "default" group. */
                 if (defgrp != NULL)
                         (void) sa_create_optionset(defgrp, "nfs");
         }
 

@@ -1347,11 +1351,11 @@
  * Commit the changes that were added to the transaction in the
  * handle. Do all necessary cleanup.
  */
 
 int
-sa_end_transaction(scfutilhandle_t *handle, sa_handle_impl_t sahandle)
+sa_end_transaction(scfutilhandle_t *handle, sa_handle_t sahandle)
 {
         int ret = SA_OK;
 
         if (handle == NULL || handle->trans == NULL || sahandle == NULL) {
                 ret = SA_SYSTEM_ERR;

@@ -1390,11 +1394,11 @@
  *
  * After a successful transaction commit, update the timestamp of the
  * last transaction. This lets us detect changes from other processes.
  */
 static void
-set_transaction_tstamp(sa_handle_impl_t sahandle)
+set_transaction_tstamp(sa_handle_t sahandle)
 {
         char tstring[32];
         struct timeval tv;
         scfutilhandle_t *scfhandle;
 

@@ -1774,13 +1778,12 @@
                                         sa_free_share_description(description);
                                 }
                         }
                         /* Make sure we cleanup the transaction */
                         if (ret == SA_OK) {
-                                sa_handle_impl_t sahandle;
-                                sahandle = (sa_handle_impl_t)
-                                    sa_find_group_handle(group);
+                                sa_handle_t sahandle;
+                                sahandle = sa_find_group_handle(group);
                                 if (sahandle != NULL)
                                         ret = sa_end_transaction(handle,
                                             sahandle);
                                 else
                                         ret = SA_SYSTEM_ERR;