patch-2.1.75 linux/drivers/block/ide-disk.c

Next file: linux/drivers/block/ide-floppy.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.74/linux/drivers/block/ide-disk.c linux/drivers/block/ide-disk.c
@@ -467,7 +467,22 @@
 		drive->special.b.set_multmode = 1;
 }
 
+static int proc_idedisk_read_cache
+	(char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+	ide_drive_t	*drive = (ide_drive_t *) data;
+	char		*out = page;
+	int		len;
+
+	if (drive->id)
+		len = sprintf(out,"%i\n", drive->id->buf_size / 2);
+	else
+		len = sprintf(out,"(none)\n");
+	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
+}
+
 static ide_proc_entry_t idedisk_proc[] = {
+	{ "cache", proc_idedisk_read_cache, NULL },
 	{ "geometry", proc_ide_read_geometry, NULL },
 	{ NULL, NULL, NULL }
 };

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