xfs
[Top] [All Lists]

[PATCH 34/35] xfsprogs: xfs_db support for sb_utf8version

To: linux-fsdevel@xxxxxxxxxxxxxxx
Subject: [PATCH 34/35] xfsprogs: xfs_db support for sb_utf8version
From: Ben Myers <bpm@xxxxxxx>
Date: Fri, 3 Oct 2014 17:16:46 -0500
Cc: xfs@xxxxxxxxxxx, olaf@xxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20141003214758.GY1865@xxxxxxx>
References: <20141003214758.GY1865@xxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
From: Ben Myers <bpm@xxxxxxx>

Add support for accessing and setting sb_utf8version to xfs_db.

Signed-off-by: Ben Myers <bpm@xxxxxxx>
---
 db/hash.c | 1 +
 db/sb.c   | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/db/hash.c b/db/hash.c
index 02376e6..5196442 100644
--- a/db/hash.c
+++ b/db/hash.c
@@ -52,6 +52,7 @@ hash_f(
 {
        xfs_dahash_t    hashval;
 
+       /* XXX utf8version? */
        hashval = libxfs_da_hashname((uchar_t *)argv[1], (int)strlen(argv[1]));
        dbprintf("0x%x\n", hashval);
        return 0;
diff --git a/db/sb.c b/db/sb.c
index 6cb665d..e32790a 100644
--- a/db/sb.c
+++ b/db/sb.c
@@ -119,6 +119,7 @@ const field_t       sb_flds[] = {
        { "features_log_incompat", FLDT_UINT32X, OI(OFF(features_log_incompat)),
                C1, 0, TYP_NONE },
        { "crc", FLDT_CRC, OI(OFF(crc)), C1, 0, TYP_NONE },
+       { "utf8version", FLDT_UINT32D, OI(OFF(utf8version)), C1, 0, TYP_NONE },
        { "pquotino", FLDT_INO, OI(OFF(pquotino)), C1, 0, TYP_INODE },
        { "lsn", FLDT_UINT64X, OI(OFF(lsn)), C1, 0, TYP_NONE },
        { NULL }
@@ -646,6 +647,8 @@ version_string(
                strcat(s, ",CRC");
        if (xfs_sb_version_hasftype(sbp))
                strcat(s, ",FTYPE");
+       if (xfs_sb_version_hasutf8(sbp))
+               strcat(s, ",UTF8");
        return s;
 }
 
-- 
1.7.12.4

<Prev in Thread] Current Thread [Next in Thread>