[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ext2 strange layout fixes
From: |
Harley D. Eades III |
Subject: |
Re: ext2 strange layout fixes |
Date: |
Sun, 20 Nov 2005 19:09:07 -0600 |
On Sun, 2005-11-20 at 12:02 +0100, Patrick Leslie Polzer wrote:
> On Sat, 19 Nov 2005 19:51:32 -0600
> Harley D. Eades III <"Harley D. Eades III" <address@hidden>> wrote:
>
> > I think your patch looks good, I have not tested it yet. One thing I
> > don't like is the name "howmany()", this is not a very decriptive name
> > for a function.
> I do not like it either. I suggest
>
> 1. replacing it by a real function
> 2. renaming it to something sensible
>
> Maybe we could also use ped_div_round_up()...
> Can anyone check this?
static inline PedSector
ped_div_round_up (PedSector numerator, PedSector divisor)
{
return (numerator + divisor - 1) / divisor;
}
#ifndef howmany
#define howmany(x,y) (((x)+((y)-1))/(y))
#endif
Both do the same thing, I agree with using ped_div_round_up().
> > I don't think you were the one to create the function,
> > but is this a libparted function or some other libs function?
> It's a macro used all over the ext2 code (defined in some fs_ext2/
> header).
>
> howmany (x,y) = ceil (x/y)
>
> You need it to round up to the next full block.
I understand.
> > Great Job!
> Thank you. All I hope there aren't any undetected problems with it.
> IMHO the code is at times not something one would call well-written :/
:)
Cheers
Harley