|
|
| version 1.83, 2007/11/16 05:16:34 | version 1.84, 2008/02/07 05:18:42 |
|---|---|
| Line 412 calc_default_ag_geometry( | Line 412 calc_default_ag_geometry( |
| /* | /* |
| * First handle the extremes - the points at which we will | * First handle the extremes - the points at which we will |
| * always use the maximum AG size, the points at which we | * always use the maximum AG size, the points at which we |
| * always use the minimum, and a "small-step" for 16-128Mb. | * always use the minimum, and a "small-step" for 16-128MB. |
| * | |
| * These apply regardless of storage configuration. | |
| */ | */ |
| if (dblocks >= TERABYTES(32, blocklog)) { | if (dblocks >= TERABYTES(32, blocklog)) { |
| blocks = XFS_AG_MAX_BLOCKS(blocklog); | blocks = XFS_AG_MAX_BLOCKS(blocklog); |
| Line 427 calc_default_ag_geometry( | Line 429 calc_default_ag_geometry( |
| } | } |
| /* | /* |
| * Sizes between 128MB and 32TB: | |
| * | |
| * For the remainder we choose an AG size based on the | * For the remainder we choose an AG size based on the |
| * number of data blocks available, trying to keep the | * number of data blocks available, trying to keep the |
| * number of AGs relatively small (especially compared | * number of AGs relatively small (especially compared |
| Line 435 calc_default_ag_geometry( | Line 439 calc_default_ag_geometry( |
| * count can be increased by growfs, so prefer to use | * count can be increased by growfs, so prefer to use |
| * smaller counts at mkfs time. | * smaller counts at mkfs time. |
| * | * |
| * This scales us up smoothly between min/max AG sizes. | * For a single underlying storage device less than 4TB |
| * in size, just use 4 AGs, otherwise (for JBOD/RAIDs) | |
| * scale up smoothly between min/max AG sizes. | |
| */ | */ |
| if (!multidisk) { | if (!multidisk) { |
| Line 443 calc_default_ag_geometry( | Line 449 calc_default_ag_geometry( |
| blocks = XFS_AG_MAX_BLOCKS(blocklog); | blocks = XFS_AG_MAX_BLOCKS(blocklog); |
| goto done; | goto done; |
| } | } |
| count = 4; | shift = 2; |
| } else if (dblocks > GIGABYTES(512, blocklog)) | |
| goto done; | |
| } | |
| if (dblocks > GIGABYTES(512, blocklog)) | |
| shift = 5; | shift = 5; |
| else if (dblocks > GIGABYTES(8, blocklog)) | else if (dblocks > GIGABYTES(8, blocklog)) |
| shift = 4; | shift = 4; |
| Line 456 calc_default_ag_geometry( | Line 458 calc_default_ag_geometry( |
| shift = 3; | shift = 3; |
| else | else |
| ASSERT(0); | ASSERT(0); |
| blocks = dblocks >> shift; | /* |
| * If dblocks is not evenly divisible by the number of | |
| * desired AGs, round "blocks" up so we don't lose the | |
| * last bit of the filesystem. The same principle applies | |
| * to the AG count, so we don't lose the last AG! | |
| */ | |
| blocks = (dblocks >> shift) + ((dblocks & xfs_mask32lo(shift)) != 0); | |
| done: | done: |
| ASSERT (count || blocks); | |
| if (!count) | if (!count) |
| count = dblocks / blocks + (dblocks % blocks != 0); | count = dblocks / blocks + (dblocks % blocks != 0); |
| if (!blocks) | |
| blocks = dblocks / count; | |
| *agsize = blocks; | *agsize = blocks; |
| *agcount = count; | *agcount = count; |
| Line 735 main( | Line 740 main( |
| nodsflag = norsflag = 0; | nodsflag = norsflag = 0; |
| force_overwrite = 0; | force_overwrite = 0; |
| worst_freelist = 0; | worst_freelist = 0; |
| lazy_sb_counters = 0; | lazy_sb_counters = 1; |
| bzero(&fsx, sizeof(fsx)); | bzero(&fsx, sizeof(fsx)); |
| bzero(&xi, sizeof(xi)); | bzero(&xi, sizeof(xi)); |
| Line 1391 main( | Line 1396 main( |
| sectoralign = 0; | sectoralign = 0; |
| xlv_dsunit = xlv_dswidth = 0; | xlv_dsunit = xlv_dswidth = 0; |
| if (!nodsflag && !xi.disfile) | if (!xi.disfile) |
| get_subvol_stripe_wrapper(dfile, SVTYPE_DATA, | get_subvol_stripe_wrapper(dfile, SVTYPE_DATA, |
| &xlv_dsunit, &xlv_dswidth, §oralign); | &xlv_dsunit, &xlv_dswidth, §oralign); |
| if (sectoralign) { | if (sectoralign) { |
| Line 1797 _("size %s specified for log subvolume i | Line 1802 _("size %s specified for log subvolume i |
| } else if (daflag) /* User-specified AG count */ | } else if (daflag) /* User-specified AG count */ |
| agsize = dblocks / agcount + (dblocks % agcount != 0); | agsize = dblocks / agcount + (dblocks % agcount != 0); |
| else { | else |
| get_subvol_stripe_wrapper(dfile, SVTYPE_DATA, | calc_default_ag_geometry(blocklog, dblocks, |
| &xlv_dsunit, &xlv_dswidth, §oralign), | xlv_dsunit | xlv_dswidth, &agsize, &agcount); |
| calc_default_ag_geometry(blocklog, dblocks, xlv_dsunit | xlv_dswidth, | |
| &agsize, &agcount); | |
| } | |
| /* | /* |
| * If the last AG is too small, reduce the filesystem size | * If the last AG is too small, reduce the filesystem size |
| Line 1817 _("size %s specified for log subvolume i | Line 1819 _("size %s specified for log subvolume i |
| validate_ag_geometry(blocklog, dblocks, agsize, agcount); | validate_ag_geometry(blocklog, dblocks, agsize, agcount); |
| if (!nodsflag && dsunit) { | if (!nodsflag) { |
| if (xlv_dsunit && xlv_dsunit != dsunit) { | if (dsunit) { |
| fprintf(stderr, | if (xlv_dsunit && xlv_dsunit != dsunit) { |
| _("%s: Specified data stripe unit %d is not " | fprintf(stderr, |
| "the same as the volume stripe unit %d\n"), | _("%s: Specified data stripe unit %d " |
| progname, dsunit, xlv_dsunit); | "is not the same as the volume stripe " |
| } | "unit %d\n"), |
| if (xlv_dswidth && xlv_dswidth != dswidth) { | progname, dsunit, xlv_dsunit); |
| fprintf(stderr, | } |
| _("%s: Specified data stripe width %d is not " | if (xlv_dswidth && xlv_dswidth != dswidth) { |
| "the same as the volume stripe width %d\n"), | fprintf(stderr, |
| progname, dswidth, xlv_dswidth); | _("%s: Specified data stripe width %d " |
| "is not the same as the volume stripe " | |
| "width %d\n"), | |
| progname, dswidth, xlv_dswidth); | |
| } | |
| } else { | |
| dsunit = xlv_dsunit; | |
| dswidth = xlv_dswidth; | |
| nodsflag = 1; | |
| } | } |
| } else { | } /* else dsunit & dswidth can't be set if nodsflag is set */ |
| dsunit = xlv_dsunit; | |
| dswidth = xlv_dswidth; | |
| nodsflag = 1; | |
| } | |
| /* | /* |
| * If dsunit is a multiple of fs blocksize, then check that is a | * If dsunit is a multiple of fs blocksize, then check that is a |