summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2016-08-29 10:46:43 +0200
committerTom Rini <trini@konsulko.com>2016-09-23 09:02:01 -0400
commit2a0b7a971aac682112cf676c6583196faafcb2b0 (patch)
tree49d06dec4f2008903eb269ff5fe33371b2c2ac88 /fs
parent2365a4b8ea7d8b1f5e796a4fec176f613dea838c (diff)
downloadu-boot-2a0b7a971aac682112cf676c6583196faafcb2b0.tar.gz
ext4: change structure fields to __le/__be types
Change all the types of ext2/4 fields to little endian types and all the JBD fields to big endian types. Now we can use sparse (make C=1) to check for statements where we need byteswaps. Signed-off-by: Michael Walle <michael@walle.cc>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ext4_journal.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/fs/ext4/ext4_journal.h b/fs/ext4/ext4_journal.h
index d926094bec..d54165ce19 100644
--- a/fs/ext4/ext4_journal.h
+++ b/fs/ext4/ext4_journal.h
@@ -49,9 +49,9 @@ struct dirty_blocks {
/* Standard header for all descriptor blocks: */
struct journal_header_t {
- __u32 h_magic;
- __u32 h_blocktype;
- __u32 h_sequence;
+ __be32 h_magic;
+ __be32 h_blocktype;
+ __be32 h_sequence;
};
/* The journal superblock. All fields are in big-endian byte order. */
@@ -60,35 +60,35 @@ struct journal_superblock_t {
struct journal_header_t s_header;
/* Static information describing the journal */
- __u32 s_blocksize; /* journal device blocksize */
- __u32 s_maxlen; /* total blocks in journal file */
- __u32 s_first; /* first block of log information */
+ __be32 s_blocksize; /* journal device blocksize */
+ __be32 s_maxlen; /* total blocks in journal file */
+ __be32 s_first; /* first block of log information */
/* Dynamic information describing the current state of the log */
- __u32 s_sequence; /* first commit ID expected in log */
- __u32 s_start; /* blocknr of start of log */
+ __be32 s_sequence; /* first commit ID expected in log */
+ __be32 s_start; /* blocknr of start of log */
/* Error value, as set by journal_abort(). */
- __s32 s_errno;
+ __be32 s_errno;
/* Remaining fields are only valid in a version-2 superblock */
- __u32 s_feature_compat; /* compatible feature set */
- __u32 s_feature_incompat; /* incompatible feature set */
- __u32 s_feature_ro_compat; /* readonly-compatible feature set */
+ __be32 s_feature_compat; /* compatible feature set */
+ __be32 s_feature_incompat; /* incompatible feature set */
+ __be32 s_feature_ro_compat; /* readonly-compatible feature set */
/* 0x0030 */
__u8 s_uuid[16]; /* 128-bit uuid for journal */
/* 0x0040 */
- __u32 s_nr_users; /* Nr of filesystems sharing log */
+ __be32 s_nr_users; /* Nr of filesystems sharing log */
- __u32 s_dynsuper; /* Blocknr of dynamic superblock copy */
+ __be32 s_dynsuper; /* Blocknr of dynamic superblock copy */
/* 0x0048 */
- __u32 s_max_transaction; /* Limit of journal blocks per trans. */
- __u32 s_max_trans_data; /* Limit of data blocks per trans. */
+ __be32 s_max_transaction; /* Limit of journal blocks per trans. */
+ __be32 s_max_trans_data; /* Limit of data blocks per trans. */
/* 0x0050 */
- __u32 s_padding[44];
+ __be32 s_padding[44];
/* 0x0100 */
__u8 s_users[16 * 48]; /* ids of all fs'es sharing the log */
@@ -96,13 +96,13 @@ struct journal_superblock_t {
} ;
struct ext3_journal_block_tag {
- uint32_t block;
- uint32_t flags;
+ __be32 block;
+ __be32 flags;
};
struct journal_revoke_header_t {
struct journal_header_t r_header;
- int r_count; /* Count of bytes used in the block */
+ __be32 r_count; /* Count of bytes used in the block */
};
struct revoke_blk_list {