Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86044
b: refs/heads/master
c: 597592d
h: refs/heads/master
v: v3
  • Loading branch information
Ian Campbell authored and Linus Torvalds committed Feb 22, 2008
1 parent 71294d4 commit aa87530
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f151e8b214c1df3f571020b849382933f2cdce7
refs/heads/master: 597592d951cdca8e5edb29f7e8174f633a69685a
18 changes: 18 additions & 0 deletions trunk/drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include <linux/interrupt.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/module.h>

#include <xen/xenbus.h>
Expand Down Expand Up @@ -135,6 +136,22 @@ static void blkif_restart_queue_callback(void *arg)
schedule_work(&info->work);
}

int blkif_getgeo(struct block_device *bd, struct hd_geometry *hg)
{
/* We don't have real geometry info, but let's at least return
values consistent with the size of the device */
sector_t nsect = get_capacity(bd->bd_disk);
sector_t cylinders = nsect;

hg->heads = 0xff;
hg->sectors = 0x3f;
sector_div(cylinders, hg->heads * hg->sectors);
hg->cylinders = cylinders;
if ((sector_t)(hg->cylinders + 1) * hg->heads * hg->sectors < nsect)
hg->cylinders = 0xffff;
return 0;
}

/*
* blkif_queue_request
*
Expand Down Expand Up @@ -937,6 +954,7 @@ static struct block_device_operations xlvbd_block_fops =
.owner = THIS_MODULE,
.open = blkif_open,
.release = blkif_release,
.getgeo = blkif_getgeo,
};


Expand Down

0 comments on commit aa87530

Please sign in to comment.