From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Brown Subject: Re: [PATCH 7/8] md: update_size(): Remove useless variable "fit". Date: Wed, 9 Jul 2008 19:39:50 +1000 Message-ID: <18548.34662.585278.470361@notabene.brown> References: <20080708155541.GS23944@skl-net.de> <18547.62297.913913.977355@notabene.brown> <20080709091427.GV23944@skl-net.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: message from Andre Noll on Wednesday July 9 Sender: linux-raid-owner@vger.kernel.org To: Andre Noll Cc: linux-raid@vger.kernel.org List-Id: linux-raid.ids On Wednesday July 9, maan@systemlinux.org wrote: > > If you are keen to do some more tidying up, I would really love it if > > all internal values that are currently stored as 'K' would instead be > > stored as sectors. > > So for example with update_size, we could make the value that is > > passed in be a number of sectors, get rid of those divisions. > > Of course the size unit exported to user space programs via sysfs must > not change. So if we change update_size() as you propose, the division > has to be done in the size_store() instead, which calls update_size() > with a value obtained from sysfs. Correct - the unit exported to userspace must not change. We could conceivably make it fractional though. 100.5 for 201 sectors. size_store would do a multiplication: err = update_size(mddev, size*2); size_show would do a division: return sprintf(page, "%llu\n", mddev->size/2); or conceivably return sprintf(page, "%llu%s\n", mddev->size/2, (mddev->size&1) ? ".5":""); > > Therefore I think it's impossible to completely get rid of the > divisions/multiplications without breaking user space, but it might > still be worth to change the internal representations. Exactly how I see it. > > I will have a look at it, but I might need some further advice. > > > BTW your patches arrive without a valid "To" field. The Date is odd > > too. > > They were generated by git-format-patch and then bounced to the > list. The date is "correct" in the sense that I checked them in back > then. I'll see that subsequent patches have a proper date and a valid > "To" field. The date wasn't a problem, it just seemed odd. Your explanation makes perfect sense. I think you are "supposed" to use git-send-mail --to linux-raid@vger.kernel.org ... to send the mail. That sticks in a "To:". Without the "To:" is have to edit the headers to reply to the list (which isn't a big problem). Thanks, NeilBrown