Displaying 20 results from an estimated 81 matches for "hd_geometry".
2009 Sep 12
1
[PATCH] Let MEMDISK honor the quiet append option
...;
const char *p;
- printf("command line: %s\n", shdr->cmdline);
+ if (!quiet)
+ printf("command line: %s\n", shdr->cmdline);
offset = 0;
if (CMD_HASDATA(p = getcmditem("offset")) && (v = atou(p)))
@@ -627,14 +630,16 @@
hd_geometry.type = 0x10; /* ATAPI floppy, e.g. LS-120 */
}
- if ((size - hd_geometry.offset) & 0x1ff) {
- puts("MEMDISK: Image has fractional end sector\n");
- }
- if (sectors % (hd_geometry.h * hd_geometry.s)) {
- puts("MEMDISK: Image seems to have fractional end cy...
2008 Feb 22
1
[2.6 patch] make xen-blkfront.c:blkif_getgeo() static
...nt.c b/drivers/block/xen-blkfront.c
index 9c6f3f9..ae7ee16 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -136,7 +136,7 @@ static void blkif_restart_queue_callback(void *arg)
schedule_work(&info->work);
}
-int blkif_getgeo(struct block_device *bd, struct hd_geometry *hg)
+static 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 */
_______________________________________________
Xen-devel mailing list
Xen-dev...
2019 Dec 11
4
[PATCH 15/24] compat_ioctl: scsi: move ioctl handling into drivers
...04 deletions(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 7ffd719d89de..fbbf18ac1d5d 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -405,6 +405,9 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
>
> static const struct block_device_operations virtblk_fops = {
> .ioctl = virtblk_ioctl,
> +#ifdef CONFIG_COMPAT
> + .compat_ioctl = blkdev_compat_ptr_ioctl,
> +#endif
> .owner = THIS_MODULE,
> .getgeo = virtblk_getgeo,
> };
Hmm - is virtio blk lumped...
2019 Dec 11
4
[PATCH 15/24] compat_ioctl: scsi: move ioctl handling into drivers
...04 deletions(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 7ffd719d89de..fbbf18ac1d5d 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -405,6 +405,9 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
>
> static const struct block_device_operations virtblk_fops = {
> .ioctl = virtblk_ioctl,
> +#ifdef CONFIG_COMPAT
> + .compat_ioctl = blkdev_compat_ptr_ioctl,
> +#endif
> .owner = THIS_MODULE,
> .getgeo = virtblk_getgeo,
> };
Hmm - is virtio blk lumped...
2011 Jul 16
1
crash in extlinux/main
...in Lunix it crashed on me with a segment fault.
The bug is here:
if (!ioctl(devfd, HDIO_GETGEO, &geo)) {
Since we are already called with geo as a pointer the & is wrong as the
pointer itself will be overwritten.
This works:
int get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo)
{
struct floppy_struct fd_str;
struct loop_info li;
struct loop_info64 li64;
const struct geometry_table *gp;
int rv = 0;
memset(geo, 0, sizeof *geo);
if (!ioctl(devfd, HDIO_GETGEO, geo)) {
goto ok;
If someone can incorporate this in a future version I...
2020 Apr 23
4
[PATCH] virtio-blk: handle block_device_operations callbacks after hot unplug
...c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 93468b7c6701..b50cdf37a6f7 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -300,6 +300,10 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
struct virtio_blk *vblk = bd->bd_disk->private_data;
+ /* Driver instance has been removed */
+ if (!vblk)
+ return -ENOTTY;
+
/* see if the host passed in geometry config */
if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) {
virtio_cread(vblk->vdev, struc...
2020 Apr 23
4
[PATCH] virtio-blk: handle block_device_operations callbacks after hot unplug
...c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 93468b7c6701..b50cdf37a6f7 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -300,6 +300,10 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
struct virtio_blk *vblk = bd->bd_disk->private_data;
+ /* Driver instance has been removed */
+ if (!vblk)
+ return -ENOTTY;
+
/* see if the host passed in geometry config */
if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) {
virtio_cread(vblk->vdev, struc...
2020 Apr 28
2
[PATCH v2] virtio-blk: handle block_device_operations callbacks after hot unplug
...turn ret;
+}
+
+static void virtblk_release(struct gendisk *disk, fmode_t mode)
+{
+ struct virtio_blk *vblk = disk->private_data;
+
+ virtblk_put(vblk);
+}
+
/* We provide getgeo only to please some old bootloader/partitioning tools */
static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int ret = -ENXIO;
+
+ mutex_lock(&vblk->remove_mutex);
+
+ if (!vblk->vdev) {
+ goto out;
+ }
/* see if the host passed in geometry config */
if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) {
@@ -...
2020 Apr 28
2
[PATCH v2] virtio-blk: handle block_device_operations callbacks after hot unplug
...turn ret;
+}
+
+static void virtblk_release(struct gendisk *disk, fmode_t mode)
+{
+ struct virtio_blk *vblk = disk->private_data;
+
+ virtblk_put(vblk);
+}
+
/* We provide getgeo only to please some old bootloader/partitioning tools */
static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int ret = -ENXIO;
+
+ mutex_lock(&vblk->remove_mutex);
+
+ if (!vblk->vdev) {
+ goto out;
+ }
/* see if the host passed in geometry config */
if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) {
@@ -...
2012 Aug 02
0
[PATCH 1/3] ALPHA: make sector size dynamic in extlinux
...p;size))
+ return size;
+ return SECTOR_SIZE;
+}
+
+/*
* Get device geometry and partition offset
*/
struct geometry_table {
@@ -145,7 +157,7 @@ static const struct geometry_table standard_geometries[] = {
{0, {0, 0, 0, 0}}
};
-int get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo)
+static int get_geometry(int devfd, uint64_t totalbytes, unsigned sector_size, struct hd_geometry *geo)
{
struct floppy_struct fd_str;
struct loop_info li;
@@ -179,7 +191,7 @@ int get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo)
geo->heads = opt.heads...
2008 Jan 23
1
[PATCH] virtio_blk: provide getgeo
.../drivers/block/virtio_blk.c
+++ kvm/drivers/block/virtio_blk.c
@@ -154,9 +154,20 @@ static int virtblk_ioctl(struct inode *i
(void __user *)data);
}
+/* We provide getgeo only to please some old bootloader/partitioning tools */
+static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
+{
+ /* some standard values, similar to sd */
+ geo->heads = 1 << 6;
+ geo->sectors = 1 << 5;
+ geo->cylinders = get_capacity(bd->bd_disk) >> 11;
+ return 0;
+}
+
static struct block_device_operations virtblk_fops = {
- .ioctl = virtblk_ioctl,
- .owner = THIS_M...
2008 Jan 23
1
[PATCH] virtio_blk: provide getgeo
.../drivers/block/virtio_blk.c
+++ kvm/drivers/block/virtio_blk.c
@@ -154,9 +154,20 @@ static int virtblk_ioctl(struct inode *i
(void __user *)data);
}
+/* We provide getgeo only to please some old bootloader/partitioning tools */
+static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
+{
+ /* some standard values, similar to sd */
+ geo->heads = 1 << 6;
+ geo->sectors = 1 << 5;
+ geo->cylinders = get_capacity(bd->bd_disk) >> 11;
+ return 0;
+}
+
static struct block_device_operations virtblk_fops = {
- .ioctl = virtblk_ioctl,
- .owner = THIS_M...
2020 Apr 28
1
[PATCH v2] virtio-blk: handle block_device_operations callbacks after hot unplug
...> > +{
> > + struct virtio_blk *vblk = disk->private_data;
> > +
> > + virtblk_put(vblk);
> > +}
> > +
> > /* We provide getgeo only to please some old bootloader/partitioning tools */
> > static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
> > {
> > struct virtio_blk *vblk = bd->bd_disk->private_data;
> > + int ret = -ENXIO;
>
> It's more common to do
>
> int ret = 0;
>
> and on error:
> ret = -ENXIO;
>
>
> let's do this.
Will fix.
>
> > +
>...
2009 Nov 20
0
[PATCH] memdisk: Use boot_lba logic for booting an offset within the di
...uint16_t sector_size; /* Sector size in bytes (512 vs. 2048) */
@@ -451,6 +452,9 @@ static const struct geometry
*get_disk_image_geometry(uint32_t where,
/* If we have an emulation mode, set the offset to the image */
if (boot_cat->initial_entry.media_type)
hd_geometry.offset += boot_cat->initial_entry.load_block * 2048;
+ else
+ /* We're a no-emulation mode, so we will boot to an offset */
+ hd_geometry.boot_lba = boot_cat->initial_entry.load_block * 4;
if (boot_cat->initial_entry.media_type < 4) {
/*...
2020 Apr 29
2
[PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug
...turn ret;
+}
+
+static void virtblk_release(struct gendisk *disk, fmode_t mode)
+{
+ struct virtio_blk *vblk = disk->private_data;
+
+ virtblk_put(vblk);
+}
+
/* We provide getgeo only to please some old bootloader/partitioning tools */
static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int ret = 0;
+
+ mutex_lock(&vblk->vdev_mutex);
+
+ if (!vblk->vdev) {
+ ret = -ENXIO;
+ goto out;
+ }
/* see if the host passed in geometry config */
if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETR...
2020 Apr 29
2
[PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug
...turn ret;
+}
+
+static void virtblk_release(struct gendisk *disk, fmode_t mode)
+{
+ struct virtio_blk *vblk = disk->private_data;
+
+ virtblk_put(vblk);
+}
+
/* We provide getgeo only to please some old bootloader/partitioning tools */
static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int ret = 0;
+
+ mutex_lock(&vblk->vdev_mutex);
+
+ if (!vblk->vdev) {
+ ret = -ENXIO;
+ goto out;
+ }
/* see if the host passed in geometry config */
if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETR...
2020 Apr 28
0
[PATCH v2] virtio-blk: handle block_device_operations callbacks after hot unplug
...ase(struct gendisk *disk, fmode_t mode)
> +{
> + struct virtio_blk *vblk = disk->private_data;
> +
> + virtblk_put(vblk);
> +}
> +
> /* We provide getgeo only to please some old bootloader/partitioning tools */
> static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
> {
> struct virtio_blk *vblk = bd->bd_disk->private_data;
> + int ret = -ENXIO;
It's more common to do
int ret = 0;
and on error:
ret = -ENXIO;
let's do this.
> +
> + mutex_lock(&vblk->remove_mutex);
> +
> + if (!vblk->vdev) {
> + g...
2008 Apr 16
1
[PATCH] add virtio disk geometry feature
...a 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -157,10 +157,28 @@ static int virtblk_ioctl(struct inode *inode, struct file *filp,
/* We provide getgeo only to please some old bootloader/partitioning tools */
static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
- /* some standard values, similar to sd */
- geo->heads = 1 << 6;
- geo->sectors = 1 << 5;
- geo->cylinders = get_capacity(bd->bd_disk) >> 11;
+ struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int err = 0;
+
+ /* see if the host passed in geometr...
2008 Apr 16
1
[PATCH] add virtio disk geometry feature
...a 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -157,10 +157,28 @@ static int virtblk_ioctl(struct inode *inode, struct file *filp,
/* We provide getgeo only to please some old bootloader/partitioning tools */
static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
{
- /* some standard values, similar to sd */
- geo->heads = 1 << 6;
- geo->sectors = 1 << 5;
- geo->cylinders = get_capacity(bd->bd_disk) >> 11;
+ struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int err = 0;
+
+ /* see if the host passed in geometr...
2020 Apr 30
0
[PATCH v3] virtio-blk: handle block_device_operations callbacks after hot unplug
...ase(struct gendisk *disk, fmode_t mode)
> +{
> + struct virtio_blk *vblk = disk->private_data;
> +
> + virtblk_put(vblk);
> +}
> +
> /* We provide getgeo only to please some old bootloader/partitioning tools */
> static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
> {
> struct virtio_blk *vblk = bd->bd_disk->private_data;
> + int ret = 0;
> +
> + mutex_lock(&vblk->vdev_mutex);
> +
> + if (!vblk->vdev) {
> + ret = -ENXIO;
> + goto out;
> + }
>
> /* see if the host passed in geometry config */...