Add a mapping to the ID map. */
| 1457 | |
| 1458 | /* Add a mapping to the ID map. */ |
| 1459 | staticfn void |
| 1460 | add_id_mapping(unsigned int gid, unsigned int nid) |
| 1461 | { |
| 1462 | int idx; |
| 1463 | |
| 1464 | idx = gn.n_ids_mapped % N_PER_BUCKET; |
| 1465 | /* idx is zero on first time through, as well as when a new bucket is */ |
| 1466 | /* needed */ |
| 1467 | if (idx == 0) { |
| 1468 | struct bucket *gnu = (struct bucket *) alloc(sizeof(struct bucket)); |
| 1469 | gnu->next = gi.id_map; |
| 1470 | gi.id_map = gnu; |
| 1471 | } |
| 1472 | |
| 1473 | gi.id_map->map[idx].gid = gid; |
| 1474 | gi.id_map->map[idx].nid = nid; |
| 1475 | gn.n_ids_mapped++; |
| 1476 | } |
| 1477 | |
| 1478 | /* |
| 1479 | * Global routine to look up a mapping. If found, return TRUE and fill |
no test coverage detected