include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / block / hd.c
index 961de56..034e6df 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/genhd.h>
-#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
@@ -100,8 +99,6 @@ static DEFINE_SPINLOCK(hd_lock);
 static struct request_queue *hd_queue;
 static struct request *hd_req;
 
-#define MAJOR_NR HD_MAJOR
-
 #define TIMEOUT_VALUE  (6*HZ)
 #define        HD_DELAY        0
 
@@ -694,7 +691,7 @@ static irqreturn_t hd_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct block_device_operations hd_fops = {
+static const struct block_device_operations hd_fops = {
        .getgeo =       hd_getgeo,
 };
 
@@ -712,19 +709,19 @@ static int __init hd_init(void)
 {
        int drive;
 
-       if (register_blkdev(MAJOR_NR, "hd"))
+       if (register_blkdev(HD_MAJOR, "hd"))
                return -1;
 
        hd_queue = blk_init_queue(do_hd_request, &hd_lock);
        if (!hd_queue) {
-               unregister_blkdev(MAJOR_NR, "hd");
+               unregister_blkdev(HD_MAJOR, "hd");
                return -ENOMEM;
        }
 
-       blk_queue_max_sectors(hd_queue, 255);
+       blk_queue_max_hw_sectors(hd_queue, 255);
        init_timer(&device_timer);
        device_timer.function = hd_times_out;
-       blk_queue_hardsect_size(hd_queue, 512);
+       blk_queue_logical_block_size(hd_queue, 512);
 
        if (!NR_HD) {
                /*
@@ -751,7 +748,7 @@ static int __init hd_init(void)
                struct hd_i_struct *p = &hd_info[drive];
                if (!disk)
                        goto Enomem;
-               disk->major = MAJOR_NR;
+               disk->major = HD_MAJOR;
                disk->first_minor = drive << 6;
                disk->fops = &hd_fops;
                sprintf(disk->disk_name, "hd%c", 'a'+drive);
@@ -795,7 +792,7 @@ out1:
        NR_HD = 0;
 out:
        del_timer(&device_timer);
-       unregister_blkdev(MAJOR_NR, "hd");
+       unregister_blkdev(HD_MAJOR, "hd");
        blk_cleanup_queue(hd_queue);
        return -1;
 Enomem: