aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ext4_fs.h3
-rw-r--r--include/linux/jbd2.h36
2 files changed, 34 insertions, 5 deletions
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 300cc5a5adb9..cd406dba0e64 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -467,7 +467,8 @@ do { \
467#define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ 467#define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
468#define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ 468#define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
469#define EXT4_MOUNT_EXTENTS 0x400000 /* Extents support */ 469#define EXT4_MOUNT_EXTENTS 0x400000 /* Extents support */
470 470#define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */
471#define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */
471/* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ 472/* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */
472#ifndef _LINUX_EXT2_FS_H 473#ifndef _LINUX_EXT2_FS_H
473#define clear_opt(o, opt) o &= ~EXT4_MOUNT_##opt 474#define clear_opt(o, opt) o &= ~EXT4_MOUNT_##opt
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 685640036e81..98a2bc5d3e3f 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -149,6 +149,28 @@ typedef struct journal_header_s
149 __be32 h_sequence; 149 __be32 h_sequence;
150} journal_header_t; 150} journal_header_t;
151 151
152/*
153 * Checksum types.
154 */
155#define JBD2_CRC32_CHKSUM 1
156#define JBD2_MD5_CHKSUM 2
157#define JBD2_SHA1_CHKSUM 3
158
159#define JBD2_CRC32_CHKSUM_SIZE 4
160
161#define JBD2_CHECKSUM_BYTES (32 / sizeof(u32))
162/*
163 * Commit block header for storing transactional checksums:
164 */
165struct commit_header {
166 __be32 h_magic;
167 __be32 h_blocktype;
168 __be32 h_sequence;
169 unsigned char h_chksum_type;
170 unsigned char h_chksum_size;
171 unsigned char h_padding[2];
172 __be32 h_chksum[JBD2_CHECKSUM_BYTES];
173};
152 174
153/* 175/*
154 * The block tag: used to describe a single buffer in the journal. 176 * The block tag: used to describe a single buffer in the journal.
@@ -242,14 +264,18 @@ typedef struct journal_superblock_s
242 ((j)->j_format_version >= 2 && \ 264 ((j)->j_format_version >= 2 && \
243 ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask)))) 265 ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
244 266
245#define JBD2_FEATURE_INCOMPAT_REVOKE 0x00000001 267#define JBD2_FEATURE_COMPAT_CHECKSUM 0x00000001
246#define JBD2_FEATURE_INCOMPAT_64BIT 0x00000002 268
269#define JBD2_FEATURE_INCOMPAT_REVOKE 0x00000001
270#define JBD2_FEATURE_INCOMPAT_64BIT 0x00000002
271#define JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT 0x00000004
247 272
248/* Features known to this kernel version: */ 273/* Features known to this kernel version: */
249#define JBD2_KNOWN_COMPAT_FEATURES 0 274#define JBD2_KNOWN_COMPAT_FEATURES JBD2_FEATURE_COMPAT_CHECKSUM
250#define JBD2_KNOWN_ROCOMPAT_FEATURES 0 275#define JBD2_KNOWN_ROCOMPAT_FEATURES 0
251#define JBD2_KNOWN_INCOMPAT_FEATURES (JBD2_FEATURE_INCOMPAT_REVOKE | \ 276#define JBD2_KNOWN_INCOMPAT_FEATURES (JBD2_FEATURE_INCOMPAT_REVOKE | \
252 JBD2_FEATURE_INCOMPAT_64BIT) 277 JBD2_FEATURE_INCOMPAT_64BIT | \
278 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)
253 279
254#ifdef __KERNEL__ 280#ifdef __KERNEL__
255 281
@@ -997,6 +1023,8 @@ extern int jbd2_journal_check_available_features
997 (journal_t *, unsigned long, unsigned long, unsigned long); 1023 (journal_t *, unsigned long, unsigned long, unsigned long);
998extern int jbd2_journal_set_features 1024extern int jbd2_journal_set_features
999 (journal_t *, unsigned long, unsigned long, unsigned long); 1025 (journal_t *, unsigned long, unsigned long, unsigned long);
1026extern void jbd2_journal_clear_features
1027 (journal_t *, unsigned long, unsigned long, unsigned long);
1000extern int jbd2_journal_create (journal_t *); 1028extern int jbd2_journal_create (journal_t *);
1001extern int jbd2_journal_load (journal_t *journal); 1029extern int jbd2_journal_load (journal_t *journal);
1002extern void jbd2_journal_destroy (journal_t *); 1030extern void jbd2_journal_destroy (journal_t *);