diff -urN linux-2.4.7/Documentation/Configure.help linux/Documentation/Configure.help --- linux-2.4.7/Documentation/Configure.help Thu Jul 19 18:48:15 2001 +++ linux/Documentation/Configure.help Wed Aug 1 23:39:13 2001 @@ -5410,6 +5410,17 @@ located on a SCSI disk. In this case, do not compile the driver for your SCSI host adapter (below) as a module either. +Many SCSI Discs support +CONFIG_SD_MANY + This allows you to support a very large number of SCSI discs + (approximately 2144). You will also need to set CONFIG_DEVFS_FS=y + later. This option may consume all unassigned block majors + (i.e. those which do not have an allocation in + Documentation/devices.txt). Enabling this will consume a few extra + kilobytes of kernel memory. + + Unless you have a large storage array, say N. + Extra SCSI Disks CONFIG_SD_EXTRA_DEVS This controls the amount of additional space allocated in tables for diff -urN linux-2.4.7/Documentation/filesystems/devfs/ChangeLog linux/Documentation/filesystems/devfs/ChangeLog --- linux-2.4.7/Documentation/filesystems/devfs/ChangeLog Wed Jul 11 15:55:41 2001 +++ linux/Documentation/filesystems/devfs/ChangeLog Wed Aug 1 23:43:54 2001 @@ -1675,3 +1675,21 @@ - Fixed number leak for /dev/cdroms/cdrom%d - Fixed number leak for /dev/discs/disc%d +=============================================================================== +Changes for patch v183 + +- Fixed bug in which could hang boot process +=============================================================================== +Changes for patch v184 + +- Support large numbers of SCSI discs (~2144) + +- Documentation typo fix for fs/devfs/util.c + +- Fixed drivers/char/stallion.c for devfs + +- Added DEVFSD_NOTIFY_DELETE event + +- Updated README from master HTML file + +- Removed #include from fs/devfs/base.c diff -urN linux-2.4.7/Documentation/filesystems/devfs/README linux/Documentation/filesystems/devfs/README --- linux-2.4.7/Documentation/filesystems/devfs/README Tue Jun 12 11:57:46 2001 +++ linux/Documentation/filesystems/devfs/README Wed Aug 1 23:39:13 2001 @@ -3,7 +3,7 @@ Linux Devfs (Device File System) FAQ Richard Gooch -26-APR-2001 +30-JUL-2001 ----------------------------------------------------------------------------- @@ -18,11 +18,6 @@ http://www.atnf.csiro.au/~rgooch/linux/ -NEWSFLASH: The official 2.3.46 kernel has -included the devfs patch. Future patches will be released which -build on this. These patches are rolled into Linus' tree from time to -time. - A mailing list is available which you may subscribe to. Send email to majordomo@oss.sgi.com with the following line in the @@ -71,6 +66,8 @@ Other resources +Translations of this document + ----------------------------------------------------------------------------- @@ -82,7 +79,7 @@ name rather than major and minor numbers. These devices will appear in devfs automatically, with whatever default ownership and protection the driver specified. A daemon (devfsd) can be used to -override these defaults. +override these defaults. Devfs has been in the kernel since 2.3.46. NOTE that devfs is entirely optional. If you prefer the old disc-based device nodes, then simply leave CONFIG_DEVFS_FS=n (the @@ -604,6 +601,20 @@ has problems with symbolic links. Append the following lines to your /etc/securetty file: +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 + +This will not weaken security. If you have a version of util-linux +earlier than 2.10.h, please upgrade to 2.10.h or later. If you +absolutely cannot upgrade, then also append the following lines to +your /etc/securetty file: + 1 2 3 @@ -618,27 +629,13 @@ are problems with dealing with symlinks, I'm suspicious of the level of security offered in any case. -A better solution is to install util-linux-2.10.h or later, which -fixes a bug with ttyname handling in the login programme. Then append -the following lines to your /etc/securetty file: - -vc/1 -vc/2 -vc/3 -vc/4 -vc/5 -vc/6 -vc/7 -vc/8 - -This will not weaken security. - XFree86 While not essential, it's probably a good idea to upgrade to XFree86 4.0, as patches went in to make it more devfs-friendly. If you don't, you'll probably need to apply the following patch to /etc/security/console.perms so that ordinary users can run -startx. +startx. Note that not all distributions have this file (e.g. Debian), +so if it's not present, don't worry about it. --- /etc/security/console.perms.orig Sat Apr 17 16:26:47 1999 +++ /etc/security/console.perms Fri Feb 25 23:53:55 2000 @@ -1038,6 +1035,13 @@ directory tree that reflects the topology of available devices. The topological tree is useful for finding how your devices are arranged. +Below is a list of the naming schemes for the most common drivers. A +list of reserved device names is +available for reference. Please send email to +rgooch@atnf.csiro.au to obtain an allocation. Please be +patient (the maintainer is busy). An alternative name may be allocated +instead of the requested name, at the discretion of the maintainer. + Disc Devices All discs, whether SCSI, IDE or whatever, are placed under the @@ -1713,6 +1717,23 @@ 2nd Annual Storage Management Workshop held in Miamia, Florida, U.S.A. in October 2000. + + + + +----------------------------------------------------------------------------- + + +Translations of this document + +This document has been translated into other languages. + + + + +A Korean translation by viatoris@nownuri.net is available at + +http://home.nownuri.net/~viatoris/devfs/devfs.html diff -urN linux-2.4.7/drivers/char/stallion.c linux/drivers/char/stallion.c --- linux-2.4.7/drivers/char/stallion.c Fri Mar 2 12:12:07 2001 +++ linux/drivers/char/stallion.c Wed Aug 1 23:39:13 2001 @@ -139,8 +139,13 @@ static char *stl_drvtitle = "Stallion Multiport Serial Driver"; static char *stl_drvname = "stallion"; static char *stl_drvversion = "5.6.0"; +#ifdef CONFIG_DEVFS_FS +static char *stl_serialname = "ttyE/%d"; +static char *stl_calloutname = "cue/%d"; +#else static char *stl_serialname = "ttyE"; static char *stl_calloutname = "cue"; +#endif static struct tty_driver stl_serial; static struct tty_driver stl_callout; diff -urN linux-2.4.7/drivers/scsi/Config.in linux/drivers/scsi/Config.in --- linux-2.4.7/drivers/scsi/Config.in Thu Jul 5 12:28:16 2001 +++ linux/drivers/scsi/Config.in Wed Aug 1 23:39:13 2001 @@ -3,7 +3,8 @@ dep_tristate ' SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI if [ "$CONFIG_BLK_DEV_SD" != "n" ]; then - int 'Maximum number of SCSI disks that can be loaded as modules' CONFIG_SD_EXTRA_DEVS 40 + bool ' Many (~2144) SCSI discs support (requires devfs)' CONFIG_SD_MANY + int ' Maximum number of SCSI disks that can be loaded as modules' CONFIG_SD_EXTRA_DEVS 40 fi dep_tristate ' SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI diff -urN linux-2.4.7/drivers/scsi/hosts.h linux/drivers/scsi/hosts.h --- linux-2.4.7/drivers/scsi/hosts.h Sun Jul 22 21:07:13 2001 +++ linux/drivers/scsi/hosts.h Thu Aug 2 23:06:53 2001 @@ -506,9 +506,8 @@ const char * tag; struct module * module; /* Used for loadable modules */ unsigned char scsi_type; - unsigned int major; - unsigned int min_major; /* Minimum major in range. */ - unsigned int max_major; /* Maximum major in range. */ + unsigned int *majors; /* Array of majors used by driver */ + unsigned int num_majors; /* Number of majors used by driver */ unsigned int nr_dev; /* Number currently attached */ unsigned int dev_noticed; /* Number of devices detected. */ unsigned int dev_max; /* Current size of arrays */ diff -urN linux-2.4.7/drivers/scsi/osst.c linux/drivers/scsi/osst.c --- linux-2.4.7/drivers/scsi/osst.c Thu Jul 19 22:18:15 2001 +++ linux/drivers/scsi/osst.c Wed Aug 1 23:39:13 2001 @@ -160,7 +160,6 @@ name: "OnStream tape", tag: "osst", scsi_type: TYPE_TAPE, - major: OSST_MAJOR, detect: osst_detect, init: osst_init, attach: osst_attach, diff -urN linux-2.4.7/drivers/scsi/scsi_lib.c linux/drivers/scsi/scsi_lib.c --- linux-2.4.7/drivers/scsi/scsi_lib.c Thu Jul 19 21:48:04 2001 +++ linux/drivers/scsi/scsi_lib.c Wed Aug 1 23:39:13 2001 @@ -769,25 +769,10 @@ * Search for a block device driver that supports this * major. */ - if (spnt->blk && spnt->major == major) { - return spnt; - } - /* - * I am still not entirely satisfied with this solution, - * but it is good enough for now. Disks have a number of - * major numbers associated with them, the primary - * 8, which we test above, and a secondary range of 7 - * different consecutive major numbers. If this ever - * becomes insufficient, then we could add another function - * to the structure, and generalize this completely. - */ - if( spnt->min_major != 0 - && spnt->max_major != 0 - && major >= spnt->min_major - && major <= spnt->max_major ) - { - return spnt; - } + int i; + if (!spnt->blk || !spnt->majors) continue; + for (i = 0; i < spnt->num_majors; ++i) + if (spnt->majors[i] == major) return spnt; } return NULL; } diff -urN linux-2.4.7/drivers/scsi/sd.c linux/drivers/scsi/sd.c --- linux-2.4.7/drivers/scsi/sd.c Thu Jul 5 12:28:17 2001 +++ linux/drivers/scsi/sd.c Thu Aug 2 23:21:23 2001 @@ -28,6 +28,8 @@ * * Modified by Alex Davis * Fix problem where removable media could be ejected after sd_open. + * + * Modified by Richard Gooch rgooch@atnf.csiro.au to support >128 discs. */ #include @@ -65,7 +67,7 @@ * static const char RCSid[] = "$Header:"; */ -#define SD_MAJOR(i) (!(i) ? SCSI_DISK0_MAJOR : SCSI_DISK1_MAJOR-1+(i)) +#define SD_MAJOR(i) sd_template.majors[(i)] #define SCSI_DISKS_PER_MAJOR 16 #define SD_MAJOR_NUMBER(i) SD_MAJOR((i) >> 8) @@ -108,12 +110,6 @@ name:"disk", tag:"sd", scsi_type:TYPE_DISK, - major:SCSI_DISK0_MAJOR, - /* - * Secondary range of majors that this driver handles. - */ - min_major:SCSI_DISK1_MAJOR, - max_major:SCSI_DISK7_MAJOR, blk:1, detect:sd_detect, init:sd_init, @@ -123,6 +119,19 @@ init_command:sd_init_command, }; +#ifdef CONFIG_SD_MANY +static inline int sd_devnum_to_index (int devnum) +{ + int i, major = MAJOR (devnum); + + for (i = 0; i < sd_template.num_majors; ++i) + { + if (sd_template.majors[i] != major) continue; + return (i << 4) | (MINOR (devnum) >> 4); + } + return -ENODEV; +} +#endif static void rw_intr(Scsi_Cmnd * SCpnt); @@ -1043,6 +1052,47 @@ return i; } +static int sd_alloc_majors (void) +/* Allocate as many majors as required + */ +{ + int i, major; + + printk ("DEBUG1: dev_max: %d n_used_majors: %d\n", + sd_template.dev_max, N_USED_SD_MAJORS); + if ( ( sd_template.majors = + kmalloc (sizeof *sd_template.majors * N_USED_SD_MAJORS, + GFP_KERNEL) ) == NULL ) { + printk ("sd.c: unable to allocate major array\n"); + return -ENOMEM; + } + sd_template.majors[0] = SCSI_DISK0_MAJOR; + for (i = 1; (i < N_USED_SD_MAJORS) && (i = N_SD_PREASSIGNED_MAJORS) && (i < N_USED_SD_MAJORS); ++i) { + if ( ( major = devfs_alloc_major (DEVFS_SPECIAL_BLK) ) < 0 ) { + printk (KERN_WARNING __FUNCTION__ "() major[%d] allocation failed\n", i); + break; + } + sd_template.majors[i] = major; + } + sd_template.dev_max = i * SCSI_DISKS_PER_MAJOR; + sd_template.num_majors = i; + printk ("DEBUG2: dev_max: %d n_used_majors: %d num_majors: %d\n", + sd_template.dev_max, N_USED_SD_MAJORS, i); + return 0; +} /* End Function sd_alloc_majors */ + +static void sd_dealloc_majors (void) +/* Deallocate all the allocated majors + */ +{ + int i; + + for (i = sd_template.num_majors - 1; i >= N_SD_PREASSIGNED_MAJORS; --i) + devfs_dealloc_major (DEVFS_SPECIAL_BLK, sd_template.majors[i]); +} /* End Function sd_dealloc_majors */ + /* * The sd_init() function looks at all SCSI drives present, determines * their size, and reads partition table entries for them. @@ -1057,16 +1107,20 @@ if (sd_template.dev_noticed == 0) return 0; - if (!rscsi_disks) + if (!rscsi_disks) { + if ( in_interrupt () ) { + printk (__FUNCTION__ "(): called from interrupt\n"); + return 1; + } sd_template.dev_max = sd_template.dev_noticed + SD_EXTRA_DEVS; - - if (sd_template.dev_max > N_SD_MAJORS * SCSI_DISKS_PER_MAJOR) - sd_template.dev_max = N_SD_MAJORS * SCSI_DISKS_PER_MAJOR; + if ( sd_alloc_majors() ) return 1; + } if (!sd_registered) { for (i = 0; i < N_USED_SD_MAJORS; i++) { if (devfs_register_blkdev(SD_MAJOR(i), "sd", &sd_fops)) { printk("Unable to get major %d for SCSI disk\n", SD_MAJOR(i)); + sd_dealloc_majors(); return 1; } } @@ -1076,22 +1130,22 @@ if (rscsi_disks) return 0; - rscsi_disks = kmalloc(sd_template.dev_max * sizeof(Scsi_Disk), GFP_ATOMIC); + rscsi_disks = vmalloc(sd_template.dev_max * sizeof(Scsi_Disk)); if (!rscsi_disks) goto cleanup_devfs; memset(rscsi_disks, 0, sd_template.dev_max * sizeof(Scsi_Disk)); /* for every (necessary) major: */ - sd_sizes = kmalloc((sd_template.dev_max << 4) * sizeof(int), GFP_ATOMIC); + sd_sizes = vmalloc((sd_template.dev_max << 4) * sizeof(int)); if (!sd_sizes) goto cleanup_disks; memset(sd_sizes, 0, (sd_template.dev_max << 4) * sizeof(int)); - sd_blocksizes = kmalloc((sd_template.dev_max << 4) * sizeof(int), GFP_ATOMIC); + sd_blocksizes = vmalloc((sd_template.dev_max << 4) * sizeof(int)); if (!sd_blocksizes) goto cleanup_sizes; - sd_hardsizes = kmalloc((sd_template.dev_max << 4) * sizeof(int), GFP_ATOMIC); + sd_hardsizes = vmalloc((sd_template.dev_max << 4) * sizeof(int)); if (!sd_hardsizes) goto cleanup_blocksizes; @@ -1104,9 +1158,7 @@ blksize_size[SD_MAJOR(i)] = sd_blocksizes + i * (SCSI_DISKS_PER_MAJOR << 4); hardsect_size[SD_MAJOR(i)] = sd_hardsizes + i * (SCSI_DISKS_PER_MAJOR << 4); } - sd = kmalloc((sd_template.dev_max << 4) * - sizeof(struct hd_struct), - GFP_ATOMIC); + sd = vmalloc((sd_template.dev_max << 4) * sizeof(struct hd_struct)); if (!sd) goto cleanup_sd; memset(sd, 0, (sd_template.dev_max << 4) * sizeof(struct hd_struct)); @@ -1153,19 +1205,20 @@ } kfree(sd_gendisks); cleanup_sd_gendisks: - kfree(sd); + vfree(sd); cleanup_sd: - kfree(sd_hardsizes); + vfree(sd_hardsizes); cleanup_blocksizes: - kfree(sd_blocksizes); + vfree(sd_blocksizes); cleanup_sizes: - kfree(sd_sizes); + vfree(sd_sizes); cleanup_disks: - kfree(rscsi_disks); + vfree(rscsi_disks); cleanup_devfs: for (i = 0; i < N_USED_SD_MAJORS; i++) { devfs_unregister_blkdev(SD_MAJOR(i), "sd"); } + sd_dealloc_majors(); sd_registered--; return 1; } @@ -1373,6 +1426,7 @@ scsi_unregister_module(MODULE_SCSI_DEV, &sd_template); + sd_dealloc_majors(); for (i = 0; i < N_USED_SD_MAJORS; i++) devfs_unregister_blkdev(SD_MAJOR(i), "sd"); diff -urN linux-2.4.7/drivers/scsi/sd.h linux/drivers/scsi/sd.h --- linux-2.4.7/drivers/scsi/sd.h Sun Jul 22 21:07:13 2001 +++ linux/drivers/scsi/sd.h Thu Aug 2 23:06:57 2001 @@ -42,10 +42,14 @@ */ extern kdev_t sd_find_target(void *host, int tgt); -#define N_SD_MAJORS 8 +#define N_SD_PREASSIGNED_MAJORS 8 +#ifdef CONFIG_SD_MANY +#define SD_PARTITION(i) ((sd_devnum_to_index((i)) << 4) | ((i)&0x0f)) +#else #define SD_MAJOR_MASK (N_SD_MAJORS - 1) #define SD_PARTITION(i) (((MAJOR(i) & SD_MAJOR_MASK) << 8) | (MINOR(i) & 255)) +#endif #endif diff -urN linux-2.4.7/drivers/scsi/sg.c linux/drivers/scsi/sg.c --- linux-2.4.7/drivers/scsi/sg.c Wed Jul 4 16:39:28 2001 +++ linux/drivers/scsi/sg.c Wed Aug 1 23:39:13 2001 @@ -123,7 +123,6 @@ { tag:"sg", scsi_type:0xff, - major:SCSI_GENERIC_MAJOR, detect:sg_detect, init:sg_init, finish:sg_finish, diff -urN linux-2.4.7/drivers/scsi/sr.c linux/drivers/scsi/sr.c --- linux-2.4.7/drivers/scsi/sr.c Thu Jul 5 12:28:17 2001 +++ linux/drivers/scsi/sr.c Wed Aug 1 23:39:13 2001 @@ -69,12 +69,15 @@ static int sr_init_command(Scsi_Cmnd *); +static unsigned int sr_major = SCSI_CDROM_MAJOR; + static struct Scsi_Device_Template sr_template = { name:"cdrom", tag:"sr", scsi_type:TYPE_ROM, - major:SCSI_CDROM_MAJOR, + majors:&sr_major, + num_majors:1, blk:1, detect:sr_detect, init:sr_init, diff -urN linux-2.4.7/drivers/scsi/st.c linux/drivers/scsi/st.c --- linux-2.4.7/drivers/scsi/st.c Thu Jul 19 22:16:32 2001 +++ linux/drivers/scsi/st.c Wed Aug 1 23:39:13 2001 @@ -160,7 +160,6 @@ name:"tape", tag:"st", scsi_type:TYPE_TAPE, - major:SCSI_TAPE_MAJOR, detect:st_detect, init:st_init, attach:st_attach, diff -urN linux-2.4.7/fs/devfs/base.c linux/fs/devfs/base.c --- linux-2.4.7/fs/devfs/base.c Wed Jul 11 15:55:41 2001 +++ linux/fs/devfs/base.c Wed Aug 1 23:43:29 2001 @@ -511,6 +511,14 @@ Removed broken devnum allocation and use . Fixed old devnum leak by calling new . v0.107 + 20010712 Richard Gooch + Fixed bug in which could hang boot process. + v0.108 + 20010730 Richard Gooch + Added DEVFSD_NOTIFY_DELETE event. + 20010801 Richard Gooch + Removed #include . + v0.109 */ #include #include @@ -539,11 +547,10 @@ #include #include #include -#include #include #include -#define DEVFS_VERSION "0.107 (20010709)" +#define DEVFS_VERSION "0.109 (20010801)" #define DEVFS_NAME "devfs" @@ -1342,12 +1349,12 @@ return NULL; } } - de->u.fcb.autogen = 0; + de->u.fcb.autogen = FALSE; if ( S_ISCHR (mode) || S_ISBLK (mode) ) { de->u.fcb.u.device.major = major; de->u.fcb.u.device.minor = minor; - de->u.fcb.autogen = (devnum == NODEV) ? 0 : 1; + de->u.fcb.autogen = (devnum == NODEV) ? FALSE : TRUE; } else if ( S_ISREG (mode) ) de->u.fcb.u.file.size = 0; else @@ -1418,7 +1425,7 @@ MKDEV (de->u.fcb.u.device.major, de->u.fcb.u.device.minor) ); } - de->u.fcb.autogen = 0; + de->u.fcb.autogen = FALSE; return; } if (S_ISLNK (de->mode) && de->registered) @@ -2063,6 +2070,7 @@ {"show", OPTION_SHOW, &boot_options}, {"only", OPTION_ONLY, &boot_options}, {"mount", OPTION_MOUNT, &boot_options}, + {NULL, 0, NULL} }; while ( (*str != '\0') && !isspace (*str) ) @@ -2074,7 +2082,7 @@ invert = 1; str += 2; } - for (i = 0; i < sizeof (devfs_options_tab); i++) + for (i = 0; devfs_options_tab[i].name != NULL; i++) { int len = strlen (devfs_options_tab[i].name); @@ -2823,6 +2831,7 @@ static int devfs_unlink (struct inode *dir, struct dentry *dentry) { struct devfs_entry *de; + struct inode *inode = dentry->d_inode; #ifdef CONFIG_DEVFS_DEBUG char txt[STRING_LENGTH]; @@ -2838,6 +2847,8 @@ de = get_devfs_entry_from_vfs_inode (dentry->d_inode, TRUE); if (de == NULL) return -ENOENT; + devfsd_notify_one (de, DEVFSD_NOTIFY_DELETE, inode->i_mode, + inode->i_uid, inode->i_gid, dir->i_sb->u.generic_sbp); de->registered = FALSE; de->hide = TRUE; if ( S_ISLNK (de->mode) ) kfree (de->u.symlink.linkname); @@ -2954,6 +2965,8 @@ } } if (has_children) return -ENOTEMPTY; + devfsd_notify_one (de, DEVFSD_NOTIFY_DELETE, inode->i_mode, + inode->i_uid, inode->i_gid, fs_info); de->hide = TRUE; de->registered = FALSE; free_dentries (de); diff -urN linux-2.4.7/fs/devfs/util.c linux/fs/devfs/util.c --- linux-2.4.7/fs/devfs/util.c Wed Jul 11 15:55:41 2001 +++ linux/fs/devfs/util.c Wed Aug 1 23:39:13 2001 @@ -39,6 +39,8 @@ Created and . 20010710 Richard Gooch Created . + 20010730 Richard Gooch + Documentation typo fix. */ #include #include @@ -214,7 +216,7 @@ /** * devfs_alloc_major - Allocate a major number. - * @type: The type of the major (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLOCK) + * @type: The type of the major (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK) * Returns the allocated major, else -1 if none are available. * This routine is thread safe and does not block. @@ -238,7 +240,7 @@ /** * devfs_dealloc_major - Deallocate a major number. - * @type: The type of the major (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLOCK) + * @type: The type of the major (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK) * @major: The major number. * This routine is thread safe and does not block. */ @@ -282,7 +284,7 @@ /** * devfs_alloc_devnum - Allocate a device number. - * @type: The type (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLOCK). + * @type: The type (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK). * * Returns the allocated device number, else NODEV if none are available. * This routine is thread safe and may block. @@ -347,7 +349,7 @@ /** * devfs_dealloc_devnum - Dellocate a device number. - * @type: The type (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLOCK). + * @type: The type (DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK). * @devnum: The device number. * * This routine is thread safe and does not block. diff -urN linux-2.4.7/include/linux/blk.h linux/include/linux/blk.h --- linux-2.4.7/include/linux/blk.h Thu Aug 2 21:50:20 2001 +++ linux/include/linux/blk.h Thu Aug 2 23:05:41 2001 @@ -144,7 +144,11 @@ #define DEVICE_NAME "scsidisk" #define TIMEOUT_VALUE (2*HZ) +#ifdef CONFIG_SD_MANY +#define DEVICE_NR(device) sd_devnum_to_index((device)) +#else #define DEVICE_NR(device) (((MAJOR(device) & SD_MAJOR_MASK) << (8 - 4)) + (MINOR(device) >> 4)) +#endif /* Kludge to use the same number for both char and block major numbers */ #elif (MAJOR_NR == MD_MAJOR) && defined(MD_DRIVER) diff -urN linux-2.4.7/include/linux/devfs_fs.h linux/include/linux/devfs_fs.h --- linux-2.4.7/include/linux/devfs_fs.h Wed Feb 16 16:42:06 2000 +++ linux/include/linux/devfs_fs.h Wed Aug 1 23:39:13 2001 @@ -20,6 +20,7 @@ #define DEVFSD_NOTIFY_LOOKUP 4 #define DEVFSD_NOTIFY_CHANGE 5 #define DEVFSD_NOTIFY_CREATE 6 +#define DEVFSD_NOTIFY_DELETE 7 #define DEVFS_PATHLEN 1024 /* Never change this otherwise the binary interface will change */