]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] blk_dev[] is gone
authorAlexander Viro <viro@math.psu.edu>
Mon, 28 Oct 2002 10:50:17 +0000 (02:50 -0800)
committerJames Bottomley <jejb@mulgrave.(none)>
Mon, 28 Oct 2002 10:50:17 +0000 (02:50 -0800)
* remove blk_dev[]
* removed BLK_DEFAULT_QUEUE
* moved definition of CURRENT into drivers that used it
* removed definition of QUEUE from headers

16 files changed:
drivers/acorn/block/fd1772.c
drivers/acorn/block/mfmhd.c
drivers/block/acsi.c
drivers/block/amiflop.c
drivers/block/ataflop.c
drivers/block/ll_rw_blk.c
drivers/block/swim_iop.c
drivers/cdrom/aztcd.c
drivers/cdrom/mcd.c
drivers/cdrom/optcd.c
drivers/cdrom/sjcd.c
drivers/ide/legacy/hd.c
fs/block_dev.c
include/linux/blk.h
include/linux/blkdev.h
kernel/ksyms.c

index 3c0ae2ebb5a9ef2a20753ad51f7e94f55859c8ff..fa4d8e389195c02cbbf3908409f66894f7f0129f 100644 (file)
 #include <asm/uaccess.h>
 
 
-#define MAJOR_NR FLOPPY_MAJOR
-#define FLOPPY_DMA 0
-#define DEVICE_NAME "floppy"
-#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
-#define QUEUE (&floppy_queue)
 #include <linux/blk.h>
 
 /* Note: FD_MAX_UNITS could be redefined to 2 for the Atari (with
 
 static struct request_queue floppy_queue;
 
+#define MAJOR_NR FLOPPY_MAJOR
+#define FLOPPY_DMA 0
+#define DEVICE_NAME "floppy"
+#define QUEUE (&floppy_queue)
+#define CURRENT elv_next_request(&floppy_queue)
+
 /* Disk types: DD */
 static struct archy_disk_type {
        const char *name;
index 7b1c3b13fb3fbed8251b18ed1bc1860fc8b2f5cc..bd2294d8d4de65a9dbe25c891c9cf926d119d4ac 100644 (file)
 #include <linux/major.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-
-#define MAJOR_NR       MFM_ACORN_MAJOR
-#define QUEUE (&mfm_queue)
 #include <linux/blk.h>
 #include <linux/blkpg.h>
 
 static void (*do_mfm)(void) = NULL;
 static struct request_queue mfm_queue;
 static spinlock_t mfm_lock = SPIN_LOCK_UNLOCKED;
+
+#define MAJOR_NR       MFM_ACORN_MAJOR
+#define QUEUE (&mfm_queue)
+#define CURRENT elv_next_request(&mfm_queue)
 /*
  * This sort of stuff should be in a header file shared with ide.c, hd.c, xd.c etc
  */
index 8b3daa5771c659f56c76b94cb87a3705006d9c14..6b38660da44906c4b33999b5ad871dadcd1bbb31 100644 (file)
@@ -58,7 +58,6 @@
 #include <linux/delay.h>
 #include <linux/mm.h>
 #include <linux/major.h>
-#define QUEUE (&acsi_queue)
 #include <linux/blk.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -81,6 +80,8 @@ typedef void Scsi_Device; /* hack to avoid including scsi.h */
 
 static void (*do_acsi)(void) = NULL;
 static struct request_queue acsi_queue;
+#define QUEUE (&acsi_queue)
+#define CURRENT elv_next_request(&acsi_queue)
 
 #define DEBUG
 #undef DEBUG_DETECT
index c6481047ae646d6a999c197491e49d0f151c3bff..9bca3a354307c981671032f7aa1dc0044a2e80ff 100644 (file)
 #include <asm/amigahw.h>
 #include <asm/amigaints.h>
 #include <asm/irq.h>
-
-#define MAJOR_NR FLOPPY_MAJOR
-#define DEVICE_NAME "floppy"
-#define QUEUE (&floppy_queue)
 #include <linux/blk.h>
 
 #undef DEBUG /* print _LOTS_ of infos */
@@ -125,6 +121,11 @@ MODULE_LICENSE("GPL");
 
 static struct request_queue floppy_queue;
 
+#define MAJOR_NR FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define QUEUE (&floppy_queue)
+#define CURRENT elv_next_request(&floppy_queue)
+
 /*
  *  Macros
  */
index 897fa52e2f610bcbb439010faf782e07da4e60f3..d43cc6fbdcee39974ab5c79692b0cc8e6ccfe71f 100644 (file)
 #include <asm/atariints.h>
 #include <asm/atari_stdma.h>
 #include <asm/atari_stram.h>
-
-#define MAJOR_NR FLOPPY_MAJOR
-#define DEVICE_NAME "floppy"
-#define QUEUE (&floppy_queue)
 #include <linux/blk.h>
 #include <linux/blkpg.h>
 
 
 static struct request_queue floppy_queue;
 
+#define MAJOR_NR FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define QUEUE (&floppy_queue)
+#define CURRENT elv_next_request(&floppy_queue)
+
 /* Disk types: DD, HD, ED */
 static struct atari_disk_type {
        const char      *name;
index 639f1f0c3b36e5229c377f8f9aa0e74a3e101e00..0492d2df4d1e40f819646a4846b05ef2feeea319 100644 (file)
@@ -39,12 +39,6 @@ static kmem_cache_t *request_cachep;
 static LIST_HEAD(blk_plug_list);
 static spinlock_t blk_plug_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
-/* blk_dev_struct is:
- *     request_queue
- *     *queue
- */
-struct blk_dev_struct blk_dev[MAX_BLKDEV]; /* initialized by blk_dev_init() */
-
 /*
  * Number of requests per queue.  This many for reads and for writes (twice
  * this number, total).
@@ -138,22 +132,6 @@ void io_schedule_timeout(long timeout)
        atomic_dec(&nr_iowait_tasks);
 }
 
-/**
- * bdev_get_queue: - return the queue that matches the given device
- * @bdev:    device
- *
- * Description:
- *     Given a specific device, return the queue that will hold I/O
- *     for it. This is either a &struct blk_dev_struct lookup and a
- *     call to the ->queue() function defined, or the default queue
- *     stored in the same location.
- *
- **/
-inline request_queue_t *bdev_get_queue(struct block_device *bdev)
-{
-       return bdev->bd_queue;
-}
-
 /**
  * blk_get_backing_dev_info - get the address of a queue's backing_dev_info
  * @dev:       device
@@ -2186,7 +2164,6 @@ EXPORT_SYMBOL(end_that_request_first);
 EXPORT_SYMBOL(end_that_request_chunk);
 EXPORT_SYMBOL(end_that_request_last);
 EXPORT_SYMBOL(blk_init_queue);
-EXPORT_SYMBOL(bdev_get_queue);
 EXPORT_SYMBOL(blk_cleanup_queue);
 EXPORT_SYMBOL(blk_queue_make_request);
 EXPORT_SYMBOL(blk_queue_bounce_limit);
index fdc9567d60a0c65005fa6de808e1e1ed57ace4e6..1e4a72c75217c81aca274381ba87ab569ea535c0 100644 (file)
  * be sent.
  */
 
-/* This has to be defined before some of the #includes below */
-
-#define MAJOR_NR  FLOPPY_MAJOR
-#define DEVICE_NAME "floppy"
-#define QUEUE (&swim_queue)
-
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -84,6 +78,11 @@ static int floppy_count;
 static struct floppy_state floppy_states[MAX_FLOPPIES];
 static spinlock_t swim_iop_lock = SPIN_LOCK_UNLOCKED;
 
+#define MAJOR_NR  FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define QUEUE (&swim_queue)
+#define CURRENT elv_next_request(&swim_queue)
+
 static char *drive_names[7] = {
        "not installed",        /* DRV_NONE    */
        "unknown (1)",          /* DRV_UNKNOWN */
index 93745b274ceeb4fa3b4400313aa39097731ddbab..c284304c7c79c513168599795cd76c2ca65a376c 100644 (file)
 */
 
 #include <linux/version.h>
-
-#define MAJOR_NR AZTECH_CDROM_MAJOR
-#define QUEUE (&azt_queue)
 #include <linux/blk.h>
 #include "aztcd.h"
 
   Defines
   ###########################################################################
 */
+
+#define MAJOR_NR AZTECH_CDROM_MAJOR
+#define QUEUE (&azt_queue)
+#define CURRENT elv_next_request(&azt_queue)
 #define SET_TIMER(func, jifs)   delay_timer.expires = jiffies + (jifs); \
                                 delay_timer.function = (void *) (func); \
                                 add_timer(&delay_timer);
index a12e6c63d2a4b0f120dc4c735933b1d2dc788e51..865c6f3a7b51ac038dd341253a1c176418bb379b 100644 (file)
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-
-#define MAJOR_NR MITSUMI_CDROM_MAJOR
-#define QUEUE (&mcd_queue)
 #include <linux/blk.h>
 
 #define mcd_port mcd           /* for compatible parameter passing with "insmod" */
@@ -118,6 +115,10 @@ static int mcd1xhold;
 static int mcdPresent;
 static struct request_queue mcd_queue;
 
+#define MAJOR_NR MITSUMI_CDROM_MAJOR
+#define QUEUE (&mcd_queue)
+#define CURRENT elv_next_request(&mcd_queue)
+
 #define QUICK_LOOP_DELAY udelay(45)    /* use udelay */
 #define QUICK_LOOP_COUNT 20
 
index 01e2cff57400698929a9c8db06b2c064040de87c..5b65c8e612b8fb9b19666f28d0ca3d5e3cb425b3 100644 (file)
@@ -74,9 +74,6 @@
 #include <linux/devfs_fs_kernel.h>
 
 #include <asm/io.h>
-
-#define MAJOR_NR OPTICS_CDROM_MAJOR
-#define QUEUE (&opt_queue)
 #include <linux/blk.h>
 
 #include <linux/cdrom.h>
 
 #include <asm/uaccess.h>
 
+#define MAJOR_NR OPTICS_CDROM_MAJOR
+#define QUEUE (&opt_queue)
+#define CURRENT elv_next_request(&opt_queue)
+
 \f
 /* Debug support */
 
index 58f111663d85d8a0745eafd3a730db092ea6c9b2..feb2c700f2a59d28b7133df310e95403e5227088 100644 (file)
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-
-#define MAJOR_NR SANYO_CDROM_MAJOR
-#define QUEUE (&sjcd_queue)
 #include <linux/blk.h>
 #include "sjcd.h"
 
 static int sjcd_present = 0;
 static struct request_queue sjcd_queue;
 
+#define MAJOR_NR SANYO_CDROM_MAJOR
+#define QUEUE (&sjcd_queue)
+#define CURRENT elv_next_request(&sjcd_queue)
+
 #define SJCD_BUF_SIZ 32                /* cdr-h94a has internal 64K buffer */
 
 /*
index 513bd56c625db6f151538ee6b2513a3cbba90499..8f9a6b78dd036f442cfadb9c528c2447c237ef8c 100644 (file)
@@ -45,9 +45,6 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-
-#define MAJOR_NR HD_MAJOR
-#define QUEUE (&hd_queue)
 #include <linux/blk.h>
 
 #ifdef __arm__
 static spinlock_t hd_lock = SPIN_LOCK_UNLOCKED;
 static struct request_queue hd_queue;
 
+#define MAJOR_NR HD_MAJOR
+#define QUEUE (&hd_queue)
+#define CURRENT elv_next_request(&hd_queue)
+
 #define TIMEOUT_VALUE  (6*HZ)
 #define        HD_DELAY        0
 
@@ -117,8 +118,6 @@ static void bad_rw_intr(void);
 static int reset;
 static int hd_error;
 
-#define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0)
-
 /*
  *  This struct defines the HD's and their types.
  */
index ae93c51febd5cd7d347b52a57abb0cec4c9e9257..8a6ea8554d0d5ea82addbdecd91c4671031760f3 100644 (file)
@@ -634,17 +634,9 @@ static int do_open(struct block_device *bdev, struct inode *inode, struct file *
                }
        }
        if (bdev->bd_contains == bdev) {
-               if (!bdev->bd_openers)
+               if (!bdev->bd_openers) {
                        bdev->bd_disk = disk;
-               if (!bdev->bd_queue) {
-                       if (disk->queue)
-                               bdev->bd_queue = disk->queue;
-                       else {
-                               struct blk_dev_struct *p = blk_dev + major(dev);
-                               bdev->bd_queue = &p->request_queue;
-                               if (p->queue)
-                                       bdev->bd_queue =  p->queue(dev);
-                       }
+                       bdev->bd_queue = disk->queue;
                }
                if (bdev->bd_op->open) {
                        ret = bdev->bd_op->open(inode, file);
index 6f47ea7c853c89a84e2922b14394886544fdfd00..03f75158a2a54a1ed1c9afc40689f387d02f462d 100644 (file)
@@ -53,19 +53,6 @@ static inline void blkdev_dequeue_request(struct request *req)
                elv_remove_request(req->q, req);
 }
 
-#if defined(MAJOR_NR) || defined(IDE_DRIVER)
-#if (MAJOR_NR != SCSI_TAPE_MAJOR) && (MAJOR_NR != OSST_MAJOR)
-#if !defined(IDE_DRIVER)
-
-#ifndef QUEUE
-# define QUEUE (&blk_dev[MAJOR_NR].request_queue)
-#endif
-#ifndef CURRENT
-# define CURRENT elv_next_request(QUEUE)
-#endif
-
-#endif /* !defined(IDE_DRIVER) */
-
 /*
  * If we have our own end_request, we do not want to include this mess
  */
@@ -80,7 +67,5 @@ static inline void end_request(struct request *req, int uptodate)
        end_that_request_last(req);
 }
 #endif /* !LOCAL_END_REQUEST */
-#endif /* (MAJOR_NR != SCSI_TAPE_MAJOR) */
-#endif /* defined(MAJOR_NR) || defined(IDE_DRIVER) */
 
 #endif /* _BLK_H */
index 722ebb04e25c30ff7fd5995268093045b077e3a2..5aa09c66484f24c7651fb81f422adeca19b6a30d 100644 (file)
@@ -287,33 +287,13 @@ inline void blk_queue_bounce(request_queue_t *q, struct bio **bio);
        if ((rq->bio))                  \
                for (bio = (rq)->bio; bio; bio = bio->bi_next)
 
-struct blk_dev_struct {
-       /*
-        * queue_proc has to be atomic
-        */
-       request_queue_t         request_queue;
-       queue_proc              *queue;
-       void                    *data;
-};
-
 struct sec_size {
        unsigned block_size;
        unsigned block_size_bits;
 };
 
-/*
- * Used to indicate the default queue for drivers that don't bother
- * to implement multiple queues.  We have this access macro here
- * so as to eliminate the need for each and every block device
- * driver to know about the internal structure of blk_dev[].
- */
-#define BLK_DEFAULT_QUEUE(_MAJOR)  &blk_dev[_MAJOR].request_queue
-
-extern struct sec_size * blk_sec[MAX_BLKDEV];
-extern struct blk_dev_struct blk_dev[MAX_BLKDEV];
 extern void register_disk(struct gendisk *dev);
 extern void generic_make_request(struct bio *bio);
-extern inline request_queue_t *bdev_get_queue(struct block_device *bdev);
 extern void blk_put_request(struct request *);
 extern void blk_attempt_remerge(request_queue_t *, struct request *);
 extern void __blk_attempt_remerge(request_queue_t *, struct request *);
@@ -331,6 +311,11 @@ extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void __blk_stop_queue(request_queue_t *q);
 
+static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
+{
+       return bdev->bd_queue;
+}
+
 /*
  * get ready for proper ref counting
  */
index 941d5f9eec9d715d4b4e13bf8e812e5851e1cbe3..2d94628a41c282c01909503f6d1977a3b82edca6 100644 (file)
@@ -341,7 +341,6 @@ EXPORT_SYMBOL(tty_unregister_driver);
 EXPORT_SYMBOL(tty_std_termios);
 
 /* block device driver support */
-EXPORT_SYMBOL(blk_dev);
 EXPORT_SYMBOL(bdev_read_only);
 EXPORT_SYMBOL(set_device_ro);
 EXPORT_SYMBOL(bmap);