struct objagg_tmp_node *node;
        struct objagg_tmp_node *pnode;
        struct objagg_obj *objagg_obj;
-       size_t alloc_size;
        int i, j;
 
        graph = kzalloc(sizeof(*graph), GFP_KERNEL);
                goto err_nodes_alloc;
        graph->nodes_count = nodes_count;
 
-       alloc_size = BITS_TO_LONGS(nodes_count * nodes_count) *
-                    sizeof(unsigned long);
-       graph->edges = kzalloc(alloc_size, GFP_KERNEL);
+       graph->edges = bitmap_zalloc(nodes_count * nodes_count, GFP_KERNEL);
        if (!graph->edges)
                goto err_edges_alloc;
 
 
 static void objagg_tmp_graph_destroy(struct objagg_tmp_graph *graph)
 {
-       kfree(graph->edges);
+       bitmap_free(graph->edges);
        kfree(graph->nodes);
        kfree(graph);
 }