From: NeilBrown Date: Fri, 1 Oct 2010 12:40:13 +0000 (+1000) Subject: Fix calculation of table_size X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=c7e2d2cc0efe8716243fa55410732b6acfd58289;p=LaFS.git Fix calculation of table_size I was confused about which table I was sizing. This is the table of which there are several in the segusage files. Signed-off-by: NeilBrown --- diff --git a/super.c b/super.c index cba689d..d02f80b 100644 --- a/super.c +++ b/super.c @@ -651,14 +651,17 @@ lafs_load(struct fs *fs, struct options *op, int newest) dv->tables_per_seg = dv->segment_size / dv->width / dv->stride; dv->rows_per_table = dv->stride; - dv->tablesize = dv->rows_per_table * dv->width; dv->segment_stride = dv->segment_size; } else { dv->tables_per_seg = 1; dv->rows_per_table = dv->segment_size / dv->width; - dv->tablesize = dv->segment_size; dv->segment_stride = dv->rows_per_table; } + /* table size is the number of blocks in the segment usage + * file per snapshot + */ + dv->tablesize = (dv->segment_count + (1<<(fs->blocksize_bits-1)) + 1) + >> (fs->blocksize_bits-1); for (j = 0; j < 2; j++) dv->devaddr[j] = le64_to_cpu(dv->devblk->devaddr[j]);