@@ -64,6 +64,10 @@ extern int xfs_assert_largefile[sizeof(off_t)-8];
#define __packed __attribute__((packed))
#endif
+#ifndef BUILD_BUG_ON
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+#endif
+
#include <xfs/xfs_types.h>
#include <xfs/xfs_fs.h>
@@ -62,10 +62,14 @@ error_tag(char *name)
{ XFS_ERRTAG_DROP_WRITES, "drop_writes" },
{ XFS_ERRTAG_LOG_BAD_CRC, "log_bad_crc" },
{ XFS_ERRTAG_LOG_ITEM_PIN, "log_item_pin" },
+ { XFS_ERRTAG_BUF_LRU_REF, "buf_lru_ref" },
{ XFS_ERRTAG_MAX, NULL }
};
int count;
+ /* If this fails, make sure every tag is defined in the array above */
+ BUILD_BUG_ON(sizeof(eflags) != (XFS_ERRTAG_MAX + 1) * sizeof(*e));
+
/* Search for a name */
if (name) {
for (e = eflags; e->name; e++)
And catch it at build time if we get out of sync again. Signed-off-by: Eric Sandeen <sandeen@redhat.com> --- -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html