lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 6 Aug 2014 11:52:40 -0600 (MDT)
From:	Ross Zwisler <ross.zwisler@...ux.intel.com>
To:	Boaz Harrosh <boaz@...xistor.com>
cc:	Jens Axboe <axboe@...nel.dk>,
	Ross Zwisler <ross.zwisler@...ux.intel.com>,
	Matthew Wilcox <willy@...ux.intel.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 2/4] brd: Add getgeo to block ops

On Wed, 6 Aug 2014, Boaz Harrosh wrote:
> From: Ross Zwisler <ross.zwisler@...ux.intel.com>
> 
> Some programs require HDIO_GETGEO work, which requires we implement
> getgeo.  Based off of the work done to the NVMe driver in this commit:
> 
> 4cc09e2dc4cb NVMe: Add getgeo to block ops
> 
> [Boaz] Converted original work done for prd.c for here.
>        This is needed if we want to support partitions, fdisk
>        calls this.
> 
> Signed-off-by: Ross Zwisler <ross.zwisler@...ux.intel.com>
> Signed-off-by: Boaz Harrosh <boaz@...xistor.com>
> ---
>  drivers/block/brd.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> index a10a0a9..3f07cb4 100644
> --- a/drivers/block/brd.c
> +++ b/drivers/block/brd.c
> @@ -19,6 +19,7 @@
>  #include <linux/radix-tree.h>
>  #include <linux/fs.h>
>  #include <linux/slab.h>
> +#include <linux/hdreg.h>
>  
>  #include <asm/uaccess.h>
>  
> @@ -424,6 +425,15 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode,
>  	return error;
>  }
>  
> +static int brd_getgeo(struct block_device *bd, struct hd_geometry *geo)
> +{
> +	/* some standard values */
> +	geo->heads = 1 << 6;
> +	geo->sectors = 1 << 5;
> +	geo->cylinders = get_capacity(bd->bd_disk) >> 11;
> +	return 0;
> +}
> +
>  static const struct block_device_operations brd_fops = {
>  	.owner =		THIS_MODULE,
>  	.rw_page =		brd_rw_page,
> @@ -431,6 +441,7 @@ static const struct block_device_operations brd_fops = {
>  #ifdef CONFIG_BLK_DEV_XIP
>  	.direct_access =	brd_direct_access,
>  #endif
> +	.getgeo =		brd_getgeo,
>  };
>  
>  /*
> -- 
> 1.9.3

This looks good.

- Ross
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ