diff options
author | Al Viro <viro@www.linux.org.uk> | 2005-05-01 11:59:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:59:18 -0400 |
commit | 3e8962be915bacc1d70e4849a075041838d60a3f (patch) | |
tree | e2ef686fa0a18a429456b252ed9352cdc1ae65de /fs/reiserfs/stree.c | |
parent | 6a3a16f2ef6f335286e2b2bf8284b0ab4ff38ec0 (diff) |
[PATCH] reiserfs endianness: annotate little-endian objects
little-endian objects annotated as such; again, obviously no changes of
resulting code, we only replace __u16 with __le16, etc. in relevant places.
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/reiserfs/stree.c')
-rw-r--r-- | fs/reiserfs/stree.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 1d380a5da39c..15fa4cbdce3e 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c | |||
@@ -87,10 +87,11 @@ inline void copy_item_head(struct item_head * p_v_to, | |||
87 | inline int comp_short_keys (const struct reiserfs_key * le_key, | 87 | inline int comp_short_keys (const struct reiserfs_key * le_key, |
88 | const struct cpu_key * cpu_key) | 88 | const struct cpu_key * cpu_key) |
89 | { | 89 | { |
90 | __u32 * p_s_le_u32, * p_s_cpu_u32; | 90 | __le32 * p_s_le_u32; |
91 | __u32 * p_s_cpu_u32; | ||
91 | int n_key_length = REISERFS_SHORT_KEY_LEN; | 92 | int n_key_length = REISERFS_SHORT_KEY_LEN; |
92 | 93 | ||
93 | p_s_le_u32 = (__u32 *)le_key; | 94 | p_s_le_u32 = (__le32 *)le_key; |
94 | p_s_cpu_u32 = (__u32 *)&cpu_key->on_disk_key; | 95 | p_s_cpu_u32 = (__u32 *)&cpu_key->on_disk_key; |
95 | for( ; n_key_length--; ++p_s_le_u32, ++p_s_cpu_u32 ) { | 96 | for( ; n_key_length--; ++p_s_le_u32, ++p_s_cpu_u32 ) { |
96 | if ( le32_to_cpu (*p_s_le_u32) < *p_s_cpu_u32 ) | 97 | if ( le32_to_cpu (*p_s_le_u32) < *p_s_cpu_u32 ) |
@@ -228,7 +229,12 @@ extern struct tree_balance * cur_tb; | |||
228 | const struct reiserfs_key MIN_KEY = {0, 0, {{0, 0},}}; | 229 | const struct reiserfs_key MIN_KEY = {0, 0, {{0, 0},}}; |
229 | 230 | ||
230 | /* Maximal possible key. It is never in the tree. */ | 231 | /* Maximal possible key. It is never in the tree. */ |
231 | const struct reiserfs_key MAX_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}}; | 232 | const struct reiserfs_key MAX_KEY = { |
233 | __constant_cpu_to_le32(0xffffffff), | ||
234 | __constant_cpu_to_le32(0xffffffff), | ||
235 | {{__constant_cpu_to_le32(0xffffffff), | ||
236 | __constant_cpu_to_le32(0xffffffff)},} | ||
237 | }; | ||
232 | const struct in_core_key MAX_IN_CORE_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}}; | 238 | const struct in_core_key MAX_IN_CORE_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}}; |
233 | 239 | ||
234 | 240 | ||
@@ -998,7 +1004,7 @@ static char prepare_for_delete_or_cut( | |||
998 | int n_unfm_number, /* Number of the item unformatted nodes. */ | 1004 | int n_unfm_number, /* Number of the item unformatted nodes. */ |
999 | n_counter, | 1005 | n_counter, |
1000 | n_blk_size; | 1006 | n_blk_size; |
1001 | __u32 * p_n_unfm_pointer; /* Pointer to the unformatted node number. */ | 1007 | __le32 * p_n_unfm_pointer; /* Pointer to the unformatted node number. */ |
1002 | __u32 tmp; | 1008 | __u32 tmp; |
1003 | struct item_head s_ih; /* Item header. */ | 1009 | struct item_head s_ih; /* Item header. */ |
1004 | char c_mode; /* Returned mode of the balance. */ | 1010 | char c_mode; /* Returned mode of the balance. */ |
@@ -1060,7 +1066,7 @@ static char prepare_for_delete_or_cut( | |||
1060 | /* pointers to be cut */ | 1066 | /* pointers to be cut */ |
1061 | n_unfm_number -= pos_in_item (p_s_path); | 1067 | n_unfm_number -= pos_in_item (p_s_path); |
1062 | /* Set pointer to the last unformatted node pointer that is to be cut. */ | 1068 | /* Set pointer to the last unformatted node pointer that is to be cut. */ |
1063 | p_n_unfm_pointer = (__u32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1 - *p_n_removed; | 1069 | p_n_unfm_pointer = (__le32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1 - *p_n_removed; |
1064 | 1070 | ||
1065 | 1071 | ||
1066 | /* We go through the unformatted nodes pointers of the indirect | 1072 | /* We go through the unformatted nodes pointers of the indirect |
@@ -1082,8 +1088,8 @@ static char prepare_for_delete_or_cut( | |||
1082 | need_research = 1 ; | 1088 | need_research = 1 ; |
1083 | break; | 1089 | break; |
1084 | } | 1090 | } |
1085 | RFALSE( p_n_unfm_pointer < (__u32 *)B_I_PITEM(p_s_bh, &s_ih) || | 1091 | RFALSE( p_n_unfm_pointer < (__le32 *)B_I_PITEM(p_s_bh, &s_ih) || |
1086 | p_n_unfm_pointer > (__u32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1, | 1092 | p_n_unfm_pointer > (__le32 *)B_I_PITEM(p_s_bh, &s_ih) + I_UNFM_NUM(&s_ih) - 1, |
1087 | "vs-5265: pointer out of range"); | 1093 | "vs-5265: pointer out of range"); |
1088 | 1094 | ||
1089 | /* Hole, nothing to remove. */ | 1095 | /* Hole, nothing to remove. */ |
@@ -1432,7 +1438,7 @@ int reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode | |||
1432 | #if defined( USE_INODE_GENERATION_COUNTER ) | 1438 | #if defined( USE_INODE_GENERATION_COUNTER ) |
1433 | if( !old_format_only ( th -> t_super ) ) | 1439 | if( !old_format_only ( th -> t_super ) ) |
1434 | { | 1440 | { |
1435 | __u32 *inode_generation; | 1441 | __le32 *inode_generation; |
1436 | 1442 | ||
1437 | inode_generation = | 1443 | inode_generation = |
1438 | &REISERFS_SB(th -> t_super) -> s_rs -> s_inode_generation; | 1444 | &REISERFS_SB(th -> t_super) -> s_rs -> s_inode_generation; |