/* inline functions */
+ #ifdef NO_INLINE_FUNCS
+extern void ext2fs_init_csum_seed(ext2_filsys fs);
extern errcode_t ext2fs_get_mem(unsigned long size, void *ptr);
- extern errcode_t ext2fs_get_memalign(unsigned long size,
- unsigned long align, void *ptr);
extern errcode_t ext2fs_get_memzero(unsigned long size, void *ptr);
extern errcode_t ext2fs_get_array(unsigned long count,
unsigned long size, void *ptr);
#define _INLINE_ extern __inline__
#else /* For Watcom C */
#define _INLINE_ extern inline
- #endif
+ #endif /* __GNUC__ */
+ #endif /* __STDC_VERSION__ >= 199901L */
#endif
+_INLINE_ void ext2fs_init_csum_seed(ext2_filsys fs)
+{
+ if (!EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
+ EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
+ return;
+
+ fs->csum_seed = ext2fs_crc32c_le(~0, fs->super->s_uuid,
+ sizeof(fs->super->s_uuid));
+}
+
#ifndef EXT2_CUSTOM_MEMORY_ROUTINES
#include <string.h>
/*
#define JFS_KNOWN_ROCOMPAT_FEATURES 0
#define JFS_KNOWN_INCOMPAT_FEATURES (JFS_FEATURE_INCOMPAT_REVOKE|\
JFS_FEATURE_INCOMPAT_ASYNC_COMMIT|\
- JFS_FEATURE_INCOMPAT_64BIT)
+ JFS_FEATURE_INCOMPAT_64BIT|\
+ JFS_FEATURE_INCOMPAT_CSUM_V2)
+
+#if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
+#ifdef E2FSCK_INCLUDE_INLINE_FUNCS
- #define _INLINE_ extern
++#if (__STDC_VERSION__ >= 199901L)
++#define _INLINE_ extern inline
+#else
++#define _INLINE_ inline
++#endif
++#else /* !E2FSCK_INCLUDE_INLINE FUNCS */
++#if (__STDC_VERSION__ >= 199901L)
++#define _INLINE_ inline
++#else /* not C99 */
+#ifdef __GNUC__
+#define _INLINE_ extern __inline__
+#else /* For Watcom C */
+#define _INLINE_ extern inline
- #endif
- #endif
++#endif /* __GNUC__ */
++#endif /* __STDC_VERSION__ >= 199901L */
++#endif /* INCLUDE_INLINE_FUNCS */
+
+/*
+ * helper functions to deal with 32 or 64bit block numbers.
+ */
+_INLINE_ size_t journal_tag_bytes(journal_t *journal)
+{
+ journal_block_tag_t tag;
+ size_t x = 0;
+
+ if (JFS_HAS_INCOMPAT_FEATURE(journal, JFS_FEATURE_INCOMPAT_CSUM_V2))
+ x += sizeof(tag.t_checksum);
+
+ if (JFS_HAS_INCOMPAT_FEATURE(journal, JFS_FEATURE_INCOMPAT_64BIT))
+ return x + JBD_TAG_SIZE64;
+ else
+ return x + JBD_TAG_SIZE32;
+}
+#undef _INLINE_
+#endif
#ifdef __KERNEL__