]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Add code to xfs_db/admin to allow version 1 to version 2 log transition.
authorNathan Scott <nathans@sgi.com>
Thu, 18 May 2006 03:48:51 +0000 (03:48 +0000)
committerNathan Scott <nathans@sgi.com>
Thu, 18 May 2006 03:48:51 +0000 (03:48 +0000)
Merge of master-melb:xfs-cmds:25961a by kenmcd.

db/sb.c
db/xfs_admin.sh
doc/CHANGES
man/man8/xfs_admin.8
man/man8/xfs_db.8

diff --git a/db/sb.c b/db/sb.c
index 746a72f4d0f81c58addeb55220464a18d34c1216..9f329584d72a79086244b6693813c84905cfacba 100644 (file)
--- a/db/sb.c
+++ b/db/sb.c
@@ -536,11 +536,12 @@ version_help(void)
 " '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"
 );
 }
@@ -549,14 +550,21 @@ static int
 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;
 }
@@ -641,6 +649,26 @@ version_f(
                                                  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 &=
index 1702a31584cc1534ca4dc9795064ce0b992a1995..ac86d128d50e99cb115b2ee8e0e10ed8a359d457 100755 (executable)
@@ -4,13 +4,14 @@
 #
 
 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";;
index 9594e6f236476d673ac0e455da1f71e4d4bcb6d0..0d03a6611165bb18f05bf6abc47a12ecd32637f2 100644 (file)
@@ -1,3 +1,7 @@
+[cvs]
+       - Added code to xfs_db and xfs_admin to allow conversion
+         from version 1 to version 2 logs.
+
 xfsprogs-2.7.18 (16 May 2006)
        - Fixed a case where xfs_repair was reporting a valid used 
          block as a duplicate during phase 4.
index 7034b5e5c1b9ad4ce522207e227cb7bbfcd9dc81..3cb42f59803732548b2057fcdd80e4f59d75cb22 100644 (file)
@@ -32,6 +32,10 @@ already have this enabled.
 Specifies that the filesystem image to be processed is stored in a
 regular file (see the \f2mkfs.xfs\f1 \f3\-d\f1 \f2file\f1 option).
 .TP 5
+\f3\-j\f1
+Enables version 2 log format (journal format supporting larger
+log buffers).
+.TP 5
 \f3\-l\f1
 Print the current filesystem label.
 .TP 5
index dd7530e8fb9603069cf962004f6e5321a9157f61..2b28a1b557d4df89c5c45062037bd89a1f99a112 100644 (file)
@@ -436,13 +436,15 @@ superblock in the filesystem.
 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