aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DocBook/procfs_example.c9
-rw-r--r--arch/alpha/kernel/srm_env.c5
-rw-r--r--arch/blackfin/mm/sram-alloc.c1
-rw-r--r--arch/ia64/kernel/palinfo.c2
-rw-r--r--arch/ia64/sn/kernel/sn2/prominfo_proc.c9
-rw-r--r--arch/powerpc/kernel/rtas_flash.c1
-rw-r--r--arch/sparc/kernel/led.c1
-rw-r--r--arch/x86/kernel/cpu/mtrr/if.c10
-rw-r--r--drivers/acpi/ac.c1
-rw-r--r--drivers/acpi/battery.c1
-rw-r--r--drivers/acpi/button.c3
-rw-r--r--drivers/acpi/fan.c2
-rw-r--r--drivers/acpi/processor_core.c2
-rw-r--r--drivers/acpi/sbs.c1
-rw-r--r--drivers/acpi/thermal.c2
-rw-r--r--drivers/acpi/video.c5
-rw-r--r--drivers/block/ps3vram.c2
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c12
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c6
-rw-r--r--drivers/input/input.c2
-rw-r--r--drivers/isdn/hardware/eicon/divasi.c1
-rw-r--r--drivers/media/video/cpia.c4
-rw-r--r--drivers/message/i2o/i2o_proc.c2
-rw-r--r--drivers/net/bonding/bond_main.c35
-rw-r--r--drivers/net/irda/vlsi_ir.c7
-rw-r--r--drivers/net/wireless/airo.c1
-rw-r--r--drivers/platform/x86/asus_acpi.c3
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c2
-rw-r--r--drivers/platform/x86/toshiba_acpi.c3
-rw-r--r--drivers/rtc/rtc-proc.c10
-rw-r--r--drivers/s390/block/dasd_proc.c2
-rw-r--r--drivers/scsi/scsi_devinfo.c2
-rw-r--r--drivers/scsi/scsi_proc.c3
-rw-r--r--drivers/video/via/viafbdev.c5
-rw-r--r--fs/afs/proc.c1
-rw-r--r--fs/cifs/cifs_debug.c1
-rw-r--r--fs/jfs/jfs_debug.c1
-rw-r--r--fs/nfs/client.c2
-rw-r--r--fs/proc/generic.c63
-rw-r--r--fs/proc/inode-alloc.txt14
-rw-r--r--fs/proc/inode.c21
-rw-r--r--fs/proc/internal.h1
-rw-r--r--fs/proc/proc_tty.c1
-rw-r--r--fs/proc/task_mmu.c8
-rw-r--r--fs/proc/uptime.c38
-rw-r--r--fs/reiserfs/procfs.c5
-rw-r--r--include/linux/ipmi_smi.h2
-rw-r--r--include/linux/proc_fs.h4
-rw-r--r--net/appletalk/atalk_proc.c1
-rw-r--r--net/atm/mpoa_proc.c1
-rw-r--r--net/atm/proc.c1
-rw-r--r--net/can/bcm.c4
-rw-r--r--net/can/proc.c2
-rw-r--r--net/core/pktgen.c1
-rw-r--r--net/irda/irproc.c1
-rw-r--r--net/llc/llc_proc.c1
-rw-r--r--net/sctp/protocol.c8
-rw-r--r--net/sunrpc/cache.c4
-rw-r--r--net/sunrpc/stats.c10
-rw-r--r--sound/core/info.c31
60 files changed, 103 insertions, 281 deletions
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c
index 8c6396e4bf31..a5b11793b1e0 100644
--- a/Documentation/DocBook/procfs_example.c
+++ b/Documentation/DocBook/procfs_example.c
@@ -117,9 +117,6 @@ static int __init init_procfs_example(void)
117 rv = -ENOMEM; 117 rv = -ENOMEM;
118 goto out; 118 goto out;
119 } 119 }
120
121 example_dir->owner = THIS_MODULE;
122
123 /* create jiffies using convenience function */ 120 /* create jiffies using convenience function */
124 jiffies_file = create_proc_read_entry("jiffies", 121 jiffies_file = create_proc_read_entry("jiffies",
125 0444, example_dir, 122 0444, example_dir,
@@ -130,8 +127,6 @@ static int __init init_procfs_example(void)
130 goto no_jiffies; 127 goto no_jiffies;
131 } 128 }
132 129
133 jiffies_file->owner = THIS_MODULE;
134
135 /* create foo and bar files using same callback 130 /* create foo and bar files using same callback
136 * functions 131 * functions
137 */ 132 */
@@ -146,7 +141,6 @@ static int __init init_procfs_example(void)
146 foo_file->data = &foo_data; 141 foo_file->data = &foo_data;
147 foo_file->read_proc = proc_read_foobar; 142 foo_file->read_proc = proc_read_foobar;
148 foo_file->write_proc = proc_write_foobar; 143 foo_file->write_proc = proc_write_foobar;
149 foo_file->owner = THIS_MODULE;
150 144
151 bar_file = create_proc_entry("bar", 0644, example_dir); 145 bar_file = create_proc_entry("bar", 0644, example_dir);
152 if(bar_file == NULL) { 146 if(bar_file == NULL) {
@@ -159,7 +153,6 @@ static int __init init_procfs_example(void)
159 bar_file->data = &bar_data; 153 bar_file->data = &bar_data;
160 bar_file->read_proc = proc_read_foobar; 154 bar_file->read_proc = proc_read_foobar;
161 bar_file->write_proc = proc_write_foobar; 155 bar_file->write_proc = proc_write_foobar;
162 bar_file->owner = THIS_MODULE;
163 156
164 /* create symlink */ 157 /* create symlink */
165 symlink = proc_symlink("jiffies_too", example_dir, 158 symlink = proc_symlink("jiffies_too", example_dir,
@@ -169,8 +162,6 @@ static int __init init_procfs_example(void)
169 goto no_symlink; 162 goto no_symlink;
170 } 163 }
171 164
172 symlink->owner = THIS_MODULE;
173
174 /* everything OK */ 165 /* everything OK */
175 printk(KERN_INFO "%s %s initialised\n", 166 printk(KERN_INFO "%s %s initialised\n",
176 MODULE_NAME, MODULE_VERS); 167 MODULE_NAME, MODULE_VERS);
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index 78ad7cd1bbd6..d12af472e1c0 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -218,7 +218,6 @@ srm_env_init(void)
218 BASE_DIR); 218 BASE_DIR);
219 goto cleanup; 219 goto cleanup;
220 } 220 }
221 base_dir->owner = THIS_MODULE;
222 221
223 /* 222 /*
224 * Create per-name subdirectory 223 * Create per-name subdirectory
@@ -229,7 +228,6 @@ srm_env_init(void)
229 BASE_DIR, NAMED_DIR); 228 BASE_DIR, NAMED_DIR);
230 goto cleanup; 229 goto cleanup;
231 } 230 }
232 named_dir->owner = THIS_MODULE;
233 231
234 /* 232 /*
235 * Create per-number subdirectory 233 * Create per-number subdirectory
@@ -241,7 +239,6 @@ srm_env_init(void)
241 goto cleanup; 239 goto cleanup;
242 240
243 } 241 }
244 numbered_dir->owner = THIS_MODULE;
245 242
246 /* 243 /*
247 * Create all named nodes 244 * Create all named nodes
@@ -254,7 +251,6 @@ srm_env_init(void)
254 goto cleanup; 251 goto cleanup;
255 252
256 entry->proc_entry->data = (void *) entry; 253 entry->proc_entry->data = (void *) entry;
257 entry->proc_entry->owner = THIS_MODULE;
258 entry->proc_entry->read_proc = srm_env_read; 254 entry->proc_entry->read_proc = srm_env_read;
259 entry->proc_entry->write_proc = srm_env_write; 255 entry->proc_entry->write_proc = srm_env_write;
260 256
@@ -275,7 +271,6 @@ srm_env_init(void)
275 271
276 entry->id = var_num; 272 entry->id = var_num;
277 entry->proc_entry->data = (void *) entry; 273 entry->proc_entry->data = (void *) entry;
278 entry->proc_entry->owner = THIS_MODULE;
279 entry->proc_entry->read_proc = srm_env_read; 274 entry->proc_entry->read_proc = srm_env_read;
280 entry->proc_entry->write_proc = srm_env_write; 275 entry->proc_entry->write_proc = srm_env_write;
281 } 276 }
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
index 834cab7438a8..530d1393a232 100644
--- a/arch/blackfin/mm/sram-alloc.c
+++ b/arch/blackfin/mm/sram-alloc.c
@@ -854,7 +854,6 @@ static int __init sram_proc_init(void)
854 printk(KERN_WARNING "unable to create /proc/sram\n"); 854 printk(KERN_WARNING "unable to create /proc/sram\n");
855 return -1; 855 return -1;
856 } 856 }
857 ptr->owner = THIS_MODULE;
858 ptr->read_proc = sram_proc_read; 857 ptr->read_proc = sram_proc_read;
859 return 0; 858 return 0;
860} 859}
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index e5c57f413ca2..a4f19c70aadd 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -1002,8 +1002,6 @@ create_palinfo_proc_entries(unsigned int cpu)
1002 *pdir = create_proc_read_entry( 1002 *pdir = create_proc_read_entry(
1003 palinfo_entries[j].name, 0, cpu_dir, 1003 palinfo_entries[j].name, 0, cpu_dir,
1004 palinfo_read_entry, (void *)f.value); 1004 palinfo_read_entry, (void *)f.value);
1005 if (*pdir)
1006 (*pdir)->owner = THIS_MODULE;
1007 pdir++; 1005 pdir++;
1008 } 1006 }
1009} 1007}
diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
index 4dcce3d0e04c..e63328818643 100644
--- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c
+++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
@@ -225,7 +225,6 @@ static struct proc_dir_entry *sgi_prominfo_entry;
225int __init prominfo_init(void) 225int __init prominfo_init(void)
226{ 226{
227 struct proc_dir_entry **entp; 227 struct proc_dir_entry **entp;
228 struct proc_dir_entry *p;
229 cnodeid_t cnodeid; 228 cnodeid_t cnodeid;
230 unsigned long nasid; 229 unsigned long nasid;
231 int size; 230 int size;
@@ -246,14 +245,10 @@ int __init prominfo_init(void)
246 sprintf(name, "node%d", cnodeid); 245 sprintf(name, "node%d", cnodeid);
247 *entp = proc_mkdir(name, sgi_prominfo_entry); 246 *entp = proc_mkdir(name, sgi_prominfo_entry);
248 nasid = cnodeid_to_nasid(cnodeid); 247 nasid = cnodeid_to_nasid(cnodeid);
249 p = create_proc_read_entry("fit", 0, *entp, read_fit_entry, 248 create_proc_read_entry("fit", 0, *entp, read_fit_entry,
250 (void *)nasid); 249 (void *)nasid);
251 if (p) 250 create_proc_read_entry("version", 0, *entp,
252 p->owner = THIS_MODULE;
253 p = create_proc_read_entry("version", 0, *entp,
254 read_version_entry, (void *)nasid); 251 read_version_entry, (void *)nasid);
255 if (p)
256 p->owner = THIS_MODULE;
257 entp++; 252 entp++;
258 } 253 }
259 254
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 149cb112cd1a..13011a96a977 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -669,7 +669,6 @@ static void remove_flash_pde(struct proc_dir_entry *dp)
669{ 669{
670 if (dp) { 670 if (dp) {
671 kfree(dp->data); 671 kfree(dp->data);
672 dp->owner = NULL;
673 remove_proc_entry(dp->name, dp->parent); 672 remove_proc_entry(dp->name, dp->parent);
674 } 673 }
675} 674}
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c
index adaaed4ea2fb..00d034ea2164 100644
--- a/arch/sparc/kernel/led.c
+++ b/arch/sparc/kernel/led.c
@@ -126,7 +126,6 @@ static int __init led_init(void)
126 led = proc_create("led", 0, NULL, &led_proc_fops); 126 led = proc_create("led", 0, NULL, &led_proc_fops);
127 if (!led) 127 if (!led)
128 return -ENOMEM; 128 return -ENOMEM;
129 led->owner = THIS_MODULE;
130 129
131 printk(KERN_INFO 130 printk(KERN_INFO
132 "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n", 131 "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n",
diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
index 4c4214690dd1..fb73a52913a4 100644
--- a/arch/x86/kernel/cpu/mtrr/if.c
+++ b/arch/x86/kernel/cpu/mtrr/if.c
@@ -377,10 +377,6 @@ static const struct file_operations mtrr_fops = {
377 .release = mtrr_close, 377 .release = mtrr_close,
378}; 378};
379 379
380
381static struct proc_dir_entry *proc_root_mtrr;
382
383
384static int mtrr_seq_show(struct seq_file *seq, void *offset) 380static int mtrr_seq_show(struct seq_file *seq, void *offset)
385{ 381{
386 char factor; 382 char factor;
@@ -423,11 +419,7 @@ static int __init mtrr_if_init(void)
423 (!cpu_has(c, X86_FEATURE_CENTAUR_MCR))) 419 (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
424 return -ENODEV; 420 return -ENODEV;
425 421
426 proc_root_mtrr = 422 proc_create("mtrr", S_IWUSR | S_IRUGO, NULL, &mtrr_fops);
427 proc_create("mtrr", S_IWUSR | S_IRUGO, NULL, &mtrr_fops);
428
429 if (proc_root_mtrr)
430 proc_root_mtrr->owner = THIS_MODULE;
431 return 0; 423 return 0;
432} 424}
433 425
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 9b917dac7732..88e42abf5d88 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -191,7 +191,6 @@ static int acpi_ac_add_fs(struct acpi_device *device)
191 acpi_ac_dir); 191 acpi_ac_dir);
192 if (!acpi_device_dir(device)) 192 if (!acpi_device_dir(device))
193 return -ENODEV; 193 return -ENODEV;
194 acpi_device_dir(device)->owner = THIS_MODULE;
195 } 194 }
196 195
197 /* 'state' [R] */ 196 /* 'state' [R] */
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 69cbc57c2d1c..3bcb5bfc45d3 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -760,7 +760,6 @@ static int acpi_battery_add_fs(struct acpi_device *device)
760 acpi_battery_dir); 760 acpi_battery_dir);
761 if (!acpi_device_dir(device)) 761 if (!acpi_device_dir(device))
762 return -ENODEV; 762 return -ENODEV;
763 acpi_device_dir(device)->owner = THIS_MODULE;
764 } 763 }
765 764
766 for (i = 0; i < ACPI_BATTERY_NUMFILES; ++i) { 765 for (i = 0; i < ACPI_BATTERY_NUMFILES; ++i) {
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 171fd914f435..c2f06069dcd4 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -200,12 +200,10 @@ static int acpi_button_add_fs(struct acpi_device *device)
200 200
201 if (!entry) 201 if (!entry)
202 return -ENODEV; 202 return -ENODEV;
203 entry->owner = THIS_MODULE;
204 203
205 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry); 204 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
206 if (!acpi_device_dir(device)) 205 if (!acpi_device_dir(device))
207 return -ENODEV; 206 return -ENODEV;
208 acpi_device_dir(device)->owner = THIS_MODULE;
209 207
210 /* 'info' [R] */ 208 /* 'info' [R] */
211 entry = proc_create_data(ACPI_BUTTON_FILE_INFO, 209 entry = proc_create_data(ACPI_BUTTON_FILE_INFO,
@@ -522,7 +520,6 @@ static int __init acpi_button_init(void)
522 acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); 520 acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
523 if (!acpi_button_dir) 521 if (!acpi_button_dir)
524 return -ENODEV; 522 return -ENODEV;
525 acpi_button_dir->owner = THIS_MODULE;
526 result = acpi_bus_register_driver(&acpi_button_driver); 523 result = acpi_bus_register_driver(&acpi_button_driver);
527 if (result < 0) { 524 if (result < 0) {
528 remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); 525 remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index eaaee1660bdf..8a02944bf92d 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -193,7 +193,6 @@ static int acpi_fan_add_fs(struct acpi_device *device)
193 acpi_fan_dir); 193 acpi_fan_dir);
194 if (!acpi_device_dir(device)) 194 if (!acpi_device_dir(device))
195 return -ENODEV; 195 return -ENODEV;
196 acpi_device_dir(device)->owner = THIS_MODULE;
197 } 196 }
198 197
199 /* 'status' [R/W] */ 198 /* 'status' [R/W] */
@@ -347,7 +346,6 @@ static int __init acpi_fan_init(void)
347 acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir); 346 acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
348 if (!acpi_fan_dir) 347 if (!acpi_fan_dir)
349 return -ENODEV; 348 return -ENODEV;
350 acpi_fan_dir->owner = THIS_MODULE;
351#endif 349#endif
352 350
353 result = acpi_bus_register_driver(&acpi_fan_driver); 351 result = acpi_bus_register_driver(&acpi_fan_driver);
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 0cc2fd31e376..fa2f7422d23d 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -359,7 +359,6 @@ static int acpi_processor_add_fs(struct acpi_device *device)
359 if (!acpi_device_dir(device)) 359 if (!acpi_device_dir(device))
360 return -ENODEV; 360 return -ENODEV;
361 } 361 }
362 acpi_device_dir(device)->owner = THIS_MODULE;
363 362
364 /* 'info' [R] */ 363 /* 'info' [R] */
365 entry = proc_create_data(ACPI_PROCESSOR_FILE_INFO, 364 entry = proc_create_data(ACPI_PROCESSOR_FILE_INFO,
@@ -1137,7 +1136,6 @@ static int __init acpi_processor_init(void)
1137 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); 1136 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
1138 if (!acpi_processor_dir) 1137 if (!acpi_processor_dir)
1139 return -ENOMEM; 1138 return -ENOMEM;
1140 acpi_processor_dir->owner = THIS_MODULE;
1141 1139
1142 /* 1140 /*
1143 * Check whether the system is DMI table. If yes, OSPM 1141 * Check whether the system is DMI table. If yes, OSPM
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 6050ce481873..59afd52ccc12 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -488,7 +488,6 @@ acpi_sbs_add_fs(struct proc_dir_entry **dir,
488 if (!*dir) { 488 if (!*dir) {
489 return -ENODEV; 489 return -ENODEV;
490 } 490 }
491 (*dir)->owner = THIS_MODULE;
492 } 491 }
493 492
494 /* 'info' [R] */ 493 /* 'info' [R] */
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 99e6f1f8ea45..c11f9aeca706 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1506,7 +1506,6 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1506 acpi_thermal_dir); 1506 acpi_thermal_dir);
1507 if (!acpi_device_dir(device)) 1507 if (!acpi_device_dir(device))
1508 return -ENODEV; 1508 return -ENODEV;
1509 acpi_device_dir(device)->owner = THIS_MODULE;
1510 } 1509 }
1511 1510
1512 /* 'state' [R] */ 1511 /* 'state' [R] */
@@ -1875,7 +1874,6 @@ static int __init acpi_thermal_init(void)
1875 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); 1874 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);
1876 if (!acpi_thermal_dir) 1875 if (!acpi_thermal_dir)
1877 return -ENODEV; 1876 return -ENODEV;
1878 acpi_thermal_dir->owner = THIS_MODULE;
1879 1877
1880 result = acpi_bus_register_driver(&acpi_thermal_driver); 1878 result = acpi_bus_register_driver(&acpi_thermal_driver);
1881 if (result < 0) { 1879 if (result < 0) {
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index bb5ed059114a..67cc36dc9b82 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1125,8 +1125,6 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
1125 if (!device_dir) 1125 if (!device_dir)
1126 return -ENOMEM; 1126 return -ENOMEM;
1127 1127
1128 device_dir->owner = THIS_MODULE;
1129
1130 /* 'info' [R] */ 1128 /* 'info' [R] */
1131 entry = proc_create_data("info", S_IRUGO, device_dir, 1129 entry = proc_create_data("info", S_IRUGO, device_dir,
1132 &acpi_video_device_info_fops, acpi_driver_data(device)); 1130 &acpi_video_device_info_fops, acpi_driver_data(device));
@@ -1403,8 +1401,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1403 if (!device_dir) 1401 if (!device_dir)
1404 return -ENOMEM; 1402 return -ENOMEM;
1405 1403
1406 device_dir->owner = THIS_MODULE;
1407
1408 /* 'info' [R] */ 1404 /* 'info' [R] */
1409 entry = proc_create_data("info", S_IRUGO, device_dir, 1405 entry = proc_create_data("info", S_IRUGO, device_dir,
1410 &acpi_video_bus_info_fops, 1406 &acpi_video_bus_info_fops,
@@ -2131,7 +2127,6 @@ static int __init acpi_video_init(void)
2131 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); 2127 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir);
2132 if (!acpi_video_dir) 2128 if (!acpi_video_dir)
2133 return -ENODEV; 2129 return -ENODEV;
2134 acpi_video_dir->owner = THIS_MODULE;
2135 2130
2136 result = acpi_bus_register_driver(&acpi_video_bus); 2131 result = acpi_bus_register_driver(&acpi_video_bus);
2137 if (result < 0) { 2132 if (result < 0) {
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 393ed6760d78..8eddef373a91 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -551,8 +551,6 @@ static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev)
551 dev_warn(&dev->core, "failed to create /proc entry\n"); 551 dev_warn(&dev->core, "failed to create /proc entry\n");
552 return; 552 return;
553 } 553 }
554
555 pde->owner = THIS_MODULE;
556 pde->data = priv; 554 pde->data = priv;
557} 555}
558 556
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 7a88dfd4427b..e93fc8d22fb2 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -1944,7 +1944,7 @@ static int stat_file_read_proc(char *page, char **start, off_t off,
1944 1944
1945int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, 1945int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
1946 read_proc_t *read_proc, 1946 read_proc_t *read_proc,
1947 void *data, struct module *owner) 1947 void *data)
1948{ 1948{
1949 int rv = 0; 1949 int rv = 0;
1950#ifdef CONFIG_PROC_FS 1950#ifdef CONFIG_PROC_FS
@@ -1970,7 +1970,6 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
1970 } else { 1970 } else {
1971 file->data = data; 1971 file->data = data;
1972 file->read_proc = read_proc; 1972 file->read_proc = read_proc;
1973 file->owner = owner;
1974 1973
1975 mutex_lock(&smi->proc_entry_lock); 1974 mutex_lock(&smi->proc_entry_lock);
1976 /* Stick it on the list. */ 1975 /* Stick it on the list. */
@@ -1993,23 +1992,21 @@ static int add_proc_entries(ipmi_smi_t smi, int num)
1993 smi->proc_dir = proc_mkdir(smi->proc_dir_name, proc_ipmi_root); 1992 smi->proc_dir = proc_mkdir(smi->proc_dir_name, proc_ipmi_root);
1994 if (!smi->proc_dir) 1993 if (!smi->proc_dir)
1995 rv = -ENOMEM; 1994 rv = -ENOMEM;
1996 else
1997 smi->proc_dir->owner = THIS_MODULE;
1998 1995
1999 if (rv == 0) 1996 if (rv == 0)
2000 rv = ipmi_smi_add_proc_entry(smi, "stats", 1997 rv = ipmi_smi_add_proc_entry(smi, "stats",
2001 stat_file_read_proc, 1998 stat_file_read_proc,
2002 smi, THIS_MODULE); 1999 smi);
2003 2000
2004 if (rv == 0) 2001 if (rv == 0)
2005 rv = ipmi_smi_add_proc_entry(smi, "ipmb", 2002 rv = ipmi_smi_add_proc_entry(smi, "ipmb",
2006 ipmb_file_read_proc, 2003 ipmb_file_read_proc,
2007 smi, THIS_MODULE); 2004 smi);
2008 2005
2009 if (rv == 0) 2006 if (rv == 0)
2010 rv = ipmi_smi_add_proc_entry(smi, "version", 2007 rv = ipmi_smi_add_proc_entry(smi, "version",
2011 version_file_read_proc, 2008 version_file_read_proc,
2012 smi, THIS_MODULE); 2009 smi);
2013#endif /* CONFIG_PROC_FS */ 2010#endif /* CONFIG_PROC_FS */
2014 2011
2015 return rv; 2012 return rv;
@@ -4265,7 +4262,6 @@ static int ipmi_init_msghandler(void)
4265 return -ENOMEM; 4262 return -ENOMEM;
4266 } 4263 }
4267 4264
4268 proc_ipmi_root->owner = THIS_MODULE;
4269#endif /* CONFIG_PROC_FS */ 4265#endif /* CONFIG_PROC_FS */
4270 4266
4271 setup_timer(&ipmi_timer, ipmi_timeout, 0); 4267 setup_timer(&ipmi_timer, ipmi_timeout, 0);
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 3000135f2ead..e58ea4cd55ce 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2899,7 +2899,7 @@ static int try_smi_init(struct smi_info *new_smi)
2899 2899
2900 rv = ipmi_smi_add_proc_entry(new_smi->intf, "type", 2900 rv = ipmi_smi_add_proc_entry(new_smi->intf, "type",
2901 type_file_read_proc, 2901 type_file_read_proc,
2902 new_smi, THIS_MODULE); 2902 new_smi);
2903 if (rv) { 2903 if (rv) {
2904 printk(KERN_ERR 2904 printk(KERN_ERR
2905 "ipmi_si: Unable to create proc entry: %d\n", 2905 "ipmi_si: Unable to create proc entry: %d\n",
@@ -2909,7 +2909,7 @@ static int try_smi_init(struct smi_info *new_smi)
2909 2909
2910 rv = ipmi_smi_add_proc_entry(new_smi->intf, "si_stats", 2910 rv = ipmi_smi_add_proc_entry(new_smi->intf, "si_stats",
2911 stat_file_read_proc, 2911 stat_file_read_proc,
2912 new_smi, THIS_MODULE); 2912 new_smi);
2913 if (rv) { 2913 if (rv) {
2914 printk(KERN_ERR 2914 printk(KERN_ERR
2915 "ipmi_si: Unable to create proc entry: %d\n", 2915 "ipmi_si: Unable to create proc entry: %d\n",
@@ -2919,7 +2919,7 @@ static int try_smi_init(struct smi_info *new_smi)
2919 2919
2920 rv = ipmi_smi_add_proc_entry(new_smi->intf, "params", 2920 rv = ipmi_smi_add_proc_entry(new_smi->intf, "params",
2921 param_read_proc, 2921 param_read_proc,
2922 new_smi, THIS_MODULE); 2922 new_smi);
2923 if (rv) { 2923 if (rv) {
2924 printk(KERN_ERR 2924 printk(KERN_ERR
2925 "ipmi_si: Unable to create proc entry: %d\n", 2925 "ipmi_si: Unable to create proc entry: %d\n",
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 1730d7331a5d..ec3db3ade118 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -903,8 +903,6 @@ static int __init input_proc_init(void)
903 if (!proc_bus_input_dir) 903 if (!proc_bus_input_dir)
904 return -ENOMEM; 904 return -ENOMEM;
905 905
906 proc_bus_input_dir->owner = THIS_MODULE;
907
908 entry = proc_create("devices", 0, proc_bus_input_dir, 906 entry = proc_create("devices", 0, proc_bus_input_dir,
909 &input_devices_fileops); 907 &input_devices_fileops);
910 if (!entry) 908 if (!entry)
diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
index f4969fe0a055..69e71ebe7841 100644
--- a/drivers/isdn/hardware/eicon/divasi.c
+++ b/drivers/isdn/hardware/eicon/divasi.c
@@ -118,7 +118,6 @@ static int DIVA_INIT_FUNCTION create_um_idi_proc(void)
118 return (0); 118 return (0);
119 119
120 um_idi_proc_entry->read_proc = um_idi_proc_read; 120 um_idi_proc_entry->read_proc = um_idi_proc_read;
121 um_idi_proc_entry->owner = THIS_MODULE;
122 121
123 return (1); 122 return (1);
124} 123}
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index c3b0c8c63c76..43ab0adf3b61 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -1381,9 +1381,7 @@ static void proc_cpia_create(void)
1381{ 1381{
1382 cpia_proc_root = proc_mkdir("cpia", NULL); 1382 cpia_proc_root = proc_mkdir("cpia", NULL);
1383 1383
1384 if (cpia_proc_root) 1384 if (!cpia_proc_root)
1385 cpia_proc_root->owner = THIS_MODULE;
1386 else
1387 LOG("Unable to initialise /proc/cpia\n"); 1385 LOG("Unable to initialise /proc/cpia\n");
1388} 1386}
1389 1387
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 9a36b5a7de57..7045c45da9b1 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -2037,8 +2037,6 @@ static int __init i2o_proc_fs_create(void)
2037 if (!i2o_proc_dir_root) 2037 if (!i2o_proc_dir_root)
2038 return -1; 2038 return -1;
2039 2039
2040 i2o_proc_dir_root->owner = THIS_MODULE;
2041
2042 list_for_each_entry(c, &i2o_controllers, list) 2040 list_for_each_entry(c, &i2o_controllers, list)
2043 i2o_proc_iop_add(i2o_proc_dir_root, c); 2041 i2o_proc_iop_add(i2o_proc_dir_root, c);
2044 2042
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 9c326a50a3ee..99610f358c40 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3444,25 +3444,12 @@ static void bond_remove_proc_entry(struct bonding *bond)
3444 */ 3444 */
3445static void bond_create_proc_dir(void) 3445static void bond_create_proc_dir(void)
3446{ 3446{
3447 int len = strlen(DRV_NAME);
3448
3449 for (bond_proc_dir = init_net.proc_net->subdir; bond_proc_dir;
3450 bond_proc_dir = bond_proc_dir->next) {
3451 if ((bond_proc_dir->namelen == len) &&
3452 !memcmp(bond_proc_dir->name, DRV_NAME, len)) {
3453 break;
3454 }
3455 }
3456
3457 if (!bond_proc_dir) { 3447 if (!bond_proc_dir) {
3458 bond_proc_dir = proc_mkdir(DRV_NAME, init_net.proc_net); 3448 bond_proc_dir = proc_mkdir(DRV_NAME, init_net.proc_net);
3459 if (bond_proc_dir) { 3449 if (!bond_proc_dir)
3460 bond_proc_dir->owner = THIS_MODULE;
3461 } else {
3462 printk(KERN_WARNING DRV_NAME 3450 printk(KERN_WARNING DRV_NAME
3463 ": Warning: cannot create /proc/net/%s\n", 3451 ": Warning: cannot create /proc/net/%s\n",
3464 DRV_NAME); 3452 DRV_NAME);
3465 }
3466 } 3453 }
3467} 3454}
3468 3455
@@ -3471,25 +3458,7 @@ static void bond_create_proc_dir(void)
3471 */ 3458 */
3472static void bond_destroy_proc_dir(void) 3459static void bond_destroy_proc_dir(void)
3473{ 3460{
3474 struct proc_dir_entry *de; 3461 if (bond_proc_dir) {
3475
3476 if (!bond_proc_dir) {
3477 return;
3478 }
3479
3480 /* verify that the /proc dir is empty */
3481 for (de = bond_proc_dir->subdir; de; de = de->next) {
3482 /* ignore . and .. */
3483 if (*(de->name) != '.') {
3484 break;
3485 }
3486 }
3487
3488 if (de) {
3489 if (bond_proc_dir->owner == THIS_MODULE) {
3490 bond_proc_dir->owner = NULL;
3491 }
3492 } else {
3493 remove_proc_entry(DRV_NAME, init_net.proc_net); 3462 remove_proc_entry(DRV_NAME, init_net.proc_net);
3494 bond_proc_dir = NULL; 3463 bond_proc_dir = NULL;
3495 } 3464 }
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 1243bc8e0035..ac0e4b6b6b66 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -1871,13 +1871,6 @@ static int __init vlsi_mod_init(void)
1871 * without procfs - it's not required for the driver to work. 1871 * without procfs - it's not required for the driver to work.
1872 */ 1872 */
1873 vlsi_proc_root = proc_mkdir(PROC_DIR, NULL); 1873 vlsi_proc_root = proc_mkdir(PROC_DIR, NULL);
1874 if (vlsi_proc_root) {
1875 /* protect registered procdir against module removal.
1876 * Because we are in the module init path there's no race
1877 * window after create_proc_entry (and no barrier needed).
1878 */
1879 vlsi_proc_root->owner = THIS_MODULE;
1880 }
1881 1874
1882 ret = pci_register_driver(&vlsi_irda_driver); 1875 ret = pci_register_driver(&vlsi_irda_driver);
1883 1876
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 7e80aba8a148..31b1cc2b778a 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4494,7 +4494,6 @@ static int setup_proc_entry( struct net_device *dev,
4494 goto fail; 4494 goto fail;
4495 apriv->proc_entry->uid = proc_uid; 4495 apriv->proc_entry->uid = proc_uid;
4496 apriv->proc_entry->gid = proc_gid; 4496 apriv->proc_entry->gid = proc_gid;
4497 apriv->proc_entry->owner = THIS_MODULE;
4498 4497
4499 /* Setup the StatsDelta */ 4498 /* Setup the StatsDelta */
4500 entry = proc_create_data("StatsDelta", 4499 entry = proc_create_data("StatsDelta",
diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
index d63f26e666a4..ba1f7497e4b9 100644
--- a/drivers/platform/x86/asus_acpi.c
+++ b/drivers/platform/x86/asus_acpi.c
@@ -987,7 +987,6 @@ asus_proc_add(char *name, proc_writefunc *writefunc,
987 proc->write_proc = writefunc; 987 proc->write_proc = writefunc;
988 proc->read_proc = readfunc; 988 proc->read_proc = readfunc;
989 proc->data = acpi_driver_data(device); 989 proc->data = acpi_driver_data(device);
990 proc->owner = THIS_MODULE;
991 proc->uid = asus_uid; 990 proc->uid = asus_uid;
992 proc->gid = asus_gid; 991 proc->gid = asus_gid;
993 return 0; 992 return 0;
@@ -1020,7 +1019,6 @@ static int asus_hotk_add_fs(struct acpi_device *device)
1020 if (proc) { 1019 if (proc) {
1021 proc->read_proc = proc_read_info; 1020 proc->read_proc = proc_read_info;
1022 proc->data = acpi_driver_data(device); 1021 proc->data = acpi_driver_data(device);
1023 proc->owner = THIS_MODULE;
1024 proc->uid = asus_uid; 1022 proc->uid = asus_uid;
1025 proc->gid = asus_gid; 1023 proc->gid = asus_gid;
1026 } else { 1024 } else {
@@ -1436,7 +1434,6 @@ static int __init asus_acpi_init(void)
1436 printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n"); 1434 printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
1437 return -ENODEV; 1435 return -ENODEV;
1438 } 1436 }
1439 asus_proc_dir->owner = THIS_MODULE;
1440 1437
1441 result = acpi_bus_register_driver(&asus_hotk_driver); 1438 result = acpi_bus_register_driver(&asus_hotk_driver);
1442 if (result < 0) { 1439 if (result < 0) {
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index d2433204a40c..3dad27a385d3 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6992,7 +6992,6 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
6992 ret = -ENODEV; 6992 ret = -ENODEV;
6993 goto err_out; 6993 goto err_out;
6994 } 6994 }
6995 entry->owner = THIS_MODULE;
6996 entry->data = ibm; 6995 entry->data = ibm;
6997 entry->read_proc = &dispatch_procfs_read; 6996 entry->read_proc = &dispatch_procfs_read;
6998 if (ibm->write) 6997 if (ibm->write)
@@ -7405,7 +7404,6 @@ static int __init thinkpad_acpi_module_init(void)
7405 thinkpad_acpi_module_exit(); 7404 thinkpad_acpi_module_exit();
7406 return -ENODEV; 7405 return -ENODEV;
7407 } 7406 }
7408 proc_dir->owner = THIS_MODULE;
7409 7407
7410 ret = platform_driver_register(&tpacpi_pdriver); 7408 ret = platform_driver_register(&tpacpi_pdriver);
7411 if (ret) { 7409 if (ret) {
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 40e60fc2e596..9f187265db8e 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -679,8 +679,6 @@ static acpi_status __init add_device(void)
679 toshiba_proc_dir, 679 toshiba_proc_dir,
680 (read_proc_t *) dispatch_read, 680 (read_proc_t *) dispatch_read,
681 item); 681 item);
682 if (proc)
683 proc->owner = THIS_MODULE;
684 if (proc && item->write_func) 682 if (proc && item->write_func)
685 proc->write_proc = (write_proc_t *) dispatch_write; 683 proc->write_proc = (write_proc_t *) dispatch_write;
686 } 684 }
@@ -772,7 +770,6 @@ static int __init toshiba_acpi_init(void)
772 toshiba_acpi_exit(); 770 toshiba_acpi_exit();
773 return -ENODEV; 771 return -ENODEV;
774 } else { 772 } else {
775 toshiba_proc_dir->owner = THIS_MODULE;
776 status = add_device(); 773 status = add_device();
777 if (ACPI_FAILURE(status)) { 774 if (ACPI_FAILURE(status)) {
778 toshiba_acpi_exit(); 775 toshiba_acpi_exit();
diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
index 0c6257a034ff..c086fc30a84c 100644
--- a/drivers/rtc/rtc-proc.c
+++ b/drivers/rtc/rtc-proc.c
@@ -105,14 +105,8 @@ static const struct file_operations rtc_proc_fops = {
105 105
106void rtc_proc_add_device(struct rtc_device *rtc) 106void rtc_proc_add_device(struct rtc_device *rtc)
107{ 107{
108 if (rtc->id == 0) { 108 if (rtc->id == 0)
109 struct proc_dir_entry *ent; 109 proc_create_data("driver/rtc", 0, NULL, &rtc_proc_fops, rtc);
110
111 ent = proc_create_data("driver/rtc", 0, NULL,
112 &rtc_proc_fops, rtc);
113 if (ent)
114 ent->owner = rtc->owner;
115 }
116} 110}
117 111
118void rtc_proc_del_device(struct rtc_device *rtc) 112void rtc_proc_del_device(struct rtc_device *rtc)
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 2080ba6a69b0..654daa3cdfda 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -320,7 +320,6 @@ dasd_proc_init(void)
320 dasd_proc_root_entry = proc_mkdir("dasd", NULL); 320 dasd_proc_root_entry = proc_mkdir("dasd", NULL);
321 if (!dasd_proc_root_entry) 321 if (!dasd_proc_root_entry)
322 goto out_nodasd; 322 goto out_nodasd;
323 dasd_proc_root_entry->owner = THIS_MODULE;
324 dasd_devices_entry = proc_create("devices", 323 dasd_devices_entry = proc_create("devices",
325 S_IFREG | S_IRUGO | S_IWUSR, 324 S_IFREG | S_IRUGO | S_IWUSR,
326 dasd_proc_root_entry, 325 dasd_proc_root_entry,
@@ -334,7 +333,6 @@ dasd_proc_init(void)
334 goto out_nostatistics; 333 goto out_nostatistics;
335 dasd_statistics_entry->read_proc = dasd_statistics_read; 334 dasd_statistics_entry->read_proc = dasd_statistics_read;
336 dasd_statistics_entry->write_proc = dasd_statistics_write; 335 dasd_statistics_entry->write_proc = dasd_statistics_write;
337 dasd_statistics_entry->owner = THIS_MODULE;
338 return 0; 336 return 0;
339 337
340 out_nostatistics: 338 out_nostatistics:
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 099b5455bbce..b13481369642 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -596,8 +596,6 @@ int __init scsi_init_devinfo(void)
596 error = -ENOMEM; 596 error = -ENOMEM;
597 goto out; 597 goto out;
598 } 598 }
599
600 p->owner = THIS_MODULE;
601#endif /* CONFIG_SCSI_PROC_FS */ 599#endif /* CONFIG_SCSI_PROC_FS */
602 600
603 out: 601 out:
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 82f7b2dd08a2..77fbddb507fd 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -115,8 +115,6 @@ void scsi_proc_hostdir_add(struct scsi_host_template *sht)
115 if (!sht->proc_dir) 115 if (!sht->proc_dir)
116 printk(KERN_ERR "%s: proc_mkdir failed for %s\n", 116 printk(KERN_ERR "%s: proc_mkdir failed for %s\n",
117 __func__, sht->proc_name); 117 __func__, sht->proc_name);
118 else
119 sht->proc_dir->owner = sht->module;
120 } 118 }
121 mutex_unlock(&global_host_template_mutex); 119 mutex_unlock(&global_host_template_mutex);
122} 120}
@@ -163,7 +161,6 @@ void scsi_proc_host_add(struct Scsi_Host *shost)
163 } 161 }
164 162
165 p->write_proc = proc_scsi_write_proc; 163 p->write_proc = proc_scsi_write_proc;
166 p->owner = sht->module;
167} 164}
168 165
169/** 166/**
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 37b433a08ce8..e327b84820d2 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -2059,25 +2059,21 @@ static void viafb_init_proc(struct proc_dir_entry **viafb_entry)
2059 if (viafb_entry) { 2059 if (viafb_entry) {
2060 entry = create_proc_entry("dvp0", 0, *viafb_entry); 2060 entry = create_proc_entry("dvp0", 0, *viafb_entry);
2061 if (entry) { 2061 if (entry) {
2062 entry->owner = THIS_MODULE;
2063 entry->read_proc = viafb_dvp0_proc_read; 2062 entry->read_proc = viafb_dvp0_proc_read;
2064 entry->write_proc = viafb_dvp0_proc_write; 2063 entry->write_proc = viafb_dvp0_proc_write;
2065 } 2064 }
2066 entry = create_proc_entry("dvp1", 0, *viafb_entry); 2065 entry = create_proc_entry("dvp1", 0, *viafb_entry);
2067 if (entry) { 2066 if (entry) {
2068 entry->owner = THIS_MODULE;
2069 entry->read_proc = viafb_dvp1_proc_read; 2067 entry->read_proc = viafb_dvp1_proc_read;
2070 entry->write_proc = viafb_dvp1_proc_write; 2068 entry->write_proc = viafb_dvp1_proc_write;
2071 } 2069 }
2072 entry = create_proc_entry("dfph", 0, *viafb_entry); 2070 entry = create_proc_entry("dfph", 0, *viafb_entry);
2073 if (entry) { 2071 if (entry) {
2074 entry->owner = THIS_MODULE;
2075 entry->read_proc = viafb_dfph_proc_read; 2072 entry->read_proc = viafb_dfph_proc_read;
2076 entry->write_proc = viafb_dfph_proc_write; 2073 entry->write_proc = viafb_dfph_proc_write;
2077 } 2074 }
2078 entry = create_proc_entry("dfpl", 0, *viafb_entry); 2075 entry = create_proc_entry("dfpl", 0, *viafb_entry);
2079 if (entry) { 2076 if (entry) {
2080 entry->owner = THIS_MODULE;
2081 entry->read_proc = viafb_dfpl_proc_read; 2077 entry->read_proc = viafb_dfpl_proc_read;
2082 entry->write_proc = viafb_dfpl_proc_write; 2078 entry->write_proc = viafb_dfpl_proc_write;
2083 } 2079 }
@@ -2086,7 +2082,6 @@ static void viafb_init_proc(struct proc_dir_entry **viafb_entry)
2086 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) { 2082 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) {
2087 entry = create_proc_entry("vt1636", 0, *viafb_entry); 2083 entry = create_proc_entry("vt1636", 0, *viafb_entry);
2088 if (entry) { 2084 if (entry) {
2089 entry->owner = THIS_MODULE;
2090 entry->read_proc = viafb_vt1636_proc_read; 2085 entry->read_proc = viafb_vt1636_proc_read;
2091 entry->write_proc = viafb_vt1636_proc_write; 2086 entry->write_proc = viafb_vt1636_proc_write;
2092 } 2087 }
diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 7578c1ab9e0b..8630615e57fe 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -146,7 +146,6 @@ int afs_proc_init(void)
146 proc_afs = proc_mkdir("fs/afs", NULL); 146 proc_afs = proc_mkdir("fs/afs", NULL);
147 if (!proc_afs) 147 if (!proc_afs)
148 goto error_dir; 148 goto error_dir;
149 proc_afs->owner = THIS_MODULE;
150 149
151 p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops); 150 p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops);
152 if (!p) 151 if (!p)
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 877e4d9a1159..7f19fefd3d45 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -404,7 +404,6 @@ cifs_proc_init(void)
404 if (proc_fs_cifs == NULL) 404 if (proc_fs_cifs == NULL)
405 return; 405 return;
406 406
407 proc_fs_cifs->owner = THIS_MODULE;
408 proc_create("DebugData", 0, proc_fs_cifs, &cifs_debug_data_proc_fops); 407 proc_create("DebugData", 0, proc_fs_cifs, &cifs_debug_data_proc_fops);
409 408
410#ifdef CONFIG_CIFS_STATS 409#ifdef CONFIG_CIFS_STATS
diff --git a/fs/jfs/jfs_debug.c b/fs/jfs/jfs_debug.c
index 6a73de84bcef..dd824d9b0b1a 100644
--- a/fs/jfs/jfs_debug.c
+++ b/fs/jfs/jfs_debug.c
@@ -90,7 +90,6 @@ void jfs_proc_init(void)
90 90
91 if (!(base = proc_mkdir("fs/jfs", NULL))) 91 if (!(base = proc_mkdir("fs/jfs", NULL)))
92 return; 92 return;
93 base->owner = THIS_MODULE;
94 93
95 for (i = 0; i < NPROCENT; i++) 94 for (i = 0; i < NPROCENT; i++)
96 proc_create(Entries[i].name, 0, base, Entries[i].proc_fops); 95 proc_create(Entries[i].name, 0, base, Entries[i].proc_fops);
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 574158ae2398..2277421656e7 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1606,8 +1606,6 @@ int __init nfs_fs_proc_init(void)
1606 if (!proc_fs_nfs) 1606 if (!proc_fs_nfs)
1607 goto error_0; 1607 goto error_0;
1608 1608
1609 proc_fs_nfs->owner = THIS_MODULE;
1610
1611 /* a file of servers with which we're dealing */ 1609 /* a file of servers with which we're dealing */
1612 p = proc_create("servers", S_IFREG|S_IRUGO, 1610 p = proc_create("servers", S_IFREG|S_IRUGO,
1613 proc_fs_nfs, &nfs_server_list_fops); 1611 proc_fs_nfs, &nfs_server_list_fops);
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 5d2989e9dcc1..fa678abc9db1 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -37,7 +37,7 @@ static int proc_match(int len, const char *name, struct proc_dir_entry *de)
37#define PROC_BLOCK_SIZE (PAGE_SIZE - 1024) 37#define PROC_BLOCK_SIZE (PAGE_SIZE - 1024)
38 38
39static ssize_t 39static ssize_t
40proc_file_read(struct file *file, char __user *buf, size_t nbytes, 40__proc_file_read(struct file *file, char __user *buf, size_t nbytes,
41 loff_t *ppos) 41 loff_t *ppos)
42{ 42{
43 struct inode * inode = file->f_path.dentry->d_inode; 43 struct inode * inode = file->f_path.dentry->d_inode;
@@ -183,19 +183,47 @@ proc_file_read(struct file *file, char __user *buf, size_t nbytes,
183} 183}
184 184
185static ssize_t 185static ssize_t
186proc_file_read(struct file *file, char __user *buf, size_t nbytes,
187 loff_t *ppos)
188{
189 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
190 ssize_t rv = -EIO;
191
192 spin_lock(&pde->pde_unload_lock);
193 if (!pde->proc_fops) {
194 spin_unlock(&pde->pde_unload_lock);
195 return rv;
196 }
197 pde->pde_users++;
198 spin_unlock(&pde->pde_unload_lock);
199
200 rv = __proc_file_read(file, buf, nbytes, ppos);
201
202 pde_users_dec(pde);
203 return rv;
204}
205
206static ssize_t
186proc_file_write(struct file *file, const char __user *buffer, 207proc_file_write(struct file *file, const char __user *buffer,
187 size_t count, loff_t *ppos) 208 size_t count, loff_t *ppos)
188{ 209{
189 struct inode *inode = file->f_path.dentry->d_inode; 210 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
190 struct proc_dir_entry * dp; 211 ssize_t rv = -EIO;
191 212
192 dp = PDE(inode); 213 if (pde->write_proc) {
193 214 spin_lock(&pde->pde_unload_lock);
194 if (!dp->write_proc) 215 if (!pde->proc_fops) {
195 return -EIO; 216 spin_unlock(&pde->pde_unload_lock);
217 return rv;
218 }
219 pde->pde_users++;
220 spin_unlock(&pde->pde_unload_lock);
196 221
197 /* FIXME: does this routine need ppos? probably... */ 222 /* FIXME: does this routine need ppos? probably... */
198 return dp->write_proc(file, buffer, count, dp->data); 223 rv = pde->write_proc(file, buffer, count, pde->data);
224 pde_users_dec(pde);
225 }
226 return rv;
199} 227}
200 228
201 229
@@ -307,6 +335,21 @@ static DEFINE_SPINLOCK(proc_inum_lock); /* protects the above */
307/* 335/*
308 * Return an inode number between PROC_DYNAMIC_FIRST and 336 * Return an inode number between PROC_DYNAMIC_FIRST and
309 * 0xffffffff, or zero on failure. 337 * 0xffffffff, or zero on failure.
338 *
339 * Current inode allocations in the proc-fs (hex-numbers):
340 *
341 * 00000000 reserved
342 * 00000001-00000fff static entries (goners)
343 * 001 root-ino
344 *
345 * 00001000-00001fff unused
346 * 0001xxxx-7fffxxxx pid-dir entries for pid 1-7fff
347 * 80000000-efffffff unused
348 * f0000000-ffffffff dynamic entries
349 *
350 * Goal:
351 * Once we split the thing into several virtual filesystems,
352 * we will get rid of magical ranges (and this comment, BTW).
310 */ 353 */
311static unsigned int get_inode_number(void) 354static unsigned int get_inode_number(void)
312{ 355{
diff --git a/fs/proc/inode-alloc.txt b/fs/proc/inode-alloc.txt
deleted file mode 100644
index 77212f938c2c..000000000000
--- a/fs/proc/inode-alloc.txt
+++ /dev/null
@@ -1,14 +0,0 @@
1Current inode allocations in the proc-fs (hex-numbers):
2
3 00000000 reserved
4 00000001-00000fff static entries (goners)
5 001 root-ino
6
7 00001000-00001fff unused
8 0001xxxx-7fffxxxx pid-dir entries for pid 1-7fff
9 80000000-efffffff unused
10 f0000000-ffffffff dynamic entries
11
12Goal:
13 a) once we'll split the thing into several virtual filesystems we
14 will get rid of magical ranges (and this file, BTW).
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index d8bb5c671f42..d78ade305541 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -58,11 +58,8 @@ static void proc_delete_inode(struct inode *inode)
58 58
59 /* Let go of any associated proc directory entry */ 59 /* Let go of any associated proc directory entry */
60 de = PROC_I(inode)->pde; 60 de = PROC_I(inode)->pde;
61 if (de) { 61 if (de)
62 if (de->owner)
63 module_put(de->owner);
64 de_put(de); 62 de_put(de);
65 }
66 if (PROC_I(inode)->sysctl) 63 if (PROC_I(inode)->sysctl)
67 sysctl_head_put(PROC_I(inode)->sysctl); 64 sysctl_head_put(PROC_I(inode)->sysctl);
68 clear_inode(inode); 65 clear_inode(inode);
@@ -127,7 +124,7 @@ static void __pde_users_dec(struct proc_dir_entry *pde)
127 complete(pde->pde_unload_completion); 124 complete(pde->pde_unload_completion);
128} 125}
129 126
130static void pde_users_dec(struct proc_dir_entry *pde) 127void pde_users_dec(struct proc_dir_entry *pde)
131{ 128{
132 spin_lock(&pde->pde_unload_lock); 129 spin_lock(&pde->pde_unload_lock);
133 __pde_users_dec(pde); 130 __pde_users_dec(pde);
@@ -449,12 +446,9 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
449{ 446{
450 struct inode * inode; 447 struct inode * inode;
451 448
452 if (!try_module_get(de->owner))
453 goto out_mod;
454
455 inode = iget_locked(sb, ino); 449 inode = iget_locked(sb, ino);
456 if (!inode) 450 if (!inode)
457 goto out_ino; 451 return NULL;
458 if (inode->i_state & I_NEW) { 452 if (inode->i_state & I_NEW) {
459 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 453 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
460 PROC_I(inode)->fd = 0; 454 PROC_I(inode)->fd = 0;
@@ -485,16 +479,9 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
485 } 479 }
486 } 480 }
487 unlock_new_inode(inode); 481 unlock_new_inode(inode);
488 } else { 482 } else
489 module_put(de->owner);
490 de_put(de); 483 de_put(de);
491 }
492 return inode; 484 return inode;
493
494out_ino:
495 module_put(de->owner);
496out_mod:
497 return NULL;
498} 485}
499 486
500int proc_fill_super(struct super_block *s) 487int proc_fill_super(struct super_block *s)
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index cd53ff838498..f6db9618a888 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -91,3 +91,4 @@ struct pde_opener {
91 int (*release)(struct inode *, struct file *); 91 int (*release)(struct inode *, struct file *);
92 struct list_head lh; 92 struct list_head lh;
93}; 93};
94void pde_users_dec(struct proc_dir_entry *pde);
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index d153946d6d15..4a9e0f65ae60 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -152,7 +152,6 @@ void proc_tty_register_driver(struct tty_driver *driver)
152 if (!ent) 152 if (!ent)
153 return; 153 return;
154 ent->read_proc = driver->ops->read_proc; 154 ent->read_proc = driver->ops->read_proc;
155 ent->owner = driver->owner;
156 ent->data = driver; 155 ent->data = driver;
157 156
158 driver->proc_entry = ent; 157 driver->proc_entry = ent;
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 94063840832a..b0ae0be4801f 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -693,8 +693,8 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
693 goto out_pages; 693 goto out_pages;
694 } 694 }
695 695
696 pm.out = (u64 *)buf; 696 pm.out = (u64 __user *)buf;
697 pm.end = (u64 *)(buf + count); 697 pm.end = (u64 __user *)(buf + count);
698 698
699 pagemap_walk.pmd_entry = pagemap_pte_range; 699 pagemap_walk.pmd_entry = pagemap_pte_range;
700 pagemap_walk.pte_hole = pagemap_pte_hole; 700 pagemap_walk.pte_hole = pagemap_pte_hole;
@@ -720,9 +720,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
720 if (ret == PM_END_OF_BUFFER) 720 if (ret == PM_END_OF_BUFFER)
721 ret = 0; 721 ret = 0;
722 /* don't need mmap_sem for these, but this looks cleaner */ 722 /* don't need mmap_sem for these, but this looks cleaner */
723 *ppos += (char *)pm.out - buf; 723 *ppos += (char __user *)pm.out - buf;
724 if (!ret) 724 if (!ret)
725 ret = (char *)pm.out - buf; 725 ret = (char __user *)pm.out - buf;
726 726
727out_pages: 727out_pages:
728 for (; pagecount; pagecount--) { 728 for (; pagecount; pagecount--) {
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c
index df26aa88fa47..0c10a0b3f146 100644
--- a/fs/proc/uptime.c
+++ b/fs/proc/uptime.c
@@ -1,45 +1,43 @@
1#include <linux/fs.h>
1#include <linux/init.h> 2#include <linux/init.h>
2#include <linux/proc_fs.h> 3#include <linux/proc_fs.h>
3#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/seq_file.h>
4#include <linux/time.h> 6#include <linux/time.h>
5#include <asm/cputime.h> 7#include <asm/cputime.h>
6 8
7static int proc_calc_metrics(char *page, char **start, off_t off, 9static int uptime_proc_show(struct seq_file *m, void *v)
8 int count, int *eof, int len)
9{
10 if (len <= off + count)
11 *eof = 1;
12 *start = page + off;
13 len -= off;
14 if (len > count)
15 len = count;
16 if (len < 0)
17 len = 0;
18 return len;
19}
20
21static int uptime_read_proc(char *page, char **start, off_t off, int count,
22 int *eof, void *data)
23{ 10{
24 struct timespec uptime; 11 struct timespec uptime;
25 struct timespec idle; 12 struct timespec idle;
26 int len;
27 cputime_t idletime = cputime_add(init_task.utime, init_task.stime); 13 cputime_t idletime = cputime_add(init_task.utime, init_task.stime);
28 14
29 do_posix_clock_monotonic_gettime(&uptime); 15 do_posix_clock_monotonic_gettime(&uptime);
30 monotonic_to_bootbased(&uptime); 16 monotonic_to_bootbased(&uptime);
31 cputime_to_timespec(idletime, &idle); 17 cputime_to_timespec(idletime, &idle);
32 len = sprintf(page, "%lu.%02lu %lu.%02lu\n", 18 seq_printf(m, "%lu.%02lu %lu.%02lu\n",
33 (unsigned long) uptime.tv_sec, 19 (unsigned long) uptime.tv_sec,
34 (uptime.tv_nsec / (NSEC_PER_SEC / 100)), 20 (uptime.tv_nsec / (NSEC_PER_SEC / 100)),
35 (unsigned long) idle.tv_sec, 21 (unsigned long) idle.tv_sec,
36 (idle.tv_nsec / (NSEC_PER_SEC / 100))); 22 (idle.tv_nsec / (NSEC_PER_SEC / 100)));
37 return proc_calc_metrics(page, start, off, count, eof, len); 23 return 0;
38} 24}
39 25
26static int uptime_proc_open(struct inode *inode, struct file *file)
27{
28 return single_open(file, uptime_proc_show, NULL);
29}
30
31static const struct file_operations uptime_proc_fops = {
32 .open = uptime_proc_open,
33 .read = seq_read,
34 .llseek = seq_lseek,
35 .release = single_release,
36};
37
40static int __init proc_uptime_init(void) 38static int __init proc_uptime_init(void)
41{ 39{
42 create_proc_read_entry("uptime", 0, NULL, uptime_read_proc, NULL); 40 proc_create("uptime", 0, NULL, &uptime_proc_fops);
43 return 0; 41 return 0;
44} 42}
45module_init(proc_uptime_init); 43module_init(proc_uptime_init);
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index d5066400638a..9229e5514a4e 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -492,7 +492,6 @@ int reiserfs_proc_info_init(struct super_block *sb)
492 spin_lock_init(&__PINFO(sb).lock); 492 spin_lock_init(&__PINFO(sb).lock);
493 REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root); 493 REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root);
494 if (REISERFS_SB(sb)->procdir) { 494 if (REISERFS_SB(sb)->procdir) {
495 REISERFS_SB(sb)->procdir->owner = THIS_MODULE;
496 REISERFS_SB(sb)->procdir->data = sb; 495 REISERFS_SB(sb)->procdir->data = sb;
497 add_file(sb, "version", show_version); 496 add_file(sb, "version", show_version);
498 add_file(sb, "super", show_super); 497 add_file(sb, "super", show_super);
@@ -556,9 +555,7 @@ int reiserfs_proc_info_global_init(void)
556{ 555{
557 if (proc_info_root == NULL) { 556 if (proc_info_root == NULL) {
558 proc_info_root = proc_mkdir(proc_info_root_name, NULL); 557 proc_info_root = proc_mkdir(proc_info_root_name, NULL);
559 if (proc_info_root) { 558 if (!proc_info_root) {
560 proc_info_root->owner = THIS_MODULE;
561 } else {
562 reiserfs_warning(NULL, "cannot create /proc/%s", 559 reiserfs_warning(NULL, "cannot create /proc/%s",
563 proc_info_root_name); 560 proc_info_root_name);
564 return 1; 561 return 1;
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 62b73668b602..f7c9c75a2775 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -230,6 +230,6 @@ static inline void ipmi_free_smi_msg(struct ipmi_smi_msg *msg)
230 automatically be dstroyed when the interface is destroyed. */ 230 automatically be dstroyed when the interface is destroyed. */
231int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, 231int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
232 read_proc_t *read_proc, 232 read_proc_t *read_proc,
233 void *data, struct module *owner); 233 void *data);
234 234
235#endif /* __LINUX_IPMI_SMI_H */ 235#endif /* __LINUX_IPMI_SMI_H */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index b8bdb96eff78..fbfa3d44d33d 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -41,9 +41,6 @@ enum {
41 * while parent/subdir create the directory structure (every 41 * while parent/subdir create the directory structure (every
42 * /proc file has a parent, but "subdir" is NULL for all 42 * /proc file has a parent, but "subdir" is NULL for all
43 * non-directory entries). 43 * non-directory entries).
44 *
45 * "owner" is used to protect module
46 * from unloading while proc_dir_entry is in use
47 */ 44 */
48 45
49typedef int (read_proc_t)(char *page, char **start, off_t off, 46typedef int (read_proc_t)(char *page, char **start, off_t off,
@@ -70,7 +67,6 @@ struct proc_dir_entry {
70 * somewhere. 67 * somewhere.
71 */ 68 */
72 const struct file_operations *proc_fops; 69 const struct file_operations *proc_fops;
73 struct module *owner;
74 struct proc_dir_entry *next, *parent, *subdir; 70 struct proc_dir_entry *next, *parent, *subdir;
75 void *data; 71 void *data;
76 read_proc_t *read_proc; 72 read_proc_t *read_proc;
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
index 162199a2d74f..fd8e0847b254 100644
--- a/net/appletalk/atalk_proc.c
+++ b/net/appletalk/atalk_proc.c
@@ -281,7 +281,6 @@ int __init atalk_proc_init(void)
281 atalk_proc_dir = proc_mkdir("atalk", init_net.proc_net); 281 atalk_proc_dir = proc_mkdir("atalk", init_net.proc_net);
282 if (!atalk_proc_dir) 282 if (!atalk_proc_dir)
283 goto out; 283 goto out;
284 atalk_proc_dir->owner = THIS_MODULE;
285 284
286 p = proc_create("interface", S_IRUGO, atalk_proc_dir, 285 p = proc_create("interface", S_IRUGO, atalk_proc_dir,
287 &atalk_seq_interface_fops); 286 &atalk_seq_interface_fops);
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 4990541ef5da..1a0f5ccea9c4 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -281,7 +281,6 @@ int mpc_proc_init(void)
281 printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME); 281 printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME);
282 return -ENOMEM; 282 return -ENOMEM;
283 } 283 }
284 p->owner = THIS_MODULE;
285 return 0; 284 return 0;
286} 285}
287 286
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 49487b313f22..e7b3b273907d 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -476,7 +476,6 @@ int __init atm_proc_init(void)
476 atm_proc_root, e->proc_fops); 476 atm_proc_root, e->proc_fops);
477 if (!dirent) 477 if (!dirent)
478 goto err_out_remove; 478 goto err_out_remove;
479 dirent->owner = THIS_MODULE;
480 e->dirent = dirent; 479 e->dirent = dirent;
481 } 480 }
482 ret = 0; 481 ret = 0;
diff --git a/net/can/bcm.c b/net/can/bcm.c
index b7c7d4651136..95d7f32643ae 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1604,10 +1604,6 @@ static int __init bcm_module_init(void)
1604 1604
1605 /* create /proc/net/can-bcm directory */ 1605 /* create /proc/net/can-bcm directory */
1606 proc_dir = proc_mkdir("can-bcm", init_net.proc_net); 1606 proc_dir = proc_mkdir("can-bcm", init_net.proc_net);
1607
1608 if (proc_dir)
1609 proc_dir->owner = THIS_MODULE;
1610
1611 return 0; 1607 return 0;
1612} 1608}
1613 1609
diff --git a/net/can/proc.c b/net/can/proc.c
index 520fef5e5398..1463653dbe34 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -473,8 +473,6 @@ void can_init_proc(void)
473 return; 473 return;
474 } 474 }
475 475
476 can_dir->owner = THIS_MODULE;
477
478 /* own procfs entries from the AF_CAN core */ 476 /* own procfs entries from the AF_CAN core */
479 pde_version = can_create_proc_readentry(CAN_PROC_VERSION, 0644, 477 pde_version = can_create_proc_readentry(CAN_PROC_VERSION, 0644,
480 can_proc_read_version, NULL); 478 can_proc_read_version, NULL);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 32d419f5ac98..3779c1438c11 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3806,7 +3806,6 @@ static int __init pg_init(void)
3806 pg_proc_dir = proc_mkdir(PG_PROC_DIR, init_net.proc_net); 3806 pg_proc_dir = proc_mkdir(PG_PROC_DIR, init_net.proc_net);
3807 if (!pg_proc_dir) 3807 if (!pg_proc_dir)
3808 return -ENODEV; 3808 return -ENODEV;
3809 pg_proc_dir->owner = THIS_MODULE;
3810 3809
3811 pe = proc_create(PGCTRL, 0600, pg_proc_dir, &pktgen_fops); 3810 pe = proc_create(PGCTRL, 0600, pg_proc_dir, &pktgen_fops);
3812 if (pe == NULL) { 3811 if (pe == NULL) {
diff --git a/net/irda/irproc.c b/net/irda/irproc.c
index 88e80a312732..8ff1861649e8 100644
--- a/net/irda/irproc.c
+++ b/net/irda/irproc.c
@@ -70,7 +70,6 @@ void __init irda_proc_register(void)
70 proc_irda = proc_mkdir("irda", init_net.proc_net); 70 proc_irda = proc_mkdir("irda", init_net.proc_net);
71 if (proc_irda == NULL) 71 if (proc_irda == NULL)
72 return; 72 return;
73 proc_irda->owner = THIS_MODULE;
74 73
75 for (i = 0; i < ARRAY_SIZE(irda_dirs); i++) 74 for (i = 0; i < ARRAY_SIZE(irda_dirs); i++)
76 d = proc_create(irda_dirs[i].name, 0, proc_irda, 75 d = proc_create(irda_dirs[i].name, 0, proc_irda,
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index b58bd7c6cdf8..d208b3396d94 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -236,7 +236,6 @@ int __init llc_proc_init(void)
236 llc_proc_dir = proc_mkdir("llc", init_net.proc_net); 236 llc_proc_dir = proc_mkdir("llc", init_net.proc_net);
237 if (!llc_proc_dir) 237 if (!llc_proc_dir)
238 goto out; 238 goto out;
239 llc_proc_dir->owner = THIS_MODULE;
240 239
241 p = proc_create("socket", S_IRUGO, llc_proc_dir, &llc_seq_socket_fops); 240 p = proc_create("socket", S_IRUGO, llc_proc_dir, &llc_seq_socket_fops);
242 if (!p) 241 if (!p)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index cb198af8887c..8eb3e61cb701 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -106,12 +106,8 @@ static __init int sctp_proc_init(void)
106 goto out_nomem; 106 goto out_nomem;
107#ifdef CONFIG_PROC_FS 107#ifdef CONFIG_PROC_FS
108 if (!proc_net_sctp) { 108 if (!proc_net_sctp) {
109 struct proc_dir_entry *ent; 109 proc_net_sctp = proc_mkdir("sctp", init_net.proc_net);
110 ent = proc_mkdir("sctp", init_net.proc_net); 110 if (!proc_net_sctp)
111 if (ent) {
112 ent->owner = THIS_MODULE;
113 proc_net_sctp = ent;
114 } else
115 goto out_free_percpu; 111 goto out_free_percpu;
116 } 112 }
117 113
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 4735caad26ed..20029a79a5de 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -313,7 +313,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
313 cd->proc_ent = proc_mkdir(cd->name, proc_net_rpc); 313 cd->proc_ent = proc_mkdir(cd->name, proc_net_rpc);
314 if (cd->proc_ent == NULL) 314 if (cd->proc_ent == NULL)
315 goto out_nomem; 315 goto out_nomem;
316 cd->proc_ent->owner = cd->owner;
317 cd->channel_ent = cd->content_ent = NULL; 316 cd->channel_ent = cd->content_ent = NULL;
318 317
319 p = proc_create_data("flush", S_IFREG|S_IRUSR|S_IWUSR, 318 p = proc_create_data("flush", S_IFREG|S_IRUSR|S_IWUSR,
@@ -321,7 +320,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
321 cd->flush_ent = p; 320 cd->flush_ent = p;
322 if (p == NULL) 321 if (p == NULL)
323 goto out_nomem; 322 goto out_nomem;
324 p->owner = cd->owner;
325 323
326 if (cd->cache_request || cd->cache_parse) { 324 if (cd->cache_request || cd->cache_parse) {
327 p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR, 325 p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
@@ -329,7 +327,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
329 cd->channel_ent = p; 327 cd->channel_ent = p;
330 if (p == NULL) 328 if (p == NULL)
331 goto out_nomem; 329 goto out_nomem;
332 p->owner = cd->owner;
333 } 330 }
334 if (cd->cache_show) { 331 if (cd->cache_show) {
335 p = proc_create_data("content", S_IFREG|S_IRUSR|S_IWUSR, 332 p = proc_create_data("content", S_IFREG|S_IRUSR|S_IWUSR,
@@ -337,7 +334,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
337 cd->content_ent = p; 334 cd->content_ent = p;
338 if (p == NULL) 335 if (p == NULL)
339 goto out_nomem; 336 goto out_nomem;
340 p->owner = cd->owner;
341 } 337 }
342 return 0; 338 return 0;
343out_nomem: 339out_nomem:
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 085372ef4feb..1ef6e46d9da2 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -262,14 +262,8 @@ void
262rpc_proc_init(void) 262rpc_proc_init(void)
263{ 263{
264 dprintk("RPC: registering /proc/net/rpc\n"); 264 dprintk("RPC: registering /proc/net/rpc\n");
265 if (!proc_net_rpc) { 265 if (!proc_net_rpc)
266 struct proc_dir_entry *ent; 266 proc_net_rpc = proc_mkdir("rpc", init_net.proc_net);
267 ent = proc_mkdir("rpc", init_net.proc_net);
268 if (ent) {
269 ent->owner = THIS_MODULE;
270 proc_net_rpc = ent;
271 }
272 }
273} 267}
274 268
275void 269void
diff --git a/sound/core/info.c b/sound/core/info.c
index 70fa87189f36..35df614f6c55 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -154,11 +154,6 @@ EXPORT_SYMBOL(snd_seq_root);
154struct snd_info_entry *snd_oss_root; 154struct snd_info_entry *snd_oss_root;
155#endif 155#endif
156 156
157static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
158{
159 de->owner = THIS_MODULE;
160}
161
162static void snd_remove_proc_entry(struct proc_dir_entry *parent, 157static void snd_remove_proc_entry(struct proc_dir_entry *parent,
163 struct proc_dir_entry *de) 158 struct proc_dir_entry *de)
164{ 159{
@@ -522,32 +517,11 @@ static const struct file_operations snd_info_entry_operations =
522 .release = snd_info_entry_release, 517 .release = snd_info_entry_release,
523}; 518};
524 519
525/**
526 * snd_create_proc_entry - create a procfs entry
527 * @name: the name of the proc file
528 * @mode: the file permission bits, S_Ixxx
529 * @parent: the parent proc-directory entry
530 *
531 * Creates a new proc file entry with the given name and permission
532 * on the given directory.
533 *
534 * Returns the pointer of new instance or NULL on failure.
535 */
536static struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode,
537 struct proc_dir_entry *parent)
538{
539 struct proc_dir_entry *p;
540 p = create_proc_entry(name, mode, parent);
541 if (p)
542 snd_info_entry_prepare(p);
543 return p;
544}
545
546int __init snd_info_init(void) 520int __init snd_info_init(void)
547{ 521{
548 struct proc_dir_entry *p; 522 struct proc_dir_entry *p;
549 523
550 p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL); 524 p = create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL);
551 if (p == NULL) 525 if (p == NULL)
552 return -ENOMEM; 526 return -ENOMEM;
553 snd_proc_root = p; 527 snd_proc_root = p;
@@ -974,12 +948,11 @@ int snd_info_register(struct snd_info_entry * entry)
974 return -ENXIO; 948 return -ENXIO;
975 root = entry->parent == NULL ? snd_proc_root : entry->parent->p; 949 root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
976 mutex_lock(&info_mutex); 950 mutex_lock(&info_mutex);
977 p = snd_create_proc_entry(entry->name, entry->mode, root); 951 p = create_proc_entry(entry->name, entry->mode, root);
978 if (!p) { 952 if (!p) {
979 mutex_unlock(&info_mutex); 953 mutex_unlock(&info_mutex);
980 return -ENOMEM; 954 return -ENOMEM;
981 } 955 }
982 p->owner = entry->module;
983 if (!S_ISDIR(entry->mode)) 956 if (!S_ISDIR(entry->mode))
984 p->proc_fops = &snd_info_entry_operations; 957 p->proc_fops = &snd_info_entry_operations;
985 p->size = entry->size; 958 p->size = entry->size;