aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-02-23 23:38:20 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-23 23:38:20 -0500
commit8d3c202be23c5a915f7053ebd4e96f44700c6a62 (patch)
treee0f017aff86d3ad0b858fe85f44e11096087ed00 /drivers/block
parent1b04ab4597725f75f94942da9aa40daa7b9a4bd9 (diff)
parent038eb0ea04b245351be34b0ae76b55eee4603989 (diff)
Merge branch 'master' of ../linux-2.6/
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nbd.c6
-rw-r--r--drivers/block/swim3.c4
-rw-r--r--drivers/block/xen-blkfront.c18
3 files changed, 24 insertions, 4 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 018753c59b8e..b53fdb0a282c 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -655,6 +655,7 @@ static int __init nbd_init(void)
655 655
656 for (i = 0; i < nbds_max; i++) { 656 for (i = 0; i < nbds_max; i++) {
657 struct gendisk *disk = alloc_disk(1); 657 struct gendisk *disk = alloc_disk(1);
658 elevator_t *old_e;
658 if (!disk) 659 if (!disk)
659 goto out; 660 goto out;
660 nbd_dev[i].disk = disk; 661 nbd_dev[i].disk = disk;
@@ -668,6 +669,11 @@ static int __init nbd_init(void)
668 put_disk(disk); 669 put_disk(disk);
669 goto out; 670 goto out;
670 } 671 }
672 old_e = disk->queue->elevator;
673 if (elevator_init(disk->queue, "deadline") == 0 ||
674 elevator_init(disk->queue, "noop") == 0) {
675 elevator_exit(old_e);
676 }
671 } 677 }
672 678
673 if (register_blkdev(NBD_MAJOR, "nbd")) { 679 if (register_blkdev(NBD_MAJOR, "nbd")) {
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index b4e462f154ea..730ccea78e45 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -251,10 +251,6 @@ static int floppy_release(struct inode *inode, struct file *filp);
251static int floppy_check_change(struct gendisk *disk); 251static int floppy_check_change(struct gendisk *disk);
252static int floppy_revalidate(struct gendisk *disk); 252static int floppy_revalidate(struct gendisk *disk);
253 253
254#ifndef CONFIG_PMAC_MEDIABAY
255#define check_media_bay(which, what) 1
256#endif
257
258static void swim3_select(struct floppy_state *fs, int sel) 254static void swim3_select(struct floppy_state *fs, int sel)
259{ 255{
260 struct swim3 __iomem *sw = fs->swim3; 256 struct swim3 __iomem *sw = fs->swim3;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 8afce67c0aa5..9c6f3f99208d 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -37,6 +37,7 @@
37 37
38#include <linux/interrupt.h> 38#include <linux/interrupt.h>
39#include <linux/blkdev.h> 39#include <linux/blkdev.h>
40#include <linux/hdreg.h>
40#include <linux/module.h> 41#include <linux/module.h>
41 42
42#include <xen/xenbus.h> 43#include <xen/xenbus.h>
@@ -135,6 +136,22 @@ static void blkif_restart_queue_callback(void *arg)
135 schedule_work(&info->work); 136 schedule_work(&info->work);
136} 137}
137 138
139int blkif_getgeo(struct block_device *bd, struct hd_geometry *hg)
140{
141 /* We don't have real geometry info, but let's at least return
142 values consistent with the size of the device */
143 sector_t nsect = get_capacity(bd->bd_disk);
144 sector_t cylinders = nsect;
145
146 hg->heads = 0xff;
147 hg->sectors = 0x3f;
148 sector_div(cylinders, hg->heads * hg->sectors);
149 hg->cylinders = cylinders;
150 if ((sector_t)(hg->cylinders + 1) * hg->heads * hg->sectors < nsect)
151 hg->cylinders = 0xffff;
152 return 0;
153}
154
138/* 155/*
139 * blkif_queue_request 156 * blkif_queue_request
140 * 157 *
@@ -937,6 +954,7 @@ static struct block_device_operations xlvbd_block_fops =
937 .owner = THIS_MODULE, 954 .owner = THIS_MODULE,
938 .open = blkif_open, 955 .open = blkif_open,
939 .release = blkif_release, 956 .release = blkif_release,
957 .getgeo = blkif_getgeo,
940}; 958};
941 959
942 960