[Cluster-devel] [PATCH 3/4] mkfs.gfs2: Create new resource groups on-demand
Andrew Price
anprice at redhat.com
Thu Jun 6 13:50:59 UTC 2013
On 06/06/13 14:07, Bob Peterson wrote:
> Hi,
>
> | +static unsigned rgsize_for_data(uint64_t blksreq, unsigned bsize)
> | +{
> | + const uint32_t blks_rgrp = GFS2_NBBY * (bsize - sizeof(struct
> | gfs2_rgrp));
> | + const uint32_t blks_meta = GFS2_NBBY * (bsize - sizeof(struct
> | gfs2_meta_header));
> | + unsigned bitblocks = 1;
> | + if (blksreq > blks_rgrp)
> | + bitblocks += ((blksreq - blks_rgrp) + blks_meta) / blks_meta;
>
> It looks like this may be rounding up to blks_meta, so shouldn't this be:
> + bitblocks += ((blksreq - blks_rgrp) + blks_meta - 1) / blks_meta;
[Some mental arithmetic later...]
Good catch, thanks :)
Andy
More information about the Cluster-devel
mailing list