Beispiel #1
0
static void
afs_addevent(char *event)
{
    int hashcode;
    afs_event_t *newp;

    AFS_ASSERT_GLOCK();
    hashcode = afs_evhash(event);
    newp = osi_linux_alloc(sizeof(afs_event_t), 0);
    afs_evhashcnt++;
    newp->next = afs_evhasht[hashcode];
    afs_evhasht[hashcode] = newp;
    init_waitqueue_head(&newp->cond);
    newp->seq = 0;
    newp->event = &dummyV;	/* Dummy address for new events */
    newp->refcount = 0;
}
Beispiel #2
0
void *
afs_osi_Alloc(size_t size)
{
    AFS_STATCNT(osi_Alloc);
    /* 0-length allocs may return NULL ptr from AFS_KALLOC, so we special-case
     * things so that NULL returned iff an error occurred */
    if (size == 0)
	return &memZero;

    AFS_STATS(afs_stats_cmperf.OutStandingAllocs++);
    AFS_STATS(afs_stats_cmperf.OutStandingMemUsage += size);
#ifdef AFS_LINUX20_ENV
    return osi_linux_alloc(size, 1);
#elif defined(AFS_FBSD_ENV)
    return osi_fbsd_alloc(size, 1);
#else
    return AFS_KALLOC(size);
#endif
}