diff -ur linux-2.4.0-test6/drivers/char/sysrq.c linux/drivers/char/sysrq.c --- linux-2.4.0-test6/drivers/char/sysrq.c Tue Aug 1 04:36:10 2000 +++ linux/drivers/char/sysrq.c Sun Aug 13 03:45:49 2000 @@ -6,6 +6,11 @@ * * (c) 1997 Martin Mares * based on ideas by Pavel Machek + * + * 13-Aug-2000 Modified by Jan Dvorak + * + * is_local_disk() is now macro, and depends on + * */ #include @@ -157,28 +162,8 @@ /* Aux routines for the syncer */ -static int is_local_disk(kdev_t dev) /* Guess if the device is a local hard drive */ -{ - unsigned int major = MAJOR(dev); - - switch (major) { - case IDE0_MAJOR: - case IDE1_MAJOR: - case IDE2_MAJOR: - case IDE3_MAJOR: - case SCSI_DISK0_MAJOR: - case SCSI_DISK1_MAJOR: - case SCSI_DISK2_MAJOR: - case SCSI_DISK3_MAJOR: - case SCSI_DISK4_MAJOR: - case SCSI_DISK5_MAJOR: - case SCSI_DISK6_MAJOR: - case SCSI_DISK7_MAJOR: - return 1; - default: - return 0; - } -} +#define is_local_disk(dev) \ + (scsi_blk_major(MAJOR(dev)) || ide_blk_major(MAJOR(dev))) static void go_sync(struct super_block *sb, int remount_flag) { diff -ur linux-2.4.0-test6/include/linux/major.h linux/include/linux/major.h --- linux-2.4.0-test6/include/linux/major.h Mon Jun 19 22:42:43 2000 +++ linux/include/linux/major.h Fri Aug 11 00:59:56 2000 @@ -156,4 +156,20 @@ return SCSI_BLK_MAJOR(m); } +/* + * Test for IDE devices. + */ + +#define IDE_BLK_MAJOR(M) ((M) == IDE0_MAJOR || \ + (M) == IDE1_MAJOR || \ + (M) == IDE2_MAJOR || \ + (M) == IDE3_MAJOR || \ + (M) == IDE4_MAJOR || \ + (M) == IDE5_MAJOR || \ + ((M) >= IDE6_MAJOR && (M) <= IDE9_MAJOR)) + +static __inline__ int ide_blk_major(int m) { + return IDE_BLK_MAJOR(m); +} + #endif