[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53E344DD.7020801@gmail.com>
Date: Thu, 07 Aug 2014 12:20:29 +0300
From: Boaz Harrosh <openosd@...il.com>
To: Ross Zwisler <ross.zwisler@...ux.intel.com>,
Boaz Harrosh <boaz@...xistor.com>
CC: Jens Axboe <axboe@...nel.dk>,
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 08/06/2014 08:52 PM, Ross Zwisler wrote:
> 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:
>>
<>
>> +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;
>> +}
>> +
<>
> This looks good.
>
Actually this one is wrong. When I go into fdisk it always gives me
34 as the first possible sector. (And with my 4k patch it gives me
40)
But what I really want is just plain 8. All I want is to waist first
4k for partition table and enough is enough. So actually this above
is wrong.
All we need is :
+ geo->heads = 1 ;
+ geo->sectors = 1 ;
+ geo->cylinders = 1;
Now do not worry the capacity is never extracted from this 32bit structure
for a long time. The capacity is fetched else where, in all programs. This
here just gives you that wired HD math calculation for this 34 sectors
alignment crap.
I just tried it works perfectly with fdisk and gpart. So I'll post a patch.
Thanks
Boaz
--
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