diff options
author | David S. Miller <davem@davemloft.net> | 2014-09-08 00:41:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-08 00:41:53 -0400 |
commit | eb84d6b60491a3ca3d90d62ee5346b007770d40d (patch) | |
tree | 22aadf9ada15e1ae5ba4c400aafab6f2541996e6 /include/linux/jbd2.h | |
parent | 97a13e5289baa96eaddd06e61d277457d837af3a (diff) | |
parent | d030671f3f261e528dc6e396a13f10859a74ae7c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r-- | include/linux/jbd2.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index d5b50a19463c..0dae71e9971c 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -159,7 +159,11 @@ typedef struct journal_header_s | |||
159 | * journal_block_tag (in the descriptor). The other h_chksum* fields are | 159 | * journal_block_tag (in the descriptor). The other h_chksum* fields are |
160 | * not used. | 160 | * not used. |
161 | * | 161 | * |
162 | * Checksum v1 and v2 are mutually exclusive features. | 162 | * If FEATURE_INCOMPAT_CSUM_V3 is set, the descriptor block uses |
163 | * journal_block_tag3_t to store a full 32-bit checksum. Everything else | ||
164 | * is the same as v2. | ||
165 | * | ||
166 | * Checksum v1, v2, and v3 are mutually exclusive features. | ||
163 | */ | 167 | */ |
164 | struct commit_header { | 168 | struct commit_header { |
165 | __be32 h_magic; | 169 | __be32 h_magic; |
@@ -179,6 +183,14 @@ struct commit_header { | |||
179 | * raw struct shouldn't be used for pointer math or sizeof() - use | 183 | * raw struct shouldn't be used for pointer math or sizeof() - use |
180 | * journal_tag_bytes(journal) instead to compute this. | 184 | * journal_tag_bytes(journal) instead to compute this. |
181 | */ | 185 | */ |
186 | typedef struct journal_block_tag3_s | ||
187 | { | ||
188 | __be32 t_blocknr; /* The on-disk block number */ | ||
189 | __be32 t_flags; /* See below */ | ||
190 | __be32 t_blocknr_high; /* most-significant high 32bits. */ | ||
191 | __be32 t_checksum; /* crc32c(uuid+seq+block) */ | ||
192 | } journal_block_tag3_t; | ||
193 | |||
182 | typedef struct journal_block_tag_s | 194 | typedef struct journal_block_tag_s |
183 | { | 195 | { |
184 | __be32 t_blocknr; /* The on-disk block number */ | 196 | __be32 t_blocknr; /* The on-disk block number */ |
@@ -187,9 +199,6 @@ typedef struct journal_block_tag_s | |||
187 | __be32 t_blocknr_high; /* most-significant high 32bits. */ | 199 | __be32 t_blocknr_high; /* most-significant high 32bits. */ |
188 | } journal_block_tag_t; | 200 | } journal_block_tag_t; |
189 | 201 | ||
190 | #define JBD2_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high)) | ||
191 | #define JBD2_TAG_SIZE64 (sizeof(journal_block_tag_t)) | ||
192 | |||
193 | /* Tail of descriptor block, for checksumming */ | 202 | /* Tail of descriptor block, for checksumming */ |
194 | struct jbd2_journal_block_tail { | 203 | struct jbd2_journal_block_tail { |
195 | __be32 t_checksum; /* crc32c(uuid+descr_block) */ | 204 | __be32 t_checksum; /* crc32c(uuid+descr_block) */ |
@@ -284,6 +293,7 @@ typedef struct journal_superblock_s | |||
284 | #define JBD2_FEATURE_INCOMPAT_64BIT 0x00000002 | 293 | #define JBD2_FEATURE_INCOMPAT_64BIT 0x00000002 |
285 | #define JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT 0x00000004 | 294 | #define JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT 0x00000004 |
286 | #define JBD2_FEATURE_INCOMPAT_CSUM_V2 0x00000008 | 295 | #define JBD2_FEATURE_INCOMPAT_CSUM_V2 0x00000008 |
296 | #define JBD2_FEATURE_INCOMPAT_CSUM_V3 0x00000010 | ||
287 | 297 | ||
288 | /* Features known to this kernel version: */ | 298 | /* Features known to this kernel version: */ |
289 | #define JBD2_KNOWN_COMPAT_FEATURES JBD2_FEATURE_COMPAT_CHECKSUM | 299 | #define JBD2_KNOWN_COMPAT_FEATURES JBD2_FEATURE_COMPAT_CHECKSUM |
@@ -291,7 +301,8 @@ typedef struct journal_superblock_s | |||
291 | #define JBD2_KNOWN_INCOMPAT_FEATURES (JBD2_FEATURE_INCOMPAT_REVOKE | \ | 301 | #define JBD2_KNOWN_INCOMPAT_FEATURES (JBD2_FEATURE_INCOMPAT_REVOKE | \ |
292 | JBD2_FEATURE_INCOMPAT_64BIT | \ | 302 | JBD2_FEATURE_INCOMPAT_64BIT | \ |
293 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT | \ | 303 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT | \ |
294 | JBD2_FEATURE_INCOMPAT_CSUM_V2) | 304 | JBD2_FEATURE_INCOMPAT_CSUM_V2 | \ |
305 | JBD2_FEATURE_INCOMPAT_CSUM_V3) | ||
295 | 306 | ||
296 | #ifdef __KERNEL__ | 307 | #ifdef __KERNEL__ |
297 | 308 | ||
@@ -1296,6 +1307,15 @@ static inline int tid_geq(tid_t x, tid_t y) | |||
1296 | extern int jbd2_journal_blocks_per_page(struct inode *inode); | 1307 | extern int jbd2_journal_blocks_per_page(struct inode *inode); |
1297 | extern size_t journal_tag_bytes(journal_t *journal); | 1308 | extern size_t journal_tag_bytes(journal_t *journal); |
1298 | 1309 | ||
1310 | static inline int jbd2_journal_has_csum_v2or3(journal_t *journal) | ||
1311 | { | ||
1312 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V2) || | ||
1313 | JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V3)) | ||
1314 | return 1; | ||
1315 | |||
1316 | return 0; | ||
1317 | } | ||
1318 | |||
1299 | /* | 1319 | /* |
1300 | * We reserve t_outstanding_credits >> JBD2_CONTROL_BLOCKS_SHIFT for | 1320 | * We reserve t_outstanding_credits >> JBD2_CONTROL_BLOCKS_SHIFT for |
1301 | * transaction control blocks. | 1321 | * transaction control blocks. |