]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: add missing string name for DBM_COWDATA
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
In db/check.c, typename[] is supposed to have strings for every DBM_
type, but we forgot one.  Add it now.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/check.c

index 352aab3f620ad6028bcb5935caa2ecb8dbe39be2..442600be22fe04e761d92ce1c8006593256c6c9d 100644 (file)
@@ -164,8 +164,19 @@ static const char  *typename[] = {
        "btrmap",
        "btrefcnt",
        "rldata",
+       "cowdata",
        NULL
 };
+
+/*
+ * Make sure typename has the same number of elements as there are DBM types.
+ * This function isn't called anywhere; we just use it to trip up the compiler.
+ */
+static inline void check_typename(void)
+{
+       BUILD_BUG_ON(ARRAY_SIZE(typename) != DBM_NDBM + 1);
+}
+
 static int             verbose;
 
 #define        CHECK_BLIST(b)  (blist_size && check_blist(b))