* get SP by index. * OUT: NULL : not found * others : found, pointer to referenced SP. */
| 1423 | * others : found, pointer to referenced SP. |
| 1424 | */ |
| 1425 | static struct secpolicy * |
| 1426 | key_getspbyid(uint32_t id) |
| 1427 | { |
| 1428 | SPTREE_RLOCK_TRACKER; |
| 1429 | struct secpolicy *sp; |
| 1430 | |
| 1431 | SPTREE_RLOCK(); |
| 1432 | LIST_FOREACH(sp, SPHASH_HASH(id), idhash) { |
| 1433 | if (sp->id == id) { |
| 1434 | SP_ADDREF(sp); |
| 1435 | break; |
| 1436 | } |
| 1437 | } |
| 1438 | SPTREE_RUNLOCK(); |
| 1439 | return (sp); |
| 1440 | } |
| 1441 | |
| 1442 | struct secpolicy * |
| 1443 | key_newsp(void) |
no outgoing calls
no test coverage detected