ktrace_alloc(int nentries, int sleep) 
ktrace_alloc(int nentries, unsigned int __nocast sleep) 
ktrace_alloc(int nentries, int sleep){	ktrace_t        *ktp;	ktrace_entry_t  *ktep;	ktp = (ktrace_t*)kmem_zone_alloc(ktrace_hdr_zone, sleep);	if (ktp == (ktrace_t*)NULL) {		/*		 * KM_SLEEP callers don't expect failure.		 */		if (sleep & KM_SLEEP)			panic("ktrace_alloc: NULL memory on KM_SLEEP request!");		return NULL;	}	/*	 * Special treatment for buffers with the ktrace_zentries entries	 */	if (nentries == ktrace_zentries) {		ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone,							    sleep);	} else {		ktep = (ktrace_entry_t*)kmem_zalloc((nentries * sizeof(*ktep)),							    sleep);	}	if (ktep == NULL) {		/*		 * KM_SLEEP callers don't expect failure.		 */		if (sleep & KM_SLEEP)			panic("ktrace_alloc: NULL memory on KM_SLEEP request!");		kmem_free(ktp, sizeof(*ktp));		return NULL;	}	spinlock_init(&(ktp->kt_lock), "kt_lock");	ktp->kt_entries  = ktep;	ktp->kt_nentries = nentries;	ktp->kt_index    = 0;	ktp->kt_rollover = 0;	return ktp;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4750ddb0ba781006f149fdd87bbe997cb8c07e2e/ktrace.c/buggy/fs/xfs/support/ktrace.c