sprintf(t->fname, "%s/%s", PG_PROC_DIR, t->name); t->proc_ent = create_proc_entry(t->fname, 0600, NULL); if (!t->proc_ent) { printk("pktgen: cannot create %s procfs entry.\n", t->fname); 
pe = create_proc_entry(t->name, 0600, pg_proc_dir); if (!pe) { printk("pktgen: cannot create %s/%s procfs entry.\n", PG_PROC_DIR, t->name); 
static int pktgen_create_thread(const char* name, int cpu) {        struct pktgen_thread *t = NULL;        if (strlen(name) > 31) {                printk("pktgen: ERROR:  Thread name cannot be more than 31 characters.\n");                return -EINVAL;        }                if (pktgen_find_thread(name)) {                printk("pktgen: ERROR: thread: %s already exists\n", name);                return -EINVAL;        }        t = kzalloc(sizeof(struct pktgen_thread), GFP_KERNEL);        if (!t) {                printk("pktgen: ERROR: out of memory, can't create new thread.\n");                return -ENOMEM;        }        strcpy(t->name, name);        spin_lock_init(&t->if_lock);	t->cpu = cpu;                sprintf(t->fname, "%s/%s", PG_PROC_DIR, t->name);        t->proc_ent = create_proc_entry(t->fname, 0600, NULL);        if (!t->proc_ent) {                printk("pktgen: cannot create %s procfs entry.\n", t->fname);                kfree(t);                return -EINVAL;        }        t->proc_ent->read_proc = proc_thread_read;        t->proc_ent->write_proc = proc_thread_write;        t->proc_ent->data = (void*)(t);        t->proc_ent->owner = THIS_MODULE;        t->next = pktgen_threads;        pktgen_threads = t;	if (kernel_thread((void *) pktgen_thread_worker, (void *) t, 			  CLONE_FS | CLONE_FILES | CLONE_SIGHAND) < 0)		printk("pktgen: kernel_thread() failed for cpu %d\n", t->cpu);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d50a6b56f0f239cf061630c85add121dc3555339/pktgen.c/clean/net/core/pktgen.c