Module: xenomai-forge
Branch: master
Commit: 00de76d978fcb2af8bf3064fbd8fdc003b662f54
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=00de76d978fcb2af8bf3064fbd8fdc003b662f54

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Nov 13 17:01:28 2011 +0100

copperplate/hash, cluster: backtrace only upon init and deletion failure

We may assume that adding or finding an object in some internal table
may fail gracefully, so no backtrace in this case. Init and deletion
are still considered as no-fail services though, and as such are
backtraced upon error.

---

 lib/copperplate/cluster.c |   18 +++++++++---------
 lib/copperplate/hash.c    |    6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c
index b8608b8..31cde5e 100644
--- a/lib/copperplate/cluster.c
+++ b/lib/copperplate/cluster.c
@@ -164,8 +164,8 @@ int cluster_addobj(struct cluster *c, const char *name,
         * owner node existence, overwriting dead instances on the
         * fly.
         */
-       return __bt(hash_enter_probe(&c->d->table, name,
-                                    &cobj->hobj, cluster_probe));
+       return hash_enter_probe(&c->d->table, name,
+                               &cobj->hobj, cluster_probe);
 }
 
 int cluster_addobj_dup(struct cluster *c, const char *name,
@@ -176,8 +176,8 @@ int cluster_addobj_dup(struct cluster *c, const char *name,
         * Same as cluster_addobj(), but allows for duplicate keys in
         * live objects.
         */
-       return __bt(hash_enter_probe_dup(&c->d->table, name,
-                                        &cobj->hobj, cluster_probe));
+       return hash_enter_probe_dup(&c->d->table, name,
+                                   &cobj->hobj, cluster_probe);
 }
 
 int cluster_delobj(struct cluster *c, struct clusterobj *cobj)
@@ -228,7 +228,7 @@ int syncluster_addobj(struct syncluster *sc, const char 
*name,
        if (syncobj_lock(sc->sobj, &syns))
                return __bt(-EINVAL);
 
-       ret = __bt(cluster_addobj(&sc->c, name, cobj));
+       ret = cluster_addobj(&sc->c, name, cobj);
        if (ret)
                goto out;
 
@@ -276,7 +276,7 @@ int syncluster_findobj(struct syncluster *sc,
        int ret = 0;
 
        if (syncobj_lock(sc->sobj, &syns))
-               return __bt(-EINVAL);
+               return -EINVAL;
 
        for (;;) {
                cobj = cluster_findobj(&sc->c, name);
@@ -328,13 +328,13 @@ void pvcluster_destroy(struct pvcluster *c)
 int pvcluster_addobj(struct pvcluster *c, const char *name,
                     struct pvclusterobj *cobj)
 {
-       return __bt(pvhash_enter(&c->table, name, &cobj->hobj));
+       return pvhash_enter(&c->table, name, &cobj->hobj);
 }
 
 int pvcluster_addobj_dup(struct pvcluster *c, const char *name,
                         struct pvclusterobj *cobj)
 {
-       return __bt(pvhash_enter_dup(&c->table, name, &cobj->hobj));
+       return pvhash_enter_dup(&c->table, name, &cobj->hobj);
 }
 
 int pvcluster_delobj(struct pvcluster *c, struct pvclusterobj *cobj)
@@ -390,7 +390,7 @@ int pvsyncluster_addobj(struct pvsyncluster *sc, const char 
*name,
        if (syncobj_lock(&sc->sobj, &syns))
                return __bt(-EINVAL);
 
-       ret = __bt(pvcluster_addobj(&sc->c, name, cobj));
+       ret = pvcluster_addobj(&sc->c, name, cobj);
 
        syncobj_unlock(&sc->sobj, &syns);
 
diff --git a/lib/copperplate/hash.c b/lib/copperplate/hash.c
index e46f162..40104ab 100644
--- a/lib/copperplate/hash.c
+++ b/lib/copperplate/hash.c
@@ -142,7 +142,7 @@ int __hash_enter(struct hash_table *t,
 out:
        write_unlock(&t->lock);
 
-       return __bt(ret);
+       return ret;
 }
 
 int hash_remove(struct hash_table *t, struct hashobj *delobj)
@@ -230,7 +230,7 @@ out:
        write_unlock(&t->lock);
        pop_cleanup_lock(&t->lock);
 
-       return __bt(ret);
+       return ret;
 }
 
 struct hashobj *hash_search_probe(struct hash_table *t, const char *key,
@@ -311,7 +311,7 @@ int __pvhash_enter(struct pvhash_table *t,
 out:
        write_unlock(&t->lock);
 
-       return __bt(ret);
+       return ret;
 }
 
 int pvhash_remove(struct pvhash_table *t, struct pvhashobj *delobj)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to