From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Thu, 06 Jun 2013 14:50:59 +0100 Subject: [Cluster-devel] [PATCH 3/4] mkfs.gfs2: Create new resource groups on-demand In-Reply-To: <1672593147.48067930.1370524058619.JavaMail.root@redhat.com> References: <1370520213-29676-1-git-send-email-anprice@redhat.com> <1370520213-29676-3-git-send-email-anprice@redhat.com> <1672593147.48067930.1370524058619.JavaMail.root@redhat.com> Message-ID: <51B093C3.9030904@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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