Add patches accepted for 2.6.30-rc1
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.30-rc1 / 0002-proc-2-2-remove-struct-proc_dir_entry-owner.patch
blob9f56c2e2af84de8f815ed318aa667a0515a331b7
1 From 99b76233803beab302123d243eea9e41149804f3 Mon Sep 17 00:00:00 2001
2 From: Alexey Dobriyan <adobriyan@gmail.com>
3 Date: Wed, 25 Mar 2009 22:48:06 +0300
4 Subject: proc 2/2: remove struct proc_dir_entry::owner
6 Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
7 as correctly noted at bug #12454. Someone can lookup entry with NULL
8 ->owner, thus not pinning enything, and release it later resulting
9 in module refcount underflow.
11 We can keep ->owner and supply it at registration time like ->proc_fops
12 and ->data.
14 But this leaves ->owner as easy-manipulative field (just one C assignment)
15 and somebody will forget to unpin previous/pin current module when
16 switching ->owner. ->proc_fops is declared as "const" which should give
17 some thoughts.
19 ->read_proc/->write_proc were just fixed to not require ->owner for
20 protection.
22 rmmod'ed directories will be empty and return "." and ".." -- no harm.
23 And directories with tricky enough readdir and lookup shouldn't be modular.
24 We definitely don't want such modular code.
26 Removing ->owner will also make PDE smaller.
28 So, let's nuke it.
30 Kudos to Jeff Layton for reminding about this, let's say, oversight.
32 http://bugzilla.kernel.org/show_bug.cgi?id=12454
34 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
35 ---
36 Documentation/DocBook/procfs_example.c | 9 --------
37 arch/alpha/kernel/srm_env.c | 5 ----
38 arch/blackfin/mm/sram-alloc.c | 1 -
39 arch/ia64/kernel/palinfo.c | 2 -
40 arch/ia64/sn/kernel/sn2/prominfo_proc.c | 9 +------
41 arch/powerpc/kernel/rtas_flash.c | 1 -
42 arch/sparc/kernel/led.c | 1 -
43 arch/x86/kernel/cpu/mtrr/if.c | 10 +--------
44 drivers/acpi/ac.c | 1 -
45 drivers/acpi/battery.c | 1 -
46 drivers/acpi/button.c | 3 --
47 drivers/acpi/fan.c | 2 -
48 drivers/acpi/processor_core.c | 2 -
49 drivers/acpi/sbs.c | 1 -
50 drivers/acpi/thermal.c | 2 -
51 drivers/acpi/video.c | 5 ----
52 drivers/block/ps3vram.c | 2 -
53 drivers/char/ipmi/ipmi_msghandler.c | 12 +++-------
54 drivers/char/ipmi/ipmi_si_intf.c | 6 ++--
55 drivers/input/input.c | 2 -
56 drivers/isdn/hardware/eicon/divasi.c | 1 -
57 drivers/media/video/cpia.c | 4 +--
58 drivers/message/i2o/i2o_proc.c | 2 -
59 drivers/net/bonding/bond_main.c | 35 +-----------------------------
60 drivers/net/irda/vlsi_ir.c | 7 ------
61 drivers/net/wireless/airo.c | 1 -
62 drivers/platform/x86/asus_acpi.c | 3 --
63 drivers/platform/x86/thinkpad_acpi.c | 2 -
64 drivers/platform/x86/toshiba_acpi.c | 3 --
65 drivers/rtc/rtc-proc.c | 10 +-------
66 drivers/s390/block/dasd_proc.c | 2 -
67 drivers/scsi/scsi_devinfo.c | 2 -
68 drivers/scsi/scsi_proc.c | 3 --
69 drivers/video/via/viafbdev.c | 5 ----
70 fs/afs/proc.c | 1 -
71 fs/cifs/cifs_debug.c | 1 -
72 fs/jfs/jfs_debug.c | 1 -
73 fs/nfs/client.c | 2 -
74 fs/proc/inode.c | 19 ++--------------
75 fs/proc/proc_tty.c | 1 -
76 fs/reiserfs/procfs.c | 5 +---
77 include/linux/ipmi_smi.h | 2 +-
78 include/linux/proc_fs.h | 4 ---
79 net/appletalk/atalk_proc.c | 1 -
80 net/atm/mpoa_proc.c | 1 -
81 net/atm/proc.c | 1 -
82 net/can/bcm.c | 4 ---
83 net/can/proc.c | 2 -
84 net/core/pktgen.c | 1 -
85 net/irda/irproc.c | 1 -
86 net/llc/llc_proc.c | 1 -
87 net/sctp/protocol.c | 8 +-----
88 net/sunrpc/cache.c | 4 ---
89 net/sunrpc/stats.c | 10 +-------
90 sound/core/info.c | 31 +-------------------------
91 55 files changed, 26 insertions(+), 232 deletions(-)
93 diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c
94 index 8c6396e..a5b1179 100644
95 --- a/Documentation/DocBook/procfs_example.c
96 +++ b/Documentation/DocBook/procfs_example.c
97 @@ -117,9 +117,6 @@ static int __init init_procfs_example(void)
98 rv = -ENOMEM;
99 goto out;
102 - example_dir->owner = THIS_MODULE;
104 /* create jiffies using convenience function */
105 jiffies_file = create_proc_read_entry("jiffies",
106 0444, example_dir,
107 @@ -130,8 +127,6 @@ static int __init init_procfs_example(void)
108 goto no_jiffies;
111 - jiffies_file->owner = THIS_MODULE;
113 /* create foo and bar files using same callback
114 * functions
116 @@ -146,7 +141,6 @@ static int __init init_procfs_example(void)
117 foo_file->data = &foo_data;
118 foo_file->read_proc = proc_read_foobar;
119 foo_file->write_proc = proc_write_foobar;
120 - foo_file->owner = THIS_MODULE;
122 bar_file = create_proc_entry("bar", 0644, example_dir);
123 if(bar_file == NULL) {
124 @@ -159,7 +153,6 @@ static int __init init_procfs_example(void)
125 bar_file->data = &bar_data;
126 bar_file->read_proc = proc_read_foobar;
127 bar_file->write_proc = proc_write_foobar;
128 - bar_file->owner = THIS_MODULE;
130 /* create symlink */
131 symlink = proc_symlink("jiffies_too", example_dir,
132 @@ -169,8 +162,6 @@ static int __init init_procfs_example(void)
133 goto no_symlink;
136 - symlink->owner = THIS_MODULE;
138 /* everything OK */
139 printk(KERN_INFO "%s %s initialised\n",
140 MODULE_NAME, MODULE_VERS);
141 diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
142 index 78ad7cd..d12af47 100644
143 --- a/arch/alpha/kernel/srm_env.c
144 +++ b/arch/alpha/kernel/srm_env.c
145 @@ -218,7 +218,6 @@ srm_env_init(void)
146 BASE_DIR);
147 goto cleanup;
149 - base_dir->owner = THIS_MODULE;
152 * Create per-name subdirectory
153 @@ -229,7 +228,6 @@ srm_env_init(void)
154 BASE_DIR, NAMED_DIR);
155 goto cleanup;
157 - named_dir->owner = THIS_MODULE;
160 * Create per-number subdirectory
161 @@ -241,7 +239,6 @@ srm_env_init(void)
162 goto cleanup;
165 - numbered_dir->owner = THIS_MODULE;
168 * Create all named nodes
169 @@ -254,7 +251,6 @@ srm_env_init(void)
170 goto cleanup;
172 entry->proc_entry->data = (void *) entry;
173 - entry->proc_entry->owner = THIS_MODULE;
174 entry->proc_entry->read_proc = srm_env_read;
175 entry->proc_entry->write_proc = srm_env_write;
177 @@ -275,7 +271,6 @@ srm_env_init(void)
179 entry->id = var_num;
180 entry->proc_entry->data = (void *) entry;
181 - entry->proc_entry->owner = THIS_MODULE;
182 entry->proc_entry->read_proc = srm_env_read;
183 entry->proc_entry->write_proc = srm_env_write;
185 diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
186 index 834cab7..530d139 100644
187 --- a/arch/blackfin/mm/sram-alloc.c
188 +++ b/arch/blackfin/mm/sram-alloc.c
189 @@ -854,7 +854,6 @@ static int __init sram_proc_init(void)
190 printk(KERN_WARNING "unable to create /proc/sram\n");
191 return -1;
193 - ptr->owner = THIS_MODULE;
194 ptr->read_proc = sram_proc_read;
195 return 0;
197 diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
198 index e5c57f4..a4f19c7 100644
199 --- a/arch/ia64/kernel/palinfo.c
200 +++ b/arch/ia64/kernel/palinfo.c
201 @@ -1002,8 +1002,6 @@ create_palinfo_proc_entries(unsigned int cpu)
202 *pdir = create_proc_read_entry(
203 palinfo_entries[j].name, 0, cpu_dir,
204 palinfo_read_entry, (void *)f.value);
205 - if (*pdir)
206 - (*pdir)->owner = THIS_MODULE;
207 pdir++;
210 diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
211 index 4dcce3d..e633288 100644
212 --- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c
213 +++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
214 @@ -225,7 +225,6 @@ static struct proc_dir_entry *sgi_prominfo_entry;
215 int __init prominfo_init(void)
217 struct proc_dir_entry **entp;
218 - struct proc_dir_entry *p;
219 cnodeid_t cnodeid;
220 unsigned long nasid;
221 int size;
222 @@ -246,14 +245,10 @@ int __init prominfo_init(void)
223 sprintf(name, "node%d", cnodeid);
224 *entp = proc_mkdir(name, sgi_prominfo_entry);
225 nasid = cnodeid_to_nasid(cnodeid);
226 - p = create_proc_read_entry("fit", 0, *entp, read_fit_entry,
227 + create_proc_read_entry("fit", 0, *entp, read_fit_entry,
228 (void *)nasid);
229 - if (p)
230 - p->owner = THIS_MODULE;
231 - p = create_proc_read_entry("version", 0, *entp,
232 + create_proc_read_entry("version", 0, *entp,
233 read_version_entry, (void *)nasid);
234 - if (p)
235 - p->owner = THIS_MODULE;
236 entp++;
239 diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
240 index 149cb11..13011a9 100644
241 --- a/arch/powerpc/kernel/rtas_flash.c
242 +++ b/arch/powerpc/kernel/rtas_flash.c
243 @@ -669,7 +669,6 @@ static void remove_flash_pde(struct proc_dir_entry *dp)
245 if (dp) {
246 kfree(dp->data);
247 - dp->owner = NULL;
248 remove_proc_entry(dp->name, dp->parent);
251 diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c
252 index adaaed4..00d034e 100644
253 --- a/arch/sparc/kernel/led.c
254 +++ b/arch/sparc/kernel/led.c
255 @@ -126,7 +126,6 @@ static int __init led_init(void)
256 led = proc_create("led", 0, NULL, &led_proc_fops);
257 if (!led)
258 return -ENOMEM;
259 - led->owner = THIS_MODULE;
261 printk(KERN_INFO
262 "led: version %s, Lars Kotthoff <metalhead@metalhead.ws>\n",
263 diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
264 index 4c42146..fb73a52 100644
265 --- a/arch/x86/kernel/cpu/mtrr/if.c
266 +++ b/arch/x86/kernel/cpu/mtrr/if.c
267 @@ -377,10 +377,6 @@ static const struct file_operations mtrr_fops = {
268 .release = mtrr_close,
272 -static struct proc_dir_entry *proc_root_mtrr;
275 static int mtrr_seq_show(struct seq_file *seq, void *offset)
277 char factor;
278 @@ -423,11 +419,7 @@ static int __init mtrr_if_init(void)
279 (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
280 return -ENODEV;
282 - proc_root_mtrr =
283 - proc_create("mtrr", S_IWUSR | S_IRUGO, NULL, &mtrr_fops);
285 - if (proc_root_mtrr)
286 - proc_root_mtrr->owner = THIS_MODULE;
287 + proc_create("mtrr", S_IWUSR | S_IRUGO, NULL, &mtrr_fops);
288 return 0;
291 diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
292 index 9b917da..88e42ab 100644
293 --- a/drivers/acpi/ac.c
294 +++ b/drivers/acpi/ac.c
295 @@ -191,7 +191,6 @@ static int acpi_ac_add_fs(struct acpi_device *device)
296 acpi_ac_dir);
297 if (!acpi_device_dir(device))
298 return -ENODEV;
299 - acpi_device_dir(device)->owner = THIS_MODULE;
302 /* 'state' [R] */
303 diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
304 index 69cbc57..3bcb5bf 100644
305 --- a/drivers/acpi/battery.c
306 +++ b/drivers/acpi/battery.c
307 @@ -760,7 +760,6 @@ static int acpi_battery_add_fs(struct acpi_device *device)
308 acpi_battery_dir);
309 if (!acpi_device_dir(device))
310 return -ENODEV;
311 - acpi_device_dir(device)->owner = THIS_MODULE;
314 for (i = 0; i < ACPI_BATTERY_NUMFILES; ++i) {
315 diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
316 index 171fd91..c2f0606 100644
317 --- a/drivers/acpi/button.c
318 +++ b/drivers/acpi/button.c
319 @@ -200,12 +200,10 @@ static int acpi_button_add_fs(struct acpi_device *device)
321 if (!entry)
322 return -ENODEV;
323 - entry->owner = THIS_MODULE;
325 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry);
326 if (!acpi_device_dir(device))
327 return -ENODEV;
328 - acpi_device_dir(device)->owner = THIS_MODULE;
330 /* 'info' [R] */
331 entry = proc_create_data(ACPI_BUTTON_FILE_INFO,
332 @@ -522,7 +520,6 @@ static int __init acpi_button_init(void)
333 acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir);
334 if (!acpi_button_dir)
335 return -ENODEV;
336 - acpi_button_dir->owner = THIS_MODULE;
337 result = acpi_bus_register_driver(&acpi_button_driver);
338 if (result < 0) {
339 remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
340 diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
341 index eaaee16..8a02944 100644
342 --- a/drivers/acpi/fan.c
343 +++ b/drivers/acpi/fan.c
344 @@ -193,7 +193,6 @@ static int acpi_fan_add_fs(struct acpi_device *device)
345 acpi_fan_dir);
346 if (!acpi_device_dir(device))
347 return -ENODEV;
348 - acpi_device_dir(device)->owner = THIS_MODULE;
351 /* 'status' [R/W] */
352 @@ -347,7 +346,6 @@ static int __init acpi_fan_init(void)
353 acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
354 if (!acpi_fan_dir)
355 return -ENODEV;
356 - acpi_fan_dir->owner = THIS_MODULE;
357 #endif
359 result = acpi_bus_register_driver(&acpi_fan_driver);
360 diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
361 index 0cc2fd3..fa2f742 100644
362 --- a/drivers/acpi/processor_core.c
363 +++ b/drivers/acpi/processor_core.c
364 @@ -359,7 +359,6 @@ static int acpi_processor_add_fs(struct acpi_device *device)
365 if (!acpi_device_dir(device))
366 return -ENODEV;
368 - acpi_device_dir(device)->owner = THIS_MODULE;
370 /* 'info' [R] */
371 entry = proc_create_data(ACPI_PROCESSOR_FILE_INFO,
372 @@ -1137,7 +1136,6 @@ static int __init acpi_processor_init(void)
373 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
374 if (!acpi_processor_dir)
375 return -ENOMEM;
376 - acpi_processor_dir->owner = THIS_MODULE;
379 * Check whether the system is DMI table. If yes, OSPM
380 diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
381 index 6050ce4..59afd52 100644
382 --- a/drivers/acpi/sbs.c
383 +++ b/drivers/acpi/sbs.c
384 @@ -488,7 +488,6 @@ acpi_sbs_add_fs(struct proc_dir_entry **dir,
385 if (!*dir) {
386 return -ENODEV;
388 - (*dir)->owner = THIS_MODULE;
391 /* 'info' [R] */
392 diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
393 index 99e6f1f..c11f9ae 100644
394 --- a/drivers/acpi/thermal.c
395 +++ b/drivers/acpi/thermal.c
396 @@ -1506,7 +1506,6 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
397 acpi_thermal_dir);
398 if (!acpi_device_dir(device))
399 return -ENODEV;
400 - acpi_device_dir(device)->owner = THIS_MODULE;
403 /* 'state' [R] */
404 @@ -1875,7 +1874,6 @@ static int __init acpi_thermal_init(void)
405 acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir);
406 if (!acpi_thermal_dir)
407 return -ENODEV;
408 - acpi_thermal_dir->owner = THIS_MODULE;
410 result = acpi_bus_register_driver(&acpi_thermal_driver);
411 if (result < 0) {
412 diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
413 index bb5ed05..67cc36d 100644
414 --- a/drivers/acpi/video.c
415 +++ b/drivers/acpi/video.c
416 @@ -1125,8 +1125,6 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
417 if (!device_dir)
418 return -ENOMEM;
420 - device_dir->owner = THIS_MODULE;
422 /* 'info' [R] */
423 entry = proc_create_data("info", S_IRUGO, device_dir,
424 &acpi_video_device_info_fops, acpi_driver_data(device));
425 @@ -1403,8 +1401,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
426 if (!device_dir)
427 return -ENOMEM;
429 - device_dir->owner = THIS_MODULE;
431 /* 'info' [R] */
432 entry = proc_create_data("info", S_IRUGO, device_dir,
433 &acpi_video_bus_info_fops,
434 @@ -2131,7 +2127,6 @@ static int __init acpi_video_init(void)
435 acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir);
436 if (!acpi_video_dir)
437 return -ENODEV;
438 - acpi_video_dir->owner = THIS_MODULE;
440 result = acpi_bus_register_driver(&acpi_video_bus);
441 if (result < 0) {
442 diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
443 index 393ed67..8eddef3 100644
444 --- a/drivers/block/ps3vram.c
445 +++ b/drivers/block/ps3vram.c
446 @@ -551,8 +551,6 @@ static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev)
447 dev_warn(&dev->core, "failed to create /proc entry\n");
448 return;
451 - pde->owner = THIS_MODULE;
452 pde->data = priv;
455 diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
456 index 7a88dfd..e93fc8d 100644
457 --- a/drivers/char/ipmi/ipmi_msghandler.c
458 +++ b/drivers/char/ipmi/ipmi_msghandler.c
459 @@ -1944,7 +1944,7 @@ static int stat_file_read_proc(char *page, char **start, off_t off,
461 int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
462 read_proc_t *read_proc,
463 - void *data, struct module *owner)
464 + void *data)
466 int rv = 0;
467 #ifdef CONFIG_PROC_FS
468 @@ -1970,7 +1970,6 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
469 } else {
470 file->data = data;
471 file->read_proc = read_proc;
472 - file->owner = owner;
474 mutex_lock(&smi->proc_entry_lock);
475 /* Stick it on the list. */
476 @@ -1993,23 +1992,21 @@ static int add_proc_entries(ipmi_smi_t smi, int num)
477 smi->proc_dir = proc_mkdir(smi->proc_dir_name, proc_ipmi_root);
478 if (!smi->proc_dir)
479 rv = -ENOMEM;
480 - else
481 - smi->proc_dir->owner = THIS_MODULE;
483 if (rv == 0)
484 rv = ipmi_smi_add_proc_entry(smi, "stats",
485 stat_file_read_proc,
486 - smi, THIS_MODULE);
487 + smi);
489 if (rv == 0)
490 rv = ipmi_smi_add_proc_entry(smi, "ipmb",
491 ipmb_file_read_proc,
492 - smi, THIS_MODULE);
493 + smi);
495 if (rv == 0)
496 rv = ipmi_smi_add_proc_entry(smi, "version",
497 version_file_read_proc,
498 - smi, THIS_MODULE);
499 + smi);
500 #endif /* CONFIG_PROC_FS */
502 return rv;
503 @@ -4265,7 +4262,6 @@ static int ipmi_init_msghandler(void)
504 return -ENOMEM;
507 - proc_ipmi_root->owner = THIS_MODULE;
508 #endif /* CONFIG_PROC_FS */
510 setup_timer(&ipmi_timer, ipmi_timeout, 0);
511 diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
512 index 3000135..e58ea4c 100644
513 --- a/drivers/char/ipmi/ipmi_si_intf.c
514 +++ b/drivers/char/ipmi/ipmi_si_intf.c
515 @@ -2899,7 +2899,7 @@ static int try_smi_init(struct smi_info *new_smi)
517 rv = ipmi_smi_add_proc_entry(new_smi->intf, "type",
518 type_file_read_proc,
519 - new_smi, THIS_MODULE);
520 + new_smi);
521 if (rv) {
522 printk(KERN_ERR
523 "ipmi_si: Unable to create proc entry: %d\n",
524 @@ -2909,7 +2909,7 @@ static int try_smi_init(struct smi_info *new_smi)
526 rv = ipmi_smi_add_proc_entry(new_smi->intf, "si_stats",
527 stat_file_read_proc,
528 - new_smi, THIS_MODULE);
529 + new_smi);
530 if (rv) {
531 printk(KERN_ERR
532 "ipmi_si: Unable to create proc entry: %d\n",
533 @@ -2919,7 +2919,7 @@ static int try_smi_init(struct smi_info *new_smi)
535 rv = ipmi_smi_add_proc_entry(new_smi->intf, "params",
536 param_read_proc,
537 - new_smi, THIS_MODULE);
538 + new_smi);
539 if (rv) {
540 printk(KERN_ERR
541 "ipmi_si: Unable to create proc entry: %d\n",
542 diff --git a/drivers/input/input.c b/drivers/input/input.c
543 index 1730d73..ec3db3a 100644
544 --- a/drivers/input/input.c
545 +++ b/drivers/input/input.c
546 @@ -903,8 +903,6 @@ static int __init input_proc_init(void)
547 if (!proc_bus_input_dir)
548 return -ENOMEM;
550 - proc_bus_input_dir->owner = THIS_MODULE;
552 entry = proc_create("devices", 0, proc_bus_input_dir,
553 &input_devices_fileops);
554 if (!entry)
555 diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
556 index f4969fe..69e71eb 100644
557 --- a/drivers/isdn/hardware/eicon/divasi.c
558 +++ b/drivers/isdn/hardware/eicon/divasi.c
559 @@ -118,7 +118,6 @@ static int DIVA_INIT_FUNCTION create_um_idi_proc(void)
560 return (0);
562 um_idi_proc_entry->read_proc = um_idi_proc_read;
563 - um_idi_proc_entry->owner = THIS_MODULE;
565 return (1);
567 diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
568 index c3b0c8c..43ab0ad 100644
569 --- a/drivers/media/video/cpia.c
570 +++ b/drivers/media/video/cpia.c
571 @@ -1381,9 +1381,7 @@ static void proc_cpia_create(void)
573 cpia_proc_root = proc_mkdir("cpia", NULL);
575 - if (cpia_proc_root)
576 - cpia_proc_root->owner = THIS_MODULE;
577 - else
578 + if (!cpia_proc_root)
579 LOG("Unable to initialise /proc/cpia\n");
582 diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
583 index 9a36b5a..7045c45 100644
584 --- a/drivers/message/i2o/i2o_proc.c
585 +++ b/drivers/message/i2o/i2o_proc.c
586 @@ -2037,8 +2037,6 @@ static int __init i2o_proc_fs_create(void)
587 if (!i2o_proc_dir_root)
588 return -1;
590 - i2o_proc_dir_root->owner = THIS_MODULE;
592 list_for_each_entry(c, &i2o_controllers, list)
593 i2o_proc_iop_add(i2o_proc_dir_root, c);
595 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
596 index 9c326a5..99610f3 100644
597 --- a/drivers/net/bonding/bond_main.c
598 +++ b/drivers/net/bonding/bond_main.c
599 @@ -3444,25 +3444,12 @@ static void bond_remove_proc_entry(struct bonding *bond)
601 static void bond_create_proc_dir(void)
603 - int len = strlen(DRV_NAME);
605 - for (bond_proc_dir = init_net.proc_net->subdir; bond_proc_dir;
606 - bond_proc_dir = bond_proc_dir->next) {
607 - if ((bond_proc_dir->namelen == len) &&
608 - !memcmp(bond_proc_dir->name, DRV_NAME, len)) {
609 - break;
613 if (!bond_proc_dir) {
614 bond_proc_dir = proc_mkdir(DRV_NAME, init_net.proc_net);
615 - if (bond_proc_dir) {
616 - bond_proc_dir->owner = THIS_MODULE;
617 - } else {
618 + if (!bond_proc_dir)
619 printk(KERN_WARNING DRV_NAME
620 ": Warning: cannot create /proc/net/%s\n",
621 DRV_NAME);
626 @@ -3471,25 +3458,7 @@ static void bond_create_proc_dir(void)
628 static void bond_destroy_proc_dir(void)
630 - struct proc_dir_entry *de;
632 - if (!bond_proc_dir) {
633 - return;
636 - /* verify that the /proc dir is empty */
637 - for (de = bond_proc_dir->subdir; de; de = de->next) {
638 - /* ignore . and .. */
639 - if (*(de->name) != '.') {
640 - break;
644 - if (de) {
645 - if (bond_proc_dir->owner == THIS_MODULE) {
646 - bond_proc_dir->owner = NULL;
648 - } else {
649 + if (bond_proc_dir) {
650 remove_proc_entry(DRV_NAME, init_net.proc_net);
651 bond_proc_dir = NULL;
653 diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
654 index 1243bc8..ac0e4b6 100644
655 --- a/drivers/net/irda/vlsi_ir.c
656 +++ b/drivers/net/irda/vlsi_ir.c
657 @@ -1871,13 +1871,6 @@ static int __init vlsi_mod_init(void)
658 * without procfs - it's not required for the driver to work.
660 vlsi_proc_root = proc_mkdir(PROC_DIR, NULL);
661 - if (vlsi_proc_root) {
662 - /* protect registered procdir against module removal.
663 - * Because we are in the module init path there's no race
664 - * window after create_proc_entry (and no barrier needed).
665 - */
666 - vlsi_proc_root->owner = THIS_MODULE;
669 ret = pci_register_driver(&vlsi_irda_driver);
671 diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
672 index 7e80aba..31b1cc2 100644
673 --- a/drivers/net/wireless/airo.c
674 +++ b/drivers/net/wireless/airo.c
675 @@ -4494,7 +4494,6 @@ static int setup_proc_entry( struct net_device *dev,
676 goto fail;
677 apriv->proc_entry->uid = proc_uid;
678 apriv->proc_entry->gid = proc_gid;
679 - apriv->proc_entry->owner = THIS_MODULE;
681 /* Setup the StatsDelta */
682 entry = proc_create_data("StatsDelta",
683 diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
684 index d63f26e..ba1f749 100644
685 --- a/drivers/platform/x86/asus_acpi.c
686 +++ b/drivers/platform/x86/asus_acpi.c
687 @@ -987,7 +987,6 @@ asus_proc_add(char *name, proc_writefunc *writefunc,
688 proc->write_proc = writefunc;
689 proc->read_proc = readfunc;
690 proc->data = acpi_driver_data(device);
691 - proc->owner = THIS_MODULE;
692 proc->uid = asus_uid;
693 proc->gid = asus_gid;
694 return 0;
695 @@ -1020,7 +1019,6 @@ static int asus_hotk_add_fs(struct acpi_device *device)
696 if (proc) {
697 proc->read_proc = proc_read_info;
698 proc->data = acpi_driver_data(device);
699 - proc->owner = THIS_MODULE;
700 proc->uid = asus_uid;
701 proc->gid = asus_gid;
702 } else {
703 @@ -1436,7 +1434,6 @@ static int __init asus_acpi_init(void)
704 printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
705 return -ENODEV;
707 - asus_proc_dir->owner = THIS_MODULE;
709 result = acpi_bus_register_driver(&asus_hotk_driver);
710 if (result < 0) {
711 diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
712 index d243320..3dad27a 100644
713 --- a/drivers/platform/x86/thinkpad_acpi.c
714 +++ b/drivers/platform/x86/thinkpad_acpi.c
715 @@ -6992,7 +6992,6 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
716 ret = -ENODEV;
717 goto err_out;
719 - entry->owner = THIS_MODULE;
720 entry->data = ibm;
721 entry->read_proc = &dispatch_procfs_read;
722 if (ibm->write)
723 @@ -7405,7 +7404,6 @@ static int __init thinkpad_acpi_module_init(void)
724 thinkpad_acpi_module_exit();
725 return -ENODEV;
727 - proc_dir->owner = THIS_MODULE;
729 ret = platform_driver_register(&tpacpi_pdriver);
730 if (ret) {
731 diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
732 index 40e60fc..9f18726 100644
733 --- a/drivers/platform/x86/toshiba_acpi.c
734 +++ b/drivers/platform/x86/toshiba_acpi.c
735 @@ -679,8 +679,6 @@ static acpi_status __init add_device(void)
736 toshiba_proc_dir,
737 (read_proc_t *) dispatch_read,
738 item);
739 - if (proc)
740 - proc->owner = THIS_MODULE;
741 if (proc && item->write_func)
742 proc->write_proc = (write_proc_t *) dispatch_write;
744 @@ -772,7 +770,6 @@ static int __init toshiba_acpi_init(void)
745 toshiba_acpi_exit();
746 return -ENODEV;
747 } else {
748 - toshiba_proc_dir->owner = THIS_MODULE;
749 status = add_device();
750 if (ACPI_FAILURE(status)) {
751 toshiba_acpi_exit();
752 diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
753 index 0c6257a..c086fc3 100644
754 --- a/drivers/rtc/rtc-proc.c
755 +++ b/drivers/rtc/rtc-proc.c
756 @@ -105,14 +105,8 @@ static const struct file_operations rtc_proc_fops = {
758 void rtc_proc_add_device(struct rtc_device *rtc)
760 - if (rtc->id == 0) {
761 - struct proc_dir_entry *ent;
763 - ent = proc_create_data("driver/rtc", 0, NULL,
764 - &rtc_proc_fops, rtc);
765 - if (ent)
766 - ent->owner = rtc->owner;
768 + if (rtc->id == 0)
769 + proc_create_data("driver/rtc", 0, NULL, &rtc_proc_fops, rtc);
772 void rtc_proc_del_device(struct rtc_device *rtc)
773 diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
774 index 2080ba6..654daa3 100644
775 --- a/drivers/s390/block/dasd_proc.c
776 +++ b/drivers/s390/block/dasd_proc.c
777 @@ -320,7 +320,6 @@ dasd_proc_init(void)
778 dasd_proc_root_entry = proc_mkdir("dasd", NULL);
779 if (!dasd_proc_root_entry)
780 goto out_nodasd;
781 - dasd_proc_root_entry->owner = THIS_MODULE;
782 dasd_devices_entry = proc_create("devices",
783 S_IFREG | S_IRUGO | S_IWUSR,
784 dasd_proc_root_entry,
785 @@ -334,7 +333,6 @@ dasd_proc_init(void)
786 goto out_nostatistics;
787 dasd_statistics_entry->read_proc = dasd_statistics_read;
788 dasd_statistics_entry->write_proc = dasd_statistics_write;
789 - dasd_statistics_entry->owner = THIS_MODULE;
790 return 0;
792 out_nostatistics:
793 diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
794 index 099b545..b134813 100644
795 --- a/drivers/scsi/scsi_devinfo.c
796 +++ b/drivers/scsi/scsi_devinfo.c
797 @@ -596,8 +596,6 @@ int __init scsi_init_devinfo(void)
798 error = -ENOMEM;
799 goto out;
802 - p->owner = THIS_MODULE;
803 #endif /* CONFIG_SCSI_PROC_FS */
805 out:
806 diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
807 index 82f7b2d..77fbddb 100644
808 --- a/drivers/scsi/scsi_proc.c
809 +++ b/drivers/scsi/scsi_proc.c
810 @@ -115,8 +115,6 @@ void scsi_proc_hostdir_add(struct scsi_host_template *sht)
811 if (!sht->proc_dir)
812 printk(KERN_ERR "%s: proc_mkdir failed for %s\n",
813 __func__, sht->proc_name);
814 - else
815 - sht->proc_dir->owner = sht->module;
817 mutex_unlock(&global_host_template_mutex);
819 @@ -163,7 +161,6 @@ void scsi_proc_host_add(struct Scsi_Host *shost)
822 p->write_proc = proc_scsi_write_proc;
823 - p->owner = sht->module;
827 diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
828 index 37b433a..e327b84 100644
829 --- a/drivers/video/via/viafbdev.c
830 +++ b/drivers/video/via/viafbdev.c
831 @@ -2059,25 +2059,21 @@ static void viafb_init_proc(struct proc_dir_entry **viafb_entry)
832 if (viafb_entry) {
833 entry = create_proc_entry("dvp0", 0, *viafb_entry);
834 if (entry) {
835 - entry->owner = THIS_MODULE;
836 entry->read_proc = viafb_dvp0_proc_read;
837 entry->write_proc = viafb_dvp0_proc_write;
839 entry = create_proc_entry("dvp1", 0, *viafb_entry);
840 if (entry) {
841 - entry->owner = THIS_MODULE;
842 entry->read_proc = viafb_dvp1_proc_read;
843 entry->write_proc = viafb_dvp1_proc_write;
845 entry = create_proc_entry("dfph", 0, *viafb_entry);
846 if (entry) {
847 - entry->owner = THIS_MODULE;
848 entry->read_proc = viafb_dfph_proc_read;
849 entry->write_proc = viafb_dfph_proc_write;
851 entry = create_proc_entry("dfpl", 0, *viafb_entry);
852 if (entry) {
853 - entry->owner = THIS_MODULE;
854 entry->read_proc = viafb_dfpl_proc_read;
855 entry->write_proc = viafb_dfpl_proc_write;
857 @@ -2086,7 +2082,6 @@ static void viafb_init_proc(struct proc_dir_entry **viafb_entry)
858 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) {
859 entry = create_proc_entry("vt1636", 0, *viafb_entry);
860 if (entry) {
861 - entry->owner = THIS_MODULE;
862 entry->read_proc = viafb_vt1636_proc_read;
863 entry->write_proc = viafb_vt1636_proc_write;
865 diff --git a/fs/afs/proc.c b/fs/afs/proc.c
866 index 7578c1a..8630615 100644
867 --- a/fs/afs/proc.c
868 +++ b/fs/afs/proc.c
869 @@ -146,7 +146,6 @@ int afs_proc_init(void)
870 proc_afs = proc_mkdir("fs/afs", NULL);
871 if (!proc_afs)
872 goto error_dir;
873 - proc_afs->owner = THIS_MODULE;
875 p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops);
876 if (!p)
877 diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
878 index 877e4d9..7f19fef 100644
879 --- a/fs/cifs/cifs_debug.c
880 +++ b/fs/cifs/cifs_debug.c
881 @@ -404,7 +404,6 @@ cifs_proc_init(void)
882 if (proc_fs_cifs == NULL)
883 return;
885 - proc_fs_cifs->owner = THIS_MODULE;
886 proc_create("DebugData", 0, proc_fs_cifs, &cifs_debug_data_proc_fops);
888 #ifdef CONFIG_CIFS_STATS
889 diff --git a/fs/jfs/jfs_debug.c b/fs/jfs/jfs_debug.c
890 index 6a73de8..dd824d9 100644
891 --- a/fs/jfs/jfs_debug.c
892 +++ b/fs/jfs/jfs_debug.c
893 @@ -90,7 +90,6 @@ void jfs_proc_init(void)
895 if (!(base = proc_mkdir("fs/jfs", NULL)))
896 return;
897 - base->owner = THIS_MODULE;
899 for (i = 0; i < NPROCENT; i++)
900 proc_create(Entries[i].name, 0, base, Entries[i].proc_fops);
901 diff --git a/fs/nfs/client.c b/fs/nfs/client.c
902 index 574158a..2277421 100644
903 --- a/fs/nfs/client.c
904 +++ b/fs/nfs/client.c
905 @@ -1606,8 +1606,6 @@ int __init nfs_fs_proc_init(void)
906 if (!proc_fs_nfs)
907 goto error_0;
909 - proc_fs_nfs->owner = THIS_MODULE;
911 /* a file of servers with which we're dealing */
912 p = proc_create("servers", S_IFREG|S_IRUGO,
913 proc_fs_nfs, &nfs_server_list_fops);
914 diff --git a/fs/proc/inode.c b/fs/proc/inode.c
915 index e11dc22..d78ade3 100644
916 --- a/fs/proc/inode.c
917 +++ b/fs/proc/inode.c
918 @@ -58,11 +58,8 @@ static void proc_delete_inode(struct inode *inode)
920 /* Let go of any associated proc directory entry */
921 de = PROC_I(inode)->pde;
922 - if (de) {
923 - if (de->owner)
924 - module_put(de->owner);
925 + if (de)
926 de_put(de);
928 if (PROC_I(inode)->sysctl)
929 sysctl_head_put(PROC_I(inode)->sysctl);
930 clear_inode(inode);
931 @@ -449,12 +446,9 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
933 struct inode * inode;
935 - if (!try_module_get(de->owner))
936 - goto out_mod;
938 inode = iget_locked(sb, ino);
939 if (!inode)
940 - goto out_ino;
941 + return NULL;
942 if (inode->i_state & I_NEW) {
943 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
944 PROC_I(inode)->fd = 0;
945 @@ -485,16 +479,9 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
948 unlock_new_inode(inode);
949 - } else {
950 - module_put(de->owner);
951 + } else
952 de_put(de);
954 return inode;
956 -out_ino:
957 - module_put(de->owner);
958 -out_mod:
959 - return NULL;
962 int proc_fill_super(struct super_block *s)
963 diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
964 index d153946..4a9e0f6 100644
965 --- a/fs/proc/proc_tty.c
966 +++ b/fs/proc/proc_tty.c
967 @@ -152,7 +152,6 @@ void proc_tty_register_driver(struct tty_driver *driver)
968 if (!ent)
969 return;
970 ent->read_proc = driver->ops->read_proc;
971 - ent->owner = driver->owner;
972 ent->data = driver;
974 driver->proc_entry = ent;
975 diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
976 index d506640..9229e55 100644
977 --- a/fs/reiserfs/procfs.c
978 +++ b/fs/reiserfs/procfs.c
979 @@ -492,7 +492,6 @@ int reiserfs_proc_info_init(struct super_block *sb)
980 spin_lock_init(&__PINFO(sb).lock);
981 REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root);
982 if (REISERFS_SB(sb)->procdir) {
983 - REISERFS_SB(sb)->procdir->owner = THIS_MODULE;
984 REISERFS_SB(sb)->procdir->data = sb;
985 add_file(sb, "version", show_version);
986 add_file(sb, "super", show_super);
987 @@ -556,9 +555,7 @@ int reiserfs_proc_info_global_init(void)
989 if (proc_info_root == NULL) {
990 proc_info_root = proc_mkdir(proc_info_root_name, NULL);
991 - if (proc_info_root) {
992 - proc_info_root->owner = THIS_MODULE;
993 - } else {
994 + if (!proc_info_root) {
995 reiserfs_warning(NULL, "cannot create /proc/%s",
996 proc_info_root_name);
997 return 1;
998 diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
999 index 62b7366..f7c9c75 100644
1000 --- a/include/linux/ipmi_smi.h
1001 +++ b/include/linux/ipmi_smi.h
1002 @@ -230,6 +230,6 @@ static inline void ipmi_free_smi_msg(struct ipmi_smi_msg *msg)
1003 automatically be dstroyed when the interface is destroyed. */
1004 int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
1005 read_proc_t *read_proc,
1006 - void *data, struct module *owner);
1007 + void *data);
1009 #endif /* __LINUX_IPMI_SMI_H */
1010 diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
1011 index b8bdb96..fbfa3d4 100644
1012 --- a/include/linux/proc_fs.h
1013 +++ b/include/linux/proc_fs.h
1014 @@ -41,9 +41,6 @@ enum {
1015 * while parent/subdir create the directory structure (every
1016 * /proc file has a parent, but "subdir" is NULL for all
1017 * non-directory entries).
1019 - * "owner" is used to protect module
1020 - * from unloading while proc_dir_entry is in use
1023 typedef int (read_proc_t)(char *page, char **start, off_t off,
1024 @@ -70,7 +67,6 @@ struct proc_dir_entry {
1025 * somewhere.
1027 const struct file_operations *proc_fops;
1028 - struct module *owner;
1029 struct proc_dir_entry *next, *parent, *subdir;
1030 void *data;
1031 read_proc_t *read_proc;
1032 diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
1033 index 162199a..fd8e084 100644
1034 --- a/net/appletalk/atalk_proc.c
1035 +++ b/net/appletalk/atalk_proc.c
1036 @@ -281,7 +281,6 @@ int __init atalk_proc_init(void)
1037 atalk_proc_dir = proc_mkdir("atalk", init_net.proc_net);
1038 if (!atalk_proc_dir)
1039 goto out;
1040 - atalk_proc_dir->owner = THIS_MODULE;
1042 p = proc_create("interface", S_IRUGO, atalk_proc_dir,
1043 &atalk_seq_interface_fops);
1044 diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
1045 index 4990541..1a0f5cc 100644
1046 --- a/net/atm/mpoa_proc.c
1047 +++ b/net/atm/mpoa_proc.c
1048 @@ -281,7 +281,6 @@ int mpc_proc_init(void)
1049 printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME);
1050 return -ENOMEM;
1052 - p->owner = THIS_MODULE;
1053 return 0;
1056 diff --git a/net/atm/proc.c b/net/atm/proc.c
1057 index 49487b3..e7b3b27 100644
1058 --- a/net/atm/proc.c
1059 +++ b/net/atm/proc.c
1060 @@ -476,7 +476,6 @@ int __init atm_proc_init(void)
1061 atm_proc_root, e->proc_fops);
1062 if (!dirent)
1063 goto err_out_remove;
1064 - dirent->owner = THIS_MODULE;
1065 e->dirent = dirent;
1067 ret = 0;
1068 diff --git a/net/can/bcm.c b/net/can/bcm.c
1069 index b7c7d46..95d7f32 100644
1070 --- a/net/can/bcm.c
1071 +++ b/net/can/bcm.c
1072 @@ -1604,10 +1604,6 @@ static int __init bcm_module_init(void)
1074 /* create /proc/net/can-bcm directory */
1075 proc_dir = proc_mkdir("can-bcm", init_net.proc_net);
1077 - if (proc_dir)
1078 - proc_dir->owner = THIS_MODULE;
1080 return 0;
1083 diff --git a/net/can/proc.c b/net/can/proc.c
1084 index 520fef5..1463653 100644
1085 --- a/net/can/proc.c
1086 +++ b/net/can/proc.c
1087 @@ -473,8 +473,6 @@ void can_init_proc(void)
1088 return;
1091 - can_dir->owner = THIS_MODULE;
1093 /* own procfs entries from the AF_CAN core */
1094 pde_version = can_create_proc_readentry(CAN_PROC_VERSION, 0644,
1095 can_proc_read_version, NULL);
1096 diff --git a/net/core/pktgen.c b/net/core/pktgen.c
1097 index 32d419f..3779c14 100644
1098 --- a/net/core/pktgen.c
1099 +++ b/net/core/pktgen.c
1100 @@ -3806,7 +3806,6 @@ static int __init pg_init(void)
1101 pg_proc_dir = proc_mkdir(PG_PROC_DIR, init_net.proc_net);
1102 if (!pg_proc_dir)
1103 return -ENODEV;
1104 - pg_proc_dir->owner = THIS_MODULE;
1106 pe = proc_create(PGCTRL, 0600, pg_proc_dir, &pktgen_fops);
1107 if (pe == NULL) {
1108 diff --git a/net/irda/irproc.c b/net/irda/irproc.c
1109 index 88e80a3..8ff1861 100644
1110 --- a/net/irda/irproc.c
1111 +++ b/net/irda/irproc.c
1112 @@ -70,7 +70,6 @@ void __init irda_proc_register(void)
1113 proc_irda = proc_mkdir("irda", init_net.proc_net);
1114 if (proc_irda == NULL)
1115 return;
1116 - proc_irda->owner = THIS_MODULE;
1118 for (i = 0; i < ARRAY_SIZE(irda_dirs); i++)
1119 d = proc_create(irda_dirs[i].name, 0, proc_irda,
1120 diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
1121 index b58bd7c..d208b33 100644
1122 --- a/net/llc/llc_proc.c
1123 +++ b/net/llc/llc_proc.c
1124 @@ -236,7 +236,6 @@ int __init llc_proc_init(void)
1125 llc_proc_dir = proc_mkdir("llc", init_net.proc_net);
1126 if (!llc_proc_dir)
1127 goto out;
1128 - llc_proc_dir->owner = THIS_MODULE;
1130 p = proc_create("socket", S_IRUGO, llc_proc_dir, &llc_seq_socket_fops);
1131 if (!p)
1132 diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
1133 index cb198af..8eb3e61 100644
1134 --- a/net/sctp/protocol.c
1135 +++ b/net/sctp/protocol.c
1136 @@ -106,12 +106,8 @@ static __init int sctp_proc_init(void)
1137 goto out_nomem;
1138 #ifdef CONFIG_PROC_FS
1139 if (!proc_net_sctp) {
1140 - struct proc_dir_entry *ent;
1141 - ent = proc_mkdir("sctp", init_net.proc_net);
1142 - if (ent) {
1143 - ent->owner = THIS_MODULE;
1144 - proc_net_sctp = ent;
1145 - } else
1146 + proc_net_sctp = proc_mkdir("sctp", init_net.proc_net);
1147 + if (!proc_net_sctp)
1148 goto out_free_percpu;
1151 diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
1152 index 4735caa..20029a7 100644
1153 --- a/net/sunrpc/cache.c
1154 +++ b/net/sunrpc/cache.c
1155 @@ -313,7 +313,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
1156 cd->proc_ent = proc_mkdir(cd->name, proc_net_rpc);
1157 if (cd->proc_ent == NULL)
1158 goto out_nomem;
1159 - cd->proc_ent->owner = cd->owner;
1160 cd->channel_ent = cd->content_ent = NULL;
1162 p = proc_create_data("flush", S_IFREG|S_IRUSR|S_IWUSR,
1163 @@ -321,7 +320,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
1164 cd->flush_ent = p;
1165 if (p == NULL)
1166 goto out_nomem;
1167 - p->owner = cd->owner;
1169 if (cd->cache_request || cd->cache_parse) {
1170 p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
1171 @@ -329,7 +327,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
1172 cd->channel_ent = p;
1173 if (p == NULL)
1174 goto out_nomem;
1175 - p->owner = cd->owner;
1177 if (cd->cache_show) {
1178 p = proc_create_data("content", S_IFREG|S_IRUSR|S_IWUSR,
1179 @@ -337,7 +334,6 @@ static int create_cache_proc_entries(struct cache_detail *cd)
1180 cd->content_ent = p;
1181 if (p == NULL)
1182 goto out_nomem;
1183 - p->owner = cd->owner;
1185 return 0;
1186 out_nomem:
1187 diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
1188 index 085372e..1ef6e46 100644
1189 --- a/net/sunrpc/stats.c
1190 +++ b/net/sunrpc/stats.c
1191 @@ -262,14 +262,8 @@ void
1192 rpc_proc_init(void)
1194 dprintk("RPC: registering /proc/net/rpc\n");
1195 - if (!proc_net_rpc) {
1196 - struct proc_dir_entry *ent;
1197 - ent = proc_mkdir("rpc", init_net.proc_net);
1198 - if (ent) {
1199 - ent->owner = THIS_MODULE;
1200 - proc_net_rpc = ent;
1203 + if (!proc_net_rpc)
1204 + proc_net_rpc = proc_mkdir("rpc", init_net.proc_net);
1207 void
1208 diff --git a/sound/core/info.c b/sound/core/info.c
1209 index 70fa871..35df614 100644
1210 --- a/sound/core/info.c
1211 +++ b/sound/core/info.c
1212 @@ -154,11 +154,6 @@ EXPORT_SYMBOL(snd_seq_root);
1213 struct snd_info_entry *snd_oss_root;
1214 #endif
1216 -static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
1218 - de->owner = THIS_MODULE;
1221 static void snd_remove_proc_entry(struct proc_dir_entry *parent,
1222 struct proc_dir_entry *de)
1224 @@ -522,32 +517,11 @@ static const struct file_operations snd_info_entry_operations =
1225 .release = snd_info_entry_release,
1228 -/**
1229 - * snd_create_proc_entry - create a procfs entry
1230 - * @name: the name of the proc file
1231 - * @mode: the file permission bits, S_Ixxx
1232 - * @parent: the parent proc-directory entry
1234 - * Creates a new proc file entry with the given name and permission
1235 - * on the given directory.
1237 - * Returns the pointer of new instance or NULL on failure.
1238 - */
1239 -static struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode,
1240 - struct proc_dir_entry *parent)
1242 - struct proc_dir_entry *p;
1243 - p = create_proc_entry(name, mode, parent);
1244 - if (p)
1245 - snd_info_entry_prepare(p);
1246 - return p;
1249 int __init snd_info_init(void)
1251 struct proc_dir_entry *p;
1253 - p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL);
1254 + p = create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL);
1255 if (p == NULL)
1256 return -ENOMEM;
1257 snd_proc_root = p;
1258 @@ -974,12 +948,11 @@ int snd_info_register(struct snd_info_entry * entry)
1259 return -ENXIO;
1260 root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
1261 mutex_lock(&info_mutex);
1262 - p = snd_create_proc_entry(entry->name, entry->mode, root);
1263 + p = create_proc_entry(entry->name, entry->mode, root);
1264 if (!p) {
1265 mutex_unlock(&info_mutex);
1266 return -ENOMEM;
1268 - p->owner = entry->module;
1269 if (!S_ISDIR(entry->mode))
1270 p->proc_fops = &snd_info_entry_operations;
1271 p->size = entry->size;
1273 1.6.2.1