From: Kay Sievers Date: Thu, 31 Jul 2014 15:15:13 +0000 (+0200) Subject: do not use __ prefix for ordinary functions X-Git-Tag: upstream/0.20140911.160207utc~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6598aaf2fb9960456bb4e6867bdb9b30f50680fc;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git do not use __ prefix for ordinary functions --- diff --git a/bus.c b/bus.c index 9e2f41b..7717545 100644 --- a/bus.c +++ b/bus.c @@ -277,7 +277,7 @@ int kdbus_bus_new(struct kdbus_domain *domain, } /* account the bus against the user */ - ret = __kdbus_domain_user_account(domain, uid, &b->user); + ret = kdbus_domain_get_user_unlocked(domain, uid, &b->user); if (ret < 0) goto exit_unref_user_unlock; diff --git a/connection.c b/connection.c index b42606c..d8c3bc0 100644 --- a/connection.c +++ b/connection.c @@ -2089,9 +2089,9 @@ int kdbus_conn_new(struct kdbus_ep *ep, if (ep->user) conn->user = kdbus_domain_user_ref(ep->user); else { - ret = kdbus_domain_user_account(ep->bus->domain, - current_fsuid(), - &conn->user); + ret = kdbus_domain_get_user(ep->bus->domain, + current_fsuid(), + &conn->user); if (ret < 0) goto exit_free_meta; } diff --git a/domain.c b/domain.c index 6f6df15..946a616 100644 --- a/domain.c +++ b/domain.c @@ -452,8 +452,7 @@ static int kdbus_domain_user_assign_id(struct kdbus_domain *domain, } /** - * __kdbus_domain_user_account() - account a kdbus_domain_user object - * into the specified domain + * kdbus_domain_get_user_unlocked() - get a kdbus_domain_user object * @domain: The domain of the user * @uid: The uid of the user; INVALID_UID for an * anonymous user like a custom endpoint @@ -467,9 +466,9 @@ static int kdbus_domain_user_assign_id(struct kdbus_domain *domain, * return it in the @user argument. Otherwise allocate a new one, * link it into the domain and return it. */ -int __kdbus_domain_user_account(struct kdbus_domain *domain, - kuid_t uid, - struct kdbus_domain_user **user) +int kdbus_domain_get_user_unlocked(struct kdbus_domain *domain, + kuid_t uid, + struct kdbus_domain_user **user) { int ret; struct kdbus_domain_user *tmp_user; @@ -519,8 +518,7 @@ exit_free: } /** - * kdbus_domain_user_account() - account a kdbus_domain_user object - * into the specified domain + * kdbus_domain_get_user() - get a kdbus_domain_user object * @domain: The domain of the user * @uid: The uid of the user; INVALID_UID for an * anonymous user like a custom endpoint @@ -528,27 +526,16 @@ exit_free: * domain user will be stored. * * Return: 0 on success, negative errno on failure. - * - * On success: if there is a uid matching, then use the already - * accounted kdbus_domain_user, increment its reference counter and - * return it in the 'user' argument. Otherwise, allocate a new one, - * link it into the domain, then return it. - * - * On failure: the 'user' argument is not updated. - * - * This function will first check if the domain was not disconnected. */ -int kdbus_domain_user_account(struct kdbus_domain *domain, - kuid_t uid, - struct kdbus_domain_user **user) +int kdbus_domain_get_user(struct kdbus_domain *domain, + kuid_t uid, + struct kdbus_domain_user **user) { int ret = -ESHUTDOWN; mutex_lock(&domain->lock); - if (!domain->disconnected) - ret = __kdbus_domain_user_account(domain, uid, user); - + ret = kdbus_domain_get_user_unlocked(domain, uid, user); mutex_unlock(&domain->lock); return ret; diff --git a/domain.h b/domain.h index 0577e5d..92d5752 100644 --- a/domain.h +++ b/domain.h @@ -99,13 +99,13 @@ int kdbus_domain_new(struct kdbus_domain *parent, const char *name, int kdbus_domain_make_user(struct kdbus_cmd_make *cmd, char **name); struct kdbus_domain *kdbus_domain_find_by_major(unsigned int major); -int __kdbus_domain_user_account(struct kdbus_domain *domain, - kuid_t uid, - struct kdbus_domain_user **user); +int kdbus_domain_get_user_unlocked(struct kdbus_domain *domain, + kuid_t uid, + struct kdbus_domain_user **user); -int kdbus_domain_user_account(struct kdbus_domain *domain, - kuid_t uid, - struct kdbus_domain_user **user); +int kdbus_domain_get_user(struct kdbus_domain *domain, + kuid_t uid, + struct kdbus_domain_user **user); struct kdbus_domain_user *kdbus_domain_user_ref(struct kdbus_domain_user *u); struct kdbus_domain_user *kdbus_domain_user_unref(struct kdbus_domain_user *u); diff --git a/handle.c b/handle.c index 59842c1..8d821d4 100644 --- a/handle.c +++ b/handle.c @@ -464,8 +464,8 @@ static long kdbus_handle_ioctl_ep(struct file *file, unsigned int cmd, * endpoint users do not share the budget with the ordinary * users created for a UID. */ - ret = kdbus_domain_user_account(handle->ep->bus->domain, - INVALID_UID, &ep->user); + ret = kdbus_domain_get_user(handle->ep->bus->domain, + INVALID_UID, &ep->user); if (ret < 0) { kdbus_ep_unref(ep); break; diff --git a/policy.c b/policy.c index 58ab6a5..a946a6c 100644 --- a/policy.c +++ b/policy.c @@ -87,7 +87,7 @@ static void kdbus_policy_entry_free(struct kdbus_policy_db_entry *e) } static const struct kdbus_policy_db_entry * -__kdbus_policy_lookup(struct kdbus_policy_db *db, +kdbus_policy_lookup(struct kdbus_policy_db *db, const char *name, u32 hash, bool wildcard) { @@ -244,7 +244,7 @@ int kdbus_policy_check_own_access(struct kdbus_policy_db *db, return 0; mutex_lock(&db->entries_lock); - e = __kdbus_policy_lookup(db, name, kdbus_str_hash(name), true); + e = kdbus_policy_lookup(db, name, kdbus_str_hash(name), true); ret = kdbus_policy_check_access(e, conn->cred, KDBUS_POLICY_OWN); mutex_unlock(&db->entries_lock); @@ -261,7 +261,7 @@ static int __kdbus_policy_check_talk_access(struct kdbus_policy_db *db, mutex_lock(&conn_dst->lock); list_for_each_entry(name_entry, &conn_dst->names_list, conn_entry) { u32 hash = kdbus_str_hash(name_entry->name); - e = __kdbus_policy_lookup(db, name_entry->name, hash, true); + e = kdbus_policy_lookup(db, name_entry->name, hash, true); if (kdbus_policy_check_access(e, current_cred(), KDBUS_POLICY_TALK) == 0) { ret = 0; @@ -371,7 +371,7 @@ int kdbus_policy_check_see_access_unlocked(struct kdbus_policy_db *db, { const struct kdbus_policy_db_entry *e; - e = __kdbus_policy_lookup(db, name, kdbus_str_hash(name), true); + e = kdbus_policy_lookup(db, name, kdbus_str_hash(name), true); return kdbus_policy_check_access(e, current_cred(), KDBUS_POLICY_SEE); } @@ -431,7 +431,7 @@ kdbus_policy_add_one(struct kdbus_policy_db *db, int ret = 0; u32 hash = kdbus_str_hash(e->name); - if (__kdbus_policy_lookup(db, e->name, hash, false)) + if (kdbus_policy_lookup(db, e->name, hash, false)) ret = -EEXIST; else hash_add(db->entries_hash, &e->hentry, hash); diff --git a/test/kdbus-util.c b/test/kdbus-util.c index 298d1ec..e04aab1 100644 --- a/test/kdbus-util.c +++ b/test/kdbus-util.c @@ -630,7 +630,7 @@ int conn_update(struct conn *conn, const char *name, /* * normally having flags == 0 is valid, but just keep - * HELLO flags of __kdbus_hello(), don't check them. + * HELLO flags of kdbus_hello(), don't check them. */ item->type = KDBUS_ITEM_ATTACH_FLAGS; item->size = KDBUS_ITEM_HEADER_SIZE + sizeof(uint64_t);