From: "Changli Gao" Function proc_register() will assign proc_dir_operations and proc_dir_inode_operations to ent's members proc_fops and proc_iops correctly if ent is a directory. So the early assignment isn't necessary. Signed-off-by: Andrew Morton --- fs/proc/generic.c | 7 ------- 1 file changed, 7 deletions(-) diff -puN fs/proc/generic.c~procfs-directory-entry-cleanup fs/proc/generic.c --- a/fs/proc/generic.c~procfs-directory-entry-cleanup +++ a/fs/proc/generic.c @@ -653,9 +653,6 @@ struct proc_dir_entry *proc_mkdir_mode(c ent = proc_create(&parent, name, S_IFDIR | mode, 2); if (ent) { - ent->proc_fops = &proc_dir_operations; - ent->proc_iops = &proc_dir_inode_operations; - if (proc_register(parent, ent) < 0) { kfree(ent); ent = NULL; @@ -690,10 +687,6 @@ struct proc_dir_entry *create_proc_entry ent = proc_create(&parent,name,mode,nlink); if (ent) { - if (S_ISDIR(mode)) { - ent->proc_fops = &proc_dir_operations; - ent->proc_iops = &proc_dir_inode_operations; - } if (proc_register(parent, ent) < 0) { kfree(ent); ent = NULL; _