From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: [PATCH 5/5 v4] brd: Add getgeo to block ops for fdisk Date: Wed, 05 Nov 2014 17:18:16 +0200 Message-ID: <545A3FB8.5080004@plexistor.com> References: <545A2D69.8090003@plexistor.com> <545A2FEA.3050101@plexistor.com> <545A3EC8.3060203@plexistor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-kernel , linux-fsdevel To: Boaz Harrosh , Jens Axboe , Matthew Wilcox , Dmitry Monakhov Return-path: In-Reply-To: <545A3EC8.3060203@plexistor.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 11/05/2014 05:14 PM, Boaz Harrosh wrote: > From: Boaz Harrosh > Sorry [V4] Also fix the cryptic comment at the source code. I have pushed new trees to the public tree as well Thanks Boaz <> > +static int brd_getgeo(struct block_device *bd, struct hd_geometry *geo) > +{ > + /* With the usual emulated values of 64, 32, X and the > + * default size of 4M device, fdisk will offer 40 as possible > + * first-sector. > + * But with the values presented here of 1, 1, 1 fdisk will > + * offer 8 (4K) as possible first sector. > + * Otherwise, either way, it effects nothing. Only fdisk calls > + * this vector at all. > + */ > + geo->heads = 1; > + geo->sectors = 1; > + geo->cylinders = 1; > + return 0; > +} > + > static const struct block_device_operations brd_fops = { > .owner = THIS_MODULE, > .rw_page = brd_rw_page, > @@ -433,6 +450,7 @@ static const struct block_device_operations brd_fops = { > #ifdef CONFIG_BLK_DEV_XIP > .direct_access = brd_direct_access, > #endif > + .getgeo = brd_getgeo, > }; > > /* >