diff --git a/include/core/jconfiguration.h b/include/core/jconfiguration.h index a31edef8c..ca84c0b5a 100644 --- a/include/core/jconfiguration.h +++ b/include/core/jconfiguration.h @@ -44,15 +44,14 @@ struct JConfiguration; typedef struct JConfiguration JConfiguration; -struct JStorageTier { +struct JStorageTier +{ guint64 bandwidth; ///< bandwidth in byte ber second guint64 latency; ///< latency in ns guint64 capacity; ///< capacity in byte }; typedef struct JStorageTier JStorageTier; - - /** * Returns the configuration. * @@ -127,7 +126,7 @@ guint64 j_configuration_get_stripe_size(JConfiguration*); gchar const* j_configuration_get_object_policy_kv_backend(JConfiguration*); gchar const* j_configuration_get_object_policy_kv_path(JConfiguration*); gchar const* j_configuration_get_object_policy(JConfiguration*); -gchar const*const* j_configuration_get_object_policy_args(JConfiguration*); +gchar const* const* j_configuration_get_object_policy_args(JConfiguration*); G_END_DECLS /** diff --git a/include/core/jmanagedbackends.h b/include/core/jmanagedbackends.h index f4c718ba5..e7a345fce 100644 --- a/include/core/jmanagedbackends.h +++ b/include/core/jmanagedbackends.h @@ -58,23 +58,23 @@ typedef struct JBackend JBackend; * \defgroup JStorageTier * * \todo evaluate characteristics - + * Collection of characteristics about a storage media, used for distribution - * decisions by the policy. + * decisions by the policy. * * \attention all values contained in this may only fixed values * and as this not measured! - * + * * @{ **/ struct JStorageTier; typedef struct JStorageTier JStorageTier; -/** +/** * get estimated storage tier bandwidth in bytes per second * - * \param[in] this a storage tier + * \param[in] this a storage tier * * \return mean of bandwidth in bytes per second **/ @@ -104,7 +104,7 @@ struct JManagedBackends; typedef struct JManagedBackends JManagedBackends; /** - * Contains data about an ongoing access to a object. + * Contains data about an ongoing access to a object. **/ struct JManagedBackendScope; typedef struct JManagedBackendScope JManagedBackendScope; @@ -146,7 +146,7 @@ typedef struct * The list is like the strings NULL terminated * \param[in] backends access to the object backend instances. **/ - gboolean (*init)(gpointer* policy_data, gchar const*const* args, JManagedBackends* backends); + gboolean (*init)(gpointer* policy_data, gchar const* const* args, JManagedBackends* backends); /** * \param[in] policy_data data at address assigned in init @@ -169,7 +169,7 @@ typedef struct * the object is currently stored on * \param[in] access type of access performed \sa JObjectBackendAccessType * \param[in] data corresponding to the access type. - * For more details see \ref JObjectBackendAccessDetails + * For more details see \ref JObjectBackendAccessDetails **/ gboolean (*process_access)(gpointer policy_data, const gchar* namespace, const gchar* path, guint obj_id, guint tier, JObjectBackendAccessTypes access, gconstpointer data); @@ -211,7 +211,7 @@ typedef struct JObjectBackendPolicy* backend_policy_info(void); /** - * \defgroup JObjectBackendAccessDetails + * \defgroup JObjectBackendAccessDetails * * Structs used to pass additional data on a * JObjectBackendPolicy.process_access call @@ -244,7 +244,7 @@ gboolean j_backend_managed_fini(JManagedBackends* this); /** * Hands current thread to policy as processing resource - * \sa JObjectBackendPolicy + * \sa JObjectBackendPolicy * * \param[in] this JManagedBackends instance * \param[out] keep_running signals if the policy processing function should be called again after return @@ -283,7 +283,7 @@ gboolean j_backend_managed_object_close(JManagedBackendScope* scope); /** * Sends a message to the policy. - * \todo add reply channel + * \todo add reply channel * * \param[in] this JManagedBackends instance * \param[in] type message type encoded as 0-terminated string @@ -368,7 +368,6 @@ gboolean j_backend_managed_unlock(JManagedBackends* this); **/ gboolean j_backend_managed_get_all(JManagedBackends* this, gchar const* namespace, gpointer* iterator); - /** * Iterate all object paths in a namespace with a given prefix * @@ -387,7 +386,7 @@ gboolean j_backend_managed_get_by_prefix(JManagedBackends* this, gchar const* na * \attention Objects added or removed while iterating may invalidates the iterator. This depends on the used kv-store-backend for the JManagedBackends * * \param[in] this JManagedBackends instance - * \param[inout] iterator + * \param[inout] iterator * \param[out] path of next object * * \sa j_backend_managed_get_all(), j_backend_managed_get_by_prefix() diff --git a/lib/core/jbatch.c b/lib/core/jbatch.c index c83869310..3135d056a 100644 --- a/lib/core/jbatch.c +++ b/lib/core/jbatch.c @@ -118,7 +118,7 @@ j_batch_new(JSemantics* semantics) } JBatch* - j_batch_new_for_template(JSemanticsTemplate template) +j_batch_new_for_template(JSemanticsTemplate template) { J_TRACE_FUNCTION(NULL); diff --git a/lib/core/jmanagedbackends.c b/lib/core/jmanagedbackends.c index ff921d1a9..787aa2db6 100644 --- a/lib/core/jmanagedbackends.c +++ b/lib/core/jmanagedbackends.c @@ -30,13 +30,13 @@ typedef struct { gint read_access_count; ///< number of read access - guint generation; ///< generation count, incremented after each write_access - gint write_access; ///< true if a write operation is scheduled or running + guint generation; ///< generation count, incremented after each write_access + gint write_access; ///< true if a write operation is scheduled or running } RWSpinLock; /// acquired a read lock /** \public \memberof RWSpinLock - * \return data gegenartion when clock is acquired + * \return data gegenartion when clock is acquired * \sa read_unlock */ guint read_lock(RWSpinLock* this); @@ -47,7 +47,7 @@ void read_unlock(RWSpinLock* this); /// acquire a write lock /** \public \memberof RWSpinLock - * this will increase the generation count + * this will increase the generation count * \return generation before * \sa write_unlock*/ guint write_lock(RWSpinLock* this); @@ -275,9 +275,11 @@ write_unlock(RWSpinLock* this) } /// proxy function -gchar const*const* j_configuration_get_object_tiers(JConfiguration* config); -gchar const*const* j_configuration_get_object_tiers(JConfiguration* config) { - (void) config; +gchar const* const* j_configuration_get_object_tiers(JConfiguration* config); +gchar const* const* +j_configuration_get_object_tiers(JConfiguration* config) +{ + (void)config; return NULL; } @@ -285,12 +287,12 @@ gboolean j_backend_managed_init(JConfiguration* config, JList* object_backends, JManagedBackends** instance_ptr) { JListIterator* itr; - gchar const*const* tier_itr; + gchar const* const* tier_itr; JManagedBackends* this; struct JBackendWrapper** b_itr; struct JStorageTier** t_itr; const gchar* policy_name = j_configuration_get_object_policy(config); - char const*const* policy_args = j_configuration_get_object_policy_args(config); + char const* const* policy_args = j_configuration_get_object_policy_args(config); JObjectBackendPolicy* (*module_backend_policy_info)(void) = NULL; JObjectBackendPolicy* tmp_policy; *instance_ptr = malloc(sizeof(JManagedBackends)); @@ -432,10 +434,10 @@ gboolean j_backend_managed_object_create(JManagedBackends* this, const gchar* na /// \TODO remove scope return <- just complete virtual gboolean j_backend_managed_object_open(JManagedBackends* this, - const gchar* namespace, - const gchar* path, - JBackend** backend, - JManagedBackendScope** scope) + const gchar* namespace, + const gchar* path, + JBackend** backend, + JManagedBackendScope** scope) { struct KVEntry* entry; struct JBackendWrapper* wrapper; @@ -475,10 +477,10 @@ j_backend_managed_object_open(JManagedBackends* this, gboolean j_backend_managed_object_create(JManagedBackends* this, - const gchar* namespace, - const gchar* path, - JBackend** backend, - JManagedBackendScope** scope) + const gchar* namespace, + const gchar* path, + JBackend** backend, + JManagedBackendScope** scope) { gboolean ret = FALSE; struct JBackendWrapper* wrapper; @@ -543,7 +545,7 @@ j_backend_managed_object_close(JManagedBackendScope* this) gboolean j_backend_managed_policy_message(JManagedBackends* this, - const gchar* type, gpointer data, guint length) + const gchar* type, gpointer data, guint length) { if (this->policy->process_message) { @@ -565,7 +567,7 @@ j_backend_managed_get_tiers(JManagedBackends* this, JStorageTier const* const** guint j_backend_managed_get_tier(JManagedBackends* this, - const gchar* namespace, const gchar* path) + const gchar* namespace, const gchar* path) { struct KVEntry* entry; EXE(kv_get(this, namespace, path, &entry), @@ -631,8 +633,8 @@ kv_rm(JManagedBackends* this, const gchar* namespace, const gchar* key) gboolean j_backend_managed_lock(JManagedBackends* this, - JBackend*** backends, - guint* length) + JBackend*** backends, + guint* length) { write_lock(&this->global_lock); if (backends != NULL) @@ -705,9 +707,9 @@ j_backend_storage_tier_get_capacity(const JStorageTier* this) gboolean j_backend_managed_object_migrate(JManagedBackends* this, - const gchar* namespace, - const gchar* path, - guint dest) + const gchar* namespace, + const gchar* path, + guint dest) { struct KVEntry* entry; struct KVEntry new_entry; diff --git a/tools/config.c b/tools/config.c index da172368f..c85252ed4 100644 --- a/tools/config.c +++ b/tools/config.c @@ -110,7 +110,6 @@ write_config(gchar* path) servers_kv = string_split(opt_servers_kv); servers_db = string_split(opt_servers_db); object_policy_args = string_split(opt_object_policy_args); - key_file = g_key_file_new(); g_key_file_set_int64(key_file, "core", "max-operation-size", opt_max_operation_size); @@ -133,7 +132,7 @@ write_config(gchar* path) g_key_file_set_string(key_file, "object.hsm-policy", "kv_backend", opt_object_policy_kv_backend); g_key_file_set_string(key_file, "object.hsm-policy", "kv_path", opt_object_policy_kv_path); g_key_file_set_string(key_file, "object.hsm-policy", "policy", opt_object_policy); - g_key_file_set_string_list(key_file, "object.hsm-policy", "args", (gchar const*const*)object_policy_args, g_strv_length(object_policy_args)); + g_key_file_set_string_list(key_file, "object.hsm-policy", "args", (gchar const* const*)object_policy_args, g_strv_length(object_policy_args)); key_file_data = g_key_file_to_data(key_file, &key_file_data_len, NULL); if (path != NULL)