diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-24 00:12:35 +0000 |
commit | 482368b1a8e45430672c58c9a42e7d2004367126 (patch) | |
tree | ce2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /fs/block_dev.c | |
parent | e4d0251c6f56ab2e191afb70f80f382793e23f74 (diff) |
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index b451332ed..b5d665c29 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -10,6 +10,7 @@ #include <linux/fcntl.h> #include <linux/malloc.h> #include <linux/kmod.h> +#include <linux/devfs_fs_kernel.h> #include <asm/uaccess.h> @@ -454,7 +455,7 @@ int get_blkdev_list(char * p) Return the function table of a device. Load the driver if needed. */ -static const struct block_device_operations * get_blkfops(unsigned int major) +const struct block_device_operations * get_blkfops(unsigned int major) { const struct block_device_operations *ret = NULL; @@ -518,11 +519,20 @@ int unregister_blkdev(unsigned int major, const char * name) int check_disk_change(kdev_t dev) { int i; - const struct block_device_operations * bdops; + const struct block_device_operations * bdops = NULL; struct super_block * sb; i = MAJOR(dev); - if (i >= MAX_BLKDEV || (bdops = blkdevs[i].bdops) == NULL) + if (i < MAX_BLKDEV) + bdops = blkdevs[i].bdops; + if (bdops == NULL) { + devfs_handle_t de; + + de = devfs_find_handle (NULL, NULL, 0, i, MINOR (dev), + DEVFS_SPECIAL_BLK, 0); + if (de) bdops = devfs_get_ops (de); + } + if (bdops == NULL) return 0; if (bdops->check_media_change == NULL) return 0; |