Index: uspace/app/trace/proto.c
===================================================================
--- uspace/app/trace/proto.c	(revision ffa2c8ef45390c01f3f4be4827bcd41c32f7951c)
+++ uspace/app/trace/proto.c	(revision 0ca7286a618557bd1d13cded4ccbe25d62752237)
@@ -40,8 +40,7 @@
 #include "proto.h"
 
-#define SRV_PROTO_TABLE_CHAINS 32
-#define METHOD_OPER_TABLE_CHAINS 32
-
-hash_table_t srv_proto;
+
+/* Maps service number to protocol */
+static hash_table_t srv_proto;
 
 typedef struct {
@@ -57,96 +56,91 @@
 } method_oper_t;
 
-static hash_index_t srv_proto_hash(unsigned long key[]);
-static int srv_proto_compare(unsigned long key[], hash_count_t keys,
-    link_t *item);
-static void srv_proto_remove_callback(link_t *item);
-
-hash_table_operations_t srv_proto_ops = {
+
+
+
+static size_t srv_proto_key_hash(unsigned long key[])
+{
+	return key[0];
+}
+
+static size_t srv_proto_hash(const link_t *item)
+{
+	srv_proto_t *sp = hash_table_get_instance(item, srv_proto_t, link);
+	unsigned long key = sp->srv;
+	return srv_proto_key_hash(&key);	
+}
+
+static bool srv_proto_match(unsigned long key[], size_t keys, const link_t *item)
+{
+	srv_proto_t *sp = hash_table_get_instance(item, srv_proto_t, link);
+
+	return key[0] == sp->srv;
+}
+
+static hash_table_ops_t srv_proto_ops = {
 	.hash = srv_proto_hash,
-	.compare = srv_proto_compare,
-	.remove_callback = srv_proto_remove_callback
+	.key_hash = srv_proto_key_hash,
+	.match = srv_proto_match,
+	.equal = 0,
+	.remove_callback = 0
 };
 
-static hash_index_t method_oper_hash(unsigned long key[]);
-static int method_oper_compare(unsigned long key[], hash_count_t keys,
-    link_t *item);
-static void method_oper_remove_callback(link_t *item);
-
-hash_table_operations_t method_oper_ops = {
+
+static size_t method_oper_key_hash(unsigned long key[])
+{
+	return key[0];
+}
+
+static size_t method_oper_hash(const link_t *item)
+{
+	method_oper_t *mo = hash_table_get_instance(item, method_oper_t, link);
+	unsigned long key = mo->method;
+	return method_oper_key_hash(&key);
+}
+
+static bool method_oper_match(unsigned long key[], size_t keys, 
+	const link_t *item)
+{
+	method_oper_t *mo = hash_table_get_instance(item, method_oper_t, link);
+
+	return key[0] == mo->method;
+}
+
+static hash_table_ops_t method_oper_ops = {
 	.hash = method_oper_hash,
-	.compare = method_oper_compare,
-	.remove_callback = method_oper_remove_callback
+	.key_hash = method_oper_key_hash,
+	.match = method_oper_match,
+	.equal = 0,
+	.remove_callback = 0
 };
 
-static hash_index_t srv_proto_hash(unsigned long key[])
-{
-	return key[0] % SRV_PROTO_TABLE_CHAINS;
-}
-
-static int srv_proto_compare(unsigned long key[], hash_count_t keys,
-    link_t *item)
+
+void proto_init(void)
+{
+	hash_table_create(&srv_proto, 0, 1, &srv_proto_ops);
+}
+
+void proto_cleanup(void)
+{
+	hash_table_destroy(&srv_proto);
+}
+
+void proto_register(int srv, proto_t *proto)
 {
 	srv_proto_t *sp;
-
-	sp = hash_table_get_instance(item, srv_proto_t, link);
-
-	return key[0] == sp->srv;
-}
-
-static void srv_proto_remove_callback(link_t *item)
-{
-}
-
-static hash_index_t method_oper_hash(unsigned long key[])
-{
-	return key[0] % METHOD_OPER_TABLE_CHAINS;
-}
-
-static int method_oper_compare(unsigned long key[], hash_count_t keys,
-    link_t *item)
-{
-	method_oper_t *mo;
-
-	mo = hash_table_get_instance(item, method_oper_t, link);
-
-	return key[0] == mo->method;
-}
-
-static void method_oper_remove_callback(link_t *item)
-{
-}
-
-
-void proto_init(void)
-{
-	hash_table_create(&srv_proto, SRV_PROTO_TABLE_CHAINS, 1,
-	    &srv_proto_ops);
-}
-
-void proto_cleanup(void)
-{
-	hash_table_destroy(&srv_proto);
-}
-
-void proto_register(int srv, proto_t *proto)
-{
-	srv_proto_t *sp;
-	unsigned long key;
 
 	sp = malloc(sizeof(srv_proto_t));
 	sp->srv = srv;
 	sp->proto = proto;
-	key = srv;
-
-	hash_table_insert(&srv_proto, &key, &sp->link);
+
+	hash_table_insert(&srv_proto, &sp->link);
 }
 
 proto_t *proto_get_by_srv(int srv)
 {
-	unsigned long key;
 	link_t *item;
 	srv_proto_t *sp;
 
-	key = srv;
+	unsigned long key = srv;
 	item = hash_table_find(&srv_proto, &key);
 	if (item == NULL) return NULL;
@@ -159,6 +153,5 @@
 {
 	proto->name = name;
-	hash_table_create(&proto->method_oper, SRV_PROTO_TABLE_CHAINS, 1,
-	    &method_oper_ops);
+	hash_table_create(&proto->method_oper, 0, 1, &method_oper_ops);
 }
 
@@ -181,12 +174,10 @@
 {
 	method_oper_t *mo;
-	unsigned long key;
 
 	mo = malloc(sizeof(method_oper_t));
 	mo->method = method;
 	mo->oper = oper;
-	key = method;
-
-	hash_table_insert(&proto->method_oper, &key, &mo->link);	
+
+	hash_table_insert(&proto->method_oper, &mo->link);	
 }
 
