SUMMARY This case adds two new interfaces to libstmf (PSARC 2007/523) for managing provider data for concurrent clients. PROBLEM There are two existing interfaces (stmfGetProviderData(3STMF), stmfSetProviderData(3STMF)) that enable a client to get and set provider data. Unfortunately there is no mechanism by which a client issuing a set operation can determine whether the set is in conflict with another client issuing a set operation on the same provider data, i.e. a set of stale data. PROPOSED SOLUTION Two new interfaces (stmfGetProviderDataProt(), stmfSetProviderDataProt()) provide the caller with a token to be retrieved on "get" and passed on "set" that will enable the client to determine on "set" whether the data retrieved from the get matching the passed token is not stale. If the token is no longer valid, the call to "set" will fail with STMF_ERROR_PROV_DATA_STALE. Alternately, the token may be set to NULL by the caller for the "get" or "set" which will effectively revert these calls to stmfGetProviderData() and stmfSetProviderData() respectively. This case will deprecate stmfGetProviderData(3STMF) and stmfSetProviderData(3STMF). MANPAGE ADDITIONS stmfGetProviderDataProt(3STMF): NAME stmfGetProviderDataProt - retrieve the data for the specified provider SYNOPSIS cc [ flag... ] file... -lstmf [ library... ] #include int stmfGetProviderDataProt(char *providerName, nvlist_t **nvl, int providerType, uint64_t *token); PARAMETERS providerName The name of the provider for which data is being retrieved. nvl A pointer to a pointer to an nvlist_t. On success, this will contain the nvlist retrieved. Caller is responsible for freeing the returned nvlist by calling nvlist_free(3NVPAIR). providerType The value for this parameter must be either STMF_LU_PROVIDER_TYPE or STMF_PORT_PROVIDER_TYPE. token A pointer to a uint64_t allocated by the caller. On success, this will contain a token for the returned data that can be used in a call to stmfSetProviderDataProt(3STMF) to ensure that the data returned in this call is not stale. If this value is NULL, the token will be ignored. DESCRIPTION The stmfGetProviderDataProt() function retrieves the data for the specified provider. RETURN VALUES The following values are returned: STMF_ERROR_NOMEM The library was unable to allocate sufficient memory to return the data. STMF_STATUS_SUCCESS The API call was successful. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: _____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| | MT-Level | Safe | |_____________________________|_____________________________| SEE ALSO libstmf(3LIB), nvlist_free(3NVPAIR), attributes(5) stmfSetProviderDataProt(3STMF): NAME stmfSetProviderDataProt - set the data for the specified provider SYNOPSIS cc [ flag... ] file... -lstmf [ library... ] #include int stmfSetProviderData(char *providerName, nvlist_t **nvl, int providerType, uint64_t *token); PARAMETERS providerName The name of the provider for which data is being set. nvl A pointer to a an nvlist_t containing the nvlist to be set. providerType The value for this parameter must be either STMF_LU_PROVIDER_TYPE or STMF_PORT_PROVIDER_TYPE. token A pointer to a uint64_t that contains the value returned from a successful call to stmfGetProviderDataProt(3STMF). If this argument is NULL, the token is ignored. Otherwise, the token will be verified against the current data. If the token represents stale data, the call fails. On success, this will contain the new token for the data being set and can be used in subsequent calls to stmfSetProviderData. On failure the contents are undefined. DESCRIPTION The stmfSetProviderDataProt() function sets the data for the specified provider. RETURN VALUES The following values are returned: STMF_ERROR_PROV_DATA_STALE The token value represents stale data. STMF_STATUS_SUCCESS The API call was successful. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: _____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| | MT-Level | Safe | |_____________________________|_____________________________| SEE ALSO libstmf(3LIB), nvlist_free(3NVPAIR), attributes(5) stmfGetProviderData(3STMF) . . . ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: _____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| ! | Interface Stability | Obsolete Committed | |_____________________________|_____________________________| | MT-Level | Safe | |_____________________________|_____________________________| + NOTES + This interface is deprecated in favor of + stmfGetProviderDataProt(3STMF) and may be removed in a future + revision of libstmf(3STMF). stmfSetProviderData(3STMF) . . . ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: _____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| ! | Interface Stability | Obsolete Committed | |_____________________________|_____________________________| | MT-Level | Safe | |_____________________________|_____________________________| + NOTES + This interface is deprecated in favor of + stmfSetProviderDataProt(3STMF) and may be removed in a future + revision of libstmf(3STMF).