" 'version extflg' - enable unwritten extents\n"
" 'version attr1' - enable v1 inline extended attributes\n"
" 'version attr2' - enable v2 inline extended attributes\n"
+" 'version log2' - enable v2 log format\n"
"\n"
"The version function prints currently enabled features for a filesystem\n"
"according to its the version field of the primary superblock.\n"
"It can also be used to enable selected features, such as support for\n"
-"unwritten extents. The upated version is written into to all AGs.\n"
+"unwritten extents. The upated version is written into all AGs.\n"
"\n"
);
}
do_version(xfs_agnumber_t agno, __uint16_t version, __uint32_t features)
{
xfs_sb_t tsb;
+ __int64_t fields = 0;
if (!get_sb(agno, &tsb))
return 0;
+ if ((version & XFS_SB_VERSION_LOGV2BIT) &&
+ !XFS_SB_VERSION_HASLOGV2(&tsb)) {
+ tsb.sb_logsunit = 1;
+ fields |= (1LL << XFS_SBS_LOGSUNIT);
+ }
+
tsb.sb_versionnum = version;
tsb.sb_features2 = features;
- libxfs_xlate_sb(iocur_top->data, &tsb, -1,
- (XFS_SB_VERSIONNUM | XFS_SBS_FEATURES2));
+ fields |= XFS_SB_VERSIONNUM | XFS_SB_FEATURES2;
+ libxfs_xlate_sb(iocur_top->data, &tsb, -1, fields);
write_cur();
return 1;
}
XFS_SB_VERSION_EXTFLGBIT;
break;
}
+ } else if (!strcasecmp(argv[1], "log2")) {
+ switch (XFS_SB_VERSION_NUM(&mp->m_sb)) {
+ case XFS_SB_VERSION_1:
+ version = 0x0004 | XFS_SB_VERSION_LOGV2BIT;
+ break;
+ case XFS_SB_VERSION_2:
+ version = 0x0014 | XFS_SB_VERSION_LOGV2BIT;
+ break;
+ case XFS_SB_VERSION_3:
+ version = 0x0034 | XFS_SB_VERSION_LOGV2BIT;
+ break;
+ case XFS_SB_VERSION_4:
+ if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb))
+ dbprintf("version 2 log format"
+ " is already in use\n");
+ else
+ version = mp->m_sb.sb_versionnum |
+ XFS_SB_VERSION_LOGV2BIT;
+ break;
+ }
} else if (!strcasecmp(argv[1], "attr1")) {
if (XFS_SB_VERSION_HASATTR2(&mp->m_sb)) {
if (!(mp->m_sb.sb_features2 &=
#
OPTS=""
-USAGE="Usage: xfs_admin [-efluV] [-L label] [-U uuid] special"
+USAGE="Usage: xfs_admin [-efjluV] [-L label] [-U uuid] special"
-while getopts "efluL:U:V" c
+while getopts "efjluL:U:V" c
do
case $c in
e) OPTS=$OPTS" -c 'version extflg'";;
f) OPTS=$OPTS" -f";;
+ j) OPTS=$OPTS" -c 'version log2'";;
l) OPTS=$OPTS" -r -c label";;
L) OPTS=$OPTS" -c 'label "$OPTARG"'";;
u) OPTS=$OPTS" -r -c uuid";;
to all secondary copies of the superblock.
If no argument is given, the current filesystem UUID is printed.
.TP
-\f3version\f1 [ \f2extflg\f1 | [\f2versionnum\f1 \f2features2\f1 ] ]
+\f3version\f1 [ \f2feature\f1 | [\f2versionnum\f1 \f2features2\f1 ] ]
Enable selected features for a filesystem (certain features can
be enabled on an unmounted filesystem, after
.IR mkfs.xfs (8)
has created the filesystem).
Support for unwritten extents can be enabled using the \f2extflg\f1
option.
+Support for version 2 log format can be enabled using the \f2log2\f1
+option.
Support for extended attributes can be enabled using the \f2attr1\f1
or \f2attr2\f1 option.
Once enabled, extended attributes cannot be disabled, but the user