@@ -152,5 +152,6 @@
#define xfs_rmap_compare libxfs_rmap_compare
#define xfs_dir_get_ops libxfs_dir_get_ops
#define xfs_default_ifork_ops libxfs_default_ifork_ops
+#define xfs_fs_geometry libxfs_fs_geometry
#endif /* __LIBXFS_API_DEFS_H__ */
@@ -20,7 +20,7 @@
#include <ctype.h>
#include "xfs_multidisk.h"
#include "libxcmd.h"
-
+#include "fsgeom.h"
#define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog)))
@@ -3172,40 +3172,6 @@ initialise_mount(
mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
}
-static void
-print_mkfs_cfg(
- struct mkfs_params *cfg,
- char *dfile,
- char *logfile,
- char *rtfile)
-{
- struct sb_feat_args *fp = &cfg->sb_feat;
-
- printf(_(
-"meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n"
-" =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n"
-" =%-22s crc=%-8u finobt=%u, sparse=%u, rmapbt=%u, reflink=%u\n"
-"data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
-" =%-22s sunit=%-6u swidth=%u blks\n"
-"naming =version %-14u bsize=%-6u ascii-ci=%d ftype=%d\n"
-"log =%-22s bsize=%-6d blocks=%lld, version=%d\n"
-" =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n"
-"realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n"),
- dfile, cfg->inodesize, (long long)cfg->agcount,
- (long long)cfg->agsize,
- "", cfg->sectorsize, fp->attr_version, fp->projid32bit,
- "", fp->crcs_enabled, fp->finobt, fp->spinodes, fp->rmapbt,
- fp->reflink,
- "", cfg->blocksize, (long long)cfg->dblocks, cfg->imaxpct,
- "", cfg->dsunit, cfg->dswidth,
- fp->dir_version, cfg->dirblocksize, fp->nci, fp->dirftype,
- logfile, cfg->blocksize, (long long)cfg->logblocks,
- fp->log_version,
- "", cfg->lsectorsize, cfg->lsunit, fp->lazy_sb_counters,
- rtfile, (int)cfg->rtextblocks << cfg->blocklog,
- (long long)cfg->rtblocks, (long long)cfg->rtextents);
-}
-
/*
* Format everything from the generated config into the superblock that
* will be used to initialise the on-disk superblock. This is the in-memory
@@ -3967,12 +3933,26 @@ main(
*/
calculate_log_size(&cfg, &cli, mp);
+ finish_superblock_setup(&cfg, mp, sbp);
+
+ /* Print the intended geometry of the fs. */
if (!quiet || dry_run) {
- print_mkfs_cfg(&cfg, dfile, logfile, rtfile);
+ struct xfs_fsop_geom geo;
+ int error;
+
+ error = -libxfs_fs_geometry(sbp, &geo,
+ XFS_FS_GEOM_MAX_STRUCT_VER);
+ if (error) {
+ fprintf(stderr,
+ _("%s: failed to generate filesystem geometry\n"),
+ progname);
+ exit(1);
+ }
+
+ xfs_report_geom(&geo, dfile, logfile, rtfile);
if (dry_run)
exit(0);
}
- finish_superblock_setup(&cfg, mp, sbp);
/*
* we need the libxfs buffer cache from here on in.