Lines 523-528
static const struct inode_operations pro
Link Here
|
523 |
|
523 |
|
524 |
static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp) |
524 |
static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp) |
525 |
{ |
525 |
{ |
|
|
526 |
struct proc_dir_entry * tmp = NULL; |
526 |
unsigned int i; |
527 |
unsigned int i; |
527 |
|
528 |
|
528 |
i = get_inode_number(); |
529 |
i = get_inode_number(); |
Lines 547-552
static int proc_register(struct proc_dir
Link Here
|
547 |
} |
548 |
} |
548 |
|
549 |
|
549 |
spin_lock(&proc_subdir_lock); |
550 |
spin_lock(&proc_subdir_lock); |
|
|
551 |
/* make sure name is different from the others */ |
552 |
for(tmp = dir->subdir; tmp; tmp = tmp->next) |
553 |
if(!strcmp(dp->name, tmp->name)) { |
554 |
spin_unlock(&proc_subdir_lock); |
555 |
release_inode_number(i); |
556 |
return -EEXIST; |
557 |
} |
558 |
|
550 |
dp->next = dir->subdir; |
559 |
dp->next = dir->subdir; |
551 |
dp->parent = dir; |
560 |
dp->parent = dir; |
552 |
dir->subdir = dp; |
561 |
dir->subdir = dp; |