patch-2.1.75 linux/drivers/block/ide-proc.c
Next file: linux/drivers/block/ide-tape.c
Previous file: linux/drivers/block/ide-probe.c
Back to the patch index
Back to the overall index
- Lines: 77
- Date:
Sun Dec 21 17:14:45 1997
- Orig file:
v2.1.74/linux/drivers/block/ide-proc.c
- Orig date:
Fri Dec 19 15:52:57 1997
diff -u --recursive --new-file v2.1.74/linux/drivers/block/ide-proc.c linux/drivers/block/ide-proc.c
@@ -50,23 +50,6 @@
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
-/*
- * Standard exit stuff:
- */
-#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) \
-{ \
- len -= off; \
- if (len < count) { \
- *eof = 1; \
- if (len <= 0) \
- return 0; \
- } else \
- len = count; \
- *start = page + off; \
- return len; \
-}
-
-
#ifdef CONFIG_PCI
static int ide_getxdigit(char c)
@@ -129,8 +112,9 @@
cli(); /* ensure all PCI writes are done together */
while (((ide_hwgroup_t *)(hwif->hwgroup))->active || (hwif->mate && ((ide_hwgroup_t *)(hwif->mate->hwgroup))->active)) {
sti();
- if (0 < (signed long)(timeout - jiffies)) {
+ if (0 < (signed long)(jiffies - timeout)) {
printk("/proc/ide/%s/pci: channel(s) busy, cannot write\n", hwif->name);
+ restore_flags(flags);
return -EBUSY;
}
cli();
@@ -311,6 +295,8 @@
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
ide_drive_t *drive = (ide_drive_t *) data;
+ int major = HWIF(drive)->major;
+ int minor = drive->select.b.unit << PARTN_BITS;
char *out = page;
int len;
@@ -321,6 +307,9 @@
out += sprintf(out,"nowerr %i\n", drive->bad_wstat == BAD_R_STAT);
out += sprintf(out,"keepsettings %i\n", drive->keep_settings);
out += sprintf(out,"nice %i/%i/%i\n", drive->nice0, drive->nice1, drive->nice2);
+ out += sprintf(out,"dsc_overlap %i\n", drive->dsc_overlap);
+ out += sprintf(out,"max_sectors %i\n", max_sectors[major][minor]);
+ out += sprintf(out,"readahead %i\n", max_readahead[major][minor] / 1024);
len = out - page;
PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}
@@ -329,9 +318,13 @@
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
ide_drive_t *drive = (ide_drive_t *) data;
+ ide_driver_t *driver = (ide_driver_t *) drive->driver;
int len;
- len = sprintf(page,"%li\n", ((ide_driver_t *)drive->driver)->capacity(drive));
+ if (!driver)
+ len = sprintf(page, "(none)\n");
+ else
+ len = sprintf(page,"%li\n", ((ide_driver_t *)drive->driver)->capacity(drive));
PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}
@@ -399,7 +392,6 @@
static ide_proc_entry_t generic_drive_entries[] = {
- { "capacity", proc_ide_read_capacity, NULL },
{ "driver", proc_ide_read_driver, NULL },
{ "identify", proc_ide_read_identify, NULL },
{ "media", proc_ide_read_media, NULL },
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov