patch-2.1.89 linux/drivers/block/ide-proc.c

Next file: linux/drivers/block/ide.c
Previous file: linux/drivers/block/floppy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.88/linux/drivers/block/ide-proc.c linux/drivers/block/ide-proc.c
@@ -613,8 +613,12 @@
 	if (!drive->proc || !p)
 		return;
 	while (p->name != NULL) {
-		ent = create_proc_entry(p->name, 0, drive->proc);
+		mode_t mode = S_IFREG|S_IRUSR;
+		if (!strcmp(p->name,"settings"))
+			mode |= S_IWUSR;
+		ent = create_proc_entry(p->name, mode, drive->proc);
 		if (!ent) return;
+		ent->nlink = 1;
 		ent->data = drive;
 		ent->read_proc = p->read_proc;
 		ent->write_proc = p->write_proc;
@@ -674,8 +678,9 @@
 		if (!hwif_ent) return;
 #ifdef CONFIG_PCI
 		if (!IDE_PCI_DEVID_EQ(hwif->pci_devid, IDE_PCI_DEVID_NULL)) {
-			ent = create_proc_entry("config", 0, hwif_ent);
+			ent = create_proc_entry("config", S_IFREG|S_IRUSR|S_IWUSR, hwif_ent);
 			if (!ent) return;
+			ent->nlink = 1;
 			ent->data = hwif;
 			ent->read_proc  = proc_ide_read_config;
 			ent->write_proc = proc_ide_write_config;;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov