]> git.hungrycats.org Git - linux/commitdiff
[PATCH] blk_init() cleanups
authorAndrew Morton <akpm@digeo.com>
Thu, 19 Sep 2002 15:37:12 +0000 (08:37 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 19 Sep 2002 15:37:12 +0000 (08:37 -0700)
From Christoph Hellwig, acked by Jens.

- remove some unneeded runtime initializers.

- remove the explicit call to hd_init() - it already goes through
module_init(), so we're currently running hd_init() twice.

drivers/block/ll_rw_blk.c
drivers/ide/legacy/hd.c

index e95f7f0808f904048c98e78a9e1e89d1a0ddda6c..8823ca0f25b090d741f76ea335834e28e6f39ebd 100644 (file)
@@ -53,7 +53,7 @@ static kmem_cache_t *request_cachep;
 /*
  * plug management
  */
-static struct list_head blk_plug_list;
+static LIST_HEAD(blk_plug_list);
 static spinlock_t blk_plug_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 /* blk_dev_struct is:
@@ -2041,27 +2041,16 @@ void end_that_request_last(struct request *req)
        blk_put_request(req);
 }
 
-#define MB(kb) ((kb) << 10)
-
 int __init blk_dev_init(void)
 {
-       struct blk_dev_struct *dev;
-       int total_ram;
+       int total_ram = nr_free_pages() << (PAGE_SHIFT - 10);
 
        request_cachep = kmem_cache_create("blkdev_requests",
-                                          sizeof(struct request),
-                                          0, SLAB_HWCACHE_ALIGN, NULL, NULL);
-
+                       sizeof(struct request), 0,
+                       SLAB_HWCACHE_ALIGN, NULL, NULL);
        if (!request_cachep)
                panic("Can't create request pool slab cache\n");
 
-       for (dev = blk_dev + MAX_BLKDEV; dev-- != blk_dev;)
-               dev->queue = NULL;
-
-       memset(ro_bits,0,sizeof(ro_bits));
-
-       total_ram = nr_free_pages() << (PAGE_SHIFT - 10);
-
        /*
         * Free request slots per queue.
         * (Half for reads, half for writes)
@@ -2077,17 +2066,12 @@ int __init blk_dev_init(void)
         */
        if ((batch_requests = queue_nr_requests / 4) > 32)
                batch_requests = 32;
-       printk("block: %d slots per queue, batch=%d\n", queue_nr_requests, batch_requests);
+       printk("block: %d slots per queue, batch=%d\n",
+                       queue_nr_requests, batch_requests);
 
        blk_max_low_pfn = max_low_pfn;
        blk_max_pfn = max_pfn;
 
-       INIT_LIST_HEAD(&blk_plug_list);
-
-#if defined(CONFIG_IDE) && defined(CONFIG_BLK_DEV_HD)
-       hd_init();
-#endif
-
        return 0;
 };
 
index c0c042c1ddf10dadba00b4d35088adb99849f997..24c598563bd40ec72b7f5f53a4ceabdabee33044 100644 (file)
@@ -846,7 +846,7 @@ static void __init hd_geninit(void)
        }
 }
 
-int __init hd_init(void)
+static int __init hd_init(void)
 {
        if (register_blkdev(MAJOR_NR,"hd",&hd_fops)) {
                printk("hd: unable to get major %d for hard disk\n",MAJOR_NR);