[PATCH] create /proc/ide/hdX/capacity only once

Bartlomiej Zolnierkiewicz (B.Zolnierkiewicz@elka.pw.edu.pl)
Wed, 4 Jun 2003 00:36:41 +0200


Hi,
please apply.
--
Bartlomiej

[ide] create /proc/ide/hdX/capacity only once

In ide_register_subdriver() create drive->proc entries only if driver is not idedefault_driver.

[ There won't be /proc/ide/hdX/capacity for devices attached to idedefault_driver now, it reported 0x7fffffff previously. ]

Do not create drive->proc entries in create_proc_ide_drives(), they are added later in ide_register_subdriver().

drivers/ide/ide-proc.c | 8 +------- drivers/ide/ide.c | 6 ++++-- 2 files changed, 5 insertions(+), 9 deletions(-)

diff -puN drivers/ide/ide-proc.c~ide_proc_capacity_fix drivers/ide/ide-proc.c --- linux-2.5.70-bk8/drivers/ide/ide-proc.c~ide_proc_capacity_fix Tue Jun 3 23:07:51 2003 +++ linux-2.5.70-bk8-root/drivers/ide/ide-proc.c Tue Jun 3 23:13:49 2003 @@ -712,7 +712,6 @@ void create_proc_ide_drives(ide_hwif_t * for (d = 0; d < MAX_DRIVES; d++) { ide_drive_t *drive = &hwif->drives[d]; - ide_driver_t *driver = drive->driver; if (!drive->present) continue; @@ -720,13 +719,8 @@ void create_proc_ide_drives(ide_hwif_t * continue; drive->proc = proc_mkdir(drive->name, parent); - if (drive->proc) { + if (drive->proc) ide_add_proc_entries(drive->proc, generic_drive_entries, drive); - if (driver) { - ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive); - ide_add_proc_entries(drive->proc, driver->proc, drive); - } - } sprintf(name,"ide%d/%s", (drive->name[2]-'a')/2, drive->name); ent = proc_symlink(drive->name, proc_ide_root, name); if (!ent) return; diff -puN drivers/ide/ide.c~ide_proc_capacity_fix drivers/ide/ide.c --- linux-2.5.70-bk8/drivers/ide/ide.c~ide_proc_capacity_fix Tue Jun 3 23:07:53 2003 +++ linux-2.5.70-bk8-root/drivers/ide/ide.c Tue Jun 3 23:12:32 2003 @@ -2349,8 +2349,10 @@ int ide_register_subdriver (ide_drive_t } drive->suspend_reset = 0; #ifdef CONFIG_PROC_FS - ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive); - ide_add_proc_entries(drive->proc, driver->proc, drive); + if (drive->driver != &idedefault_driver) { + ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive); + ide_add_proc_entries(drive->proc, driver->proc, drive); + } #endif return 0; }

_

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/