]>
Commit | Line | Data |
---|---|---|
96aaf9bc DW |
1 | /* |
2 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. | |
3 | * All Rights Reserved. | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or | |
6 | * modify it under the terms of the GNU General Public License as | |
7 | * published by the Free Software Foundation. | |
8 | * | |
9 | * This program is distributed in the hope that it would be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | */ | |
18 | #include "libxfs.h" | |
19 | #include "fsgeom.h" | |
20 | ||
21 | void | |
22 | xfs_report_geom( | |
23 | struct xfs_fsop_geom *geo, | |
24 | const char *mntpoint, | |
25 | const char *logname, | |
26 | const char *rtname) | |
27 | { | |
28 | int isint; | |
29 | int lazycount; | |
30 | int dirversion; | |
31 | int logversion; | |
32 | int attrversion; | |
33 | int projid32bit; | |
34 | int crcs_enabled; | |
35 | int cimode; | |
36 | int ftype_enabled; | |
37 | int finobt_enabled; | |
38 | int spinodes; | |
39 | int rmapbt_enabled; | |
40 | int reflink_enabled; | |
41 | ||
42 | isint = geo->logstart > 0; | |
43 | lazycount = geo->flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0; | |
44 | dirversion = geo->flags & XFS_FSOP_GEOM_FLAGS_DIRV2 ? 2 : 1; | |
45 | logversion = geo->flags & XFS_FSOP_GEOM_FLAGS_LOGV2 ? 2 : 1; | |
46 | attrversion = geo->flags & XFS_FSOP_GEOM_FLAGS_ATTR2 ? 2 : \ | |
47 | (geo->flags & XFS_FSOP_GEOM_FLAGS_ATTR ? 1 : 0); | |
48 | cimode = geo->flags & XFS_FSOP_GEOM_FLAGS_DIRV2CI ? 1 : 0; | |
49 | projid32bit = geo->flags & XFS_FSOP_GEOM_FLAGS_PROJID32 ? 1 : 0; | |
50 | crcs_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_V5SB ? 1 : 0; | |
51 | ftype_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_FTYPE ? 1 : 0; | |
52 | finobt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_FINOBT ? 1 : 0; | |
53 | spinodes = geo->flags & XFS_FSOP_GEOM_FLAGS_SPINODES ? 1 : 0; | |
54 | rmapbt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_RMAPBT ? 1 : 0; | |
55 | reflink_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_REFLINK ? 1 : 0; | |
56 | ||
57 | printf(_( | |
58 | "meta-data=%-22s isize=%-6d agcount=%u, agsize=%u blks\n" | |
59 | " =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n" | |
60 | " =%-22s crc=%-8u finobt=%u, sparse=%u, rmapbt=%u\n" | |
61 | " =%-22s reflink=%u\n" | |
62 | "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" | |
63 | " =%-22s sunit=%-6u swidth=%u blks\n" | |
64 | "naming =version %-14u bsize=%-6u ascii-ci=%d, ftype=%d\n" | |
65 | "log =%-22s bsize=%-6d blocks=%u, version=%d\n" | |
66 | " =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n" | |
67 | "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n"), | |
68 | mntpoint, geo->inodesize, geo->agcount, geo->agblocks, | |
69 | "", geo->sectsize, attrversion, projid32bit, | |
70 | "", crcs_enabled, finobt_enabled, spinodes, rmapbt_enabled, | |
71 | "", reflink_enabled, | |
72 | "", geo->blocksize, (unsigned long long)geo->datablocks, | |
73 | geo->imaxpct, | |
74 | "", geo->sunit, geo->swidth, | |
75 | dirversion, geo->dirblocksize, cimode, ftype_enabled, | |
76 | isint ? _("internal log") : logname ? logname : _("external"), | |
77 | geo->blocksize, geo->logblocks, logversion, | |
78 | "", geo->logsectsize, geo->logsunit / geo->blocksize, lazycount, | |
79 | !geo->rtblocks ? _("none") : rtname ? rtname : _("external"), | |
80 | geo->rtextsize * geo->blocksize, (unsigned long long)geo->rtblocks, | |
81 | (unsigned long long)geo->rtextents); | |
82 | } |