aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@www.linux.org.uk>2005-05-01 11:59:18 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:59:18 -0400
commit3e8962be915bacc1d70e4849a075041838d60a3f (patch)
treee2ef686fa0a18a429456b252ed9352cdc1ae65de
parent6a3a16f2ef6f335286e2b2bf8284b0ab4ff38ec0 (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>
-rw-r--r--fs/reiserfs/bitmap.c7
-rw-r--r--fs/reiserfs/dir.c8
-rw-r--r--fs/reiserfs/file.c4
-rw-r--r--fs/reiserfs/inode.c10
-rw-r--r--fs/reiserfs/item_ops.c5
-rw-r--r--fs/reiserfs/objectid.c18
-rw-r--r--fs/reiserfs/procfs.c4
-rw-r--r--fs/reiserfs/stree.c22
-rw-r--r--fs/reiserfs/super.c6
-rw-r--r--include/linux/reiserfs_acl.h12
-rw-r--r--include/linux/reiserfs_fs.h168
-rw-r--r--include/linux/reiserfs_xattr.h4
12 files changed, 138 insertions, 130 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index f4f16fada14c..49c479c9454a 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -260,8 +260,9 @@ static inline int block_group_used(struct super_block *s, u32 id) {
260/* 260/*
261 * the packing is returned in disk byte order 261 * the packing is returned in disk byte order
262 */ 262 */
263u32 reiserfs_choose_packing(struct inode *dir) { 263__le32 reiserfs_choose_packing(struct inode *dir)
264 u32 packing; 264{
265 __le32 packing;
265 if (TEST_OPTION(packing_groups, dir->i_sb)) { 266 if (TEST_OPTION(packing_groups, dir->i_sb)) {
266 u32 parent_dir = le32_to_cpu(INODE_PKEY(dir)->k_dir_id); 267 u32 parent_dir = le32_to_cpu(INODE_PKEY(dir)->k_dir_id);
267 /* 268 /*
@@ -655,7 +656,7 @@ static int get_left_neighbor(reiserfs_blocknr_hint_t *hint)
655 struct buffer_head * bh; 656 struct buffer_head * bh;
656 struct item_head * ih; 657 struct item_head * ih;
657 int pos_in_item; 658 int pos_in_item;
658 __u32 * item; 659 __le32 * item;
659 int ret = 0; 660 int ret = 0;
660 661
661 if (!hint->path) /* reiserfs code can call this function w/o pointer to path 662 if (!hint->path) /* reiserfs code can call this function w/o pointer to path
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index d1514a9b0514..fbde4b01a325 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -209,8 +209,8 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
209/* compose directory item containing "." and ".." entries (entries are 209/* compose directory item containing "." and ".." entries (entries are
210 not aligned to 4 byte boundary) */ 210 not aligned to 4 byte boundary) */
211/* the last four params are LE */ 211/* the last four params are LE */
212void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid, 212void make_empty_dir_item_v1 (char * body, __le32 dirid, __le32 objid,
213 __u32 par_dirid, __u32 par_objid) 213 __le32 par_dirid, __le32 par_objid)
214{ 214{
215 struct reiserfs_de_head * deh; 215 struct reiserfs_de_head * deh;
216 216
@@ -242,8 +242,8 @@ void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid,
242} 242}
243 243
244/* compose directory item containing "." and ".." entries */ 244/* compose directory item containing "." and ".." entries */
245void make_empty_dir_item (char * body, __u32 dirid, __u32 objid, 245void make_empty_dir_item (char * body, __le32 dirid, __le32 objid,
246 __u32 par_dirid, __u32 par_objid) 246 __le32 par_dirid, __le32 par_objid)
247{ 247{
248 struct reiserfs_de_head * deh; 248 struct reiserfs_de_head * deh;
249 249
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index f6860e83521d..2230afff1870 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -166,7 +166,7 @@ static int reiserfs_allocate_blocks_for_region(
166 struct cpu_key key; // cpu key of item that we are going to deal with 166 struct cpu_key key; // cpu key of item that we are going to deal with
167 struct item_head *ih; // pointer to item head that we are going to deal with 167 struct item_head *ih; // pointer to item head that we are going to deal with
168 struct buffer_head *bh; // Buffer head that contains items that we are going to deal with 168 struct buffer_head *bh; // Buffer head that contains items that we are going to deal with
169 __u32 * item; // pointer to item we are going to deal with 169 __le32 * item; // pointer to item we are going to deal with
170 INITIALIZE_PATH(path); // path to item, that we are going to deal with. 170 INITIALIZE_PATH(path); // path to item, that we are going to deal with.
171 b_blocknr_t *allocated_blocks; // Pointer to a place where allocated blocknumbers would be stored. 171 b_blocknr_t *allocated_blocks; // Pointer to a place where allocated blocknumbers would be stored.
172 reiserfs_blocknr_hint_t hint; // hint structure for block allocator. 172 reiserfs_blocknr_hint_t hint; // hint structure for block allocator.
@@ -891,7 +891,7 @@ static int reiserfs_prepare_file_region_for_write(
891 struct item_head *ih = NULL; // pointer to item head that we are going to deal with 891 struct item_head *ih = NULL; // pointer to item head that we are going to deal with
892 struct buffer_head *itembuf=NULL; // Buffer head that contains items that we are going to deal with 892 struct buffer_head *itembuf=NULL; // Buffer head that contains items that we are going to deal with
893 INITIALIZE_PATH(path); // path to item, that we are going to deal with. 893 INITIALIZE_PATH(path); // path to item, that we are going to deal with.
894 __u32 * item=NULL; // pointer to item we are going to deal with 894 __le32 * item=NULL; // pointer to item we are going to deal with
895 int item_pos=-1; /* Position in indirect item */ 895 int item_pos=-1; /* Position in indirect item */
896 896
897 897
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 7543031396f4..5fdb9f97b99e 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -173,7 +173,7 @@ static inline void fix_tail_page_for_writing(struct page *page) {
173 done already or non-hole position has been found in the indirect item */ 173 done already or non-hole position has been found in the indirect item */
174static inline int allocation_needed (int retval, b_blocknr_t allocated, 174static inline int allocation_needed (int retval, b_blocknr_t allocated,
175 struct item_head * ih, 175 struct item_head * ih,
176 __u32 * item, int pos_in_item) 176 __le32 * item, int pos_in_item)
177{ 177{
178 if (allocated) 178 if (allocated)
179 return 0; 179 return 0;
@@ -278,7 +278,7 @@ research:
278 bh = get_last_bh (&path); 278 bh = get_last_bh (&path);
279 ih = get_ih (&path); 279 ih = get_ih (&path);
280 if (is_indirect_le_ih (ih)) { 280 if (is_indirect_le_ih (ih)) {
281 __u32 * ind_item = (__u32 *)B_I_PITEM (bh, ih); 281 __le32 * ind_item = (__le32 *)B_I_PITEM (bh, ih);
282 282
283 /* FIXME: here we could cache indirect item or part of it in 283 /* FIXME: here we could cache indirect item or part of it in
284 the inode to avoid search_by_key in case of subsequent 284 the inode to avoid search_by_key in case of subsequent
@@ -581,7 +581,7 @@ int reiserfs_get_block (struct inode * inode, sector_t block,
581 struct cpu_key key; 581 struct cpu_key key;
582 struct buffer_head * bh, * unbh = NULL; 582 struct buffer_head * bh, * unbh = NULL;
583 struct item_head * ih, tmp_ih; 583 struct item_head * ih, tmp_ih;
584 __u32 * item; 584 __le32 * item;
585 int done; 585 int done;
586 int fs_gen; 586 int fs_gen;
587 struct reiserfs_transaction_handle *th = NULL; 587 struct reiserfs_transaction_handle *th = NULL;
@@ -746,7 +746,7 @@ start_trans:
746 done = 0; 746 done = 0;
747 do { 747 do {
748 if (is_statdata_le_ih (ih)) { 748 if (is_statdata_le_ih (ih)) {
749 __u32 unp = 0; 749 __le32 unp = 0;
750 struct cpu_key tmp_key; 750 struct cpu_key tmp_key;
751 751
752 /* indirect item has to be inserted */ 752 /* indirect item has to be inserted */
@@ -2067,7 +2067,7 @@ static int map_block_for_writepage(struct inode *inode,
2067 struct item_head tmp_ih ; 2067 struct item_head tmp_ih ;
2068 struct item_head *ih ; 2068 struct item_head *ih ;
2069 struct buffer_head *bh ; 2069 struct buffer_head *bh ;
2070 __u32 *item ; 2070 __le32 *item ;
2071 struct cpu_key key ; 2071 struct cpu_key key ;
2072 INITIALIZE_PATH(path) ; 2072 INITIALIZE_PATH(path) ;
2073 int pos_in_item ; 2073 int pos_in_item ;
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
index 9cf7c13b120d..0ce33db1acdf 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -296,10 +296,11 @@ static void print_sequence (__u32 start, int len)
296static void indirect_print_item (struct item_head * ih, char * item) 296static void indirect_print_item (struct item_head * ih, char * item)
297{ 297{
298 int j; 298 int j;
299 __u32 * unp, prev = INT_MAX; 299 __le32 * unp;
300 __u32 prev = INT_MAX;
300 int num; 301 int num;
301 302
302 unp = (__u32 *)item; 303 unp = (__le32 *)item;
303 304
304 if (ih_item_len(ih) % UNFM_P_SIZE) 305 if (ih_item_len(ih) % UNFM_P_SIZE)
305 reiserfs_warning (NULL, "indirect_print_item: invalid item len"); 306 reiserfs_warning (NULL, "indirect_print_item: invalid item len");
diff --git a/fs/reiserfs/objectid.c b/fs/reiserfs/objectid.c
index 0785c43a7486..bfe8e25ef293 100644
--- a/fs/reiserfs/objectid.c
+++ b/fs/reiserfs/objectid.c
@@ -11,13 +11,13 @@
11 11
12// find where objectid map starts 12// find where objectid map starts
13#define objectid_map(s,rs) (old_format_only (s) ? \ 13#define objectid_map(s,rs) (old_format_only (s) ? \
14 (__u32 *)((struct reiserfs_super_block_v1 *)(rs) + 1) :\ 14 (__le32 *)((struct reiserfs_super_block_v1 *)(rs) + 1) :\
15 (__u32 *)((rs) + 1)) 15 (__le32 *)((rs) + 1))
16 16
17 17
18#ifdef CONFIG_REISERFS_CHECK 18#ifdef CONFIG_REISERFS_CHECK
19 19
20static void check_objectid_map (struct super_block * s, __u32 * map) 20static void check_objectid_map (struct super_block * s, __le32 * map)
21{ 21{
22 if (le32_to_cpu (map[0]) != 1) 22 if (le32_to_cpu (map[0]) != 1)
23 reiserfs_panic (s, "vs-15010: check_objectid_map: map corrupted: %lx", 23 reiserfs_panic (s, "vs-15010: check_objectid_map: map corrupted: %lx",
@@ -27,7 +27,7 @@ static void check_objectid_map (struct super_block * s, __u32 * map)
27} 27}
28 28
29#else 29#else
30static void check_objectid_map (struct super_block * s, __u32 * map) 30static void check_objectid_map (struct super_block * s, __le32 * map)
31{;} 31{;}
32#endif 32#endif
33 33
@@ -52,7 +52,7 @@ __u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th)
52{ 52{
53 struct super_block * s = th->t_super; 53 struct super_block * s = th->t_super;
54 struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s); 54 struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
55 __u32 * map = objectid_map (s, rs); 55 __le32 * map = objectid_map (s, rs);
56 __u32 unused_objectid; 56 __u32 unused_objectid;
57 57
58 BUG_ON (!th->t_trans_id); 58 BUG_ON (!th->t_trans_id);
@@ -97,7 +97,7 @@ void reiserfs_release_objectid (struct reiserfs_transaction_handle *th,
97{ 97{
98 struct super_block * s = th->t_super; 98 struct super_block * s = th->t_super;
99 struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s); 99 struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
100 __u32 * map = objectid_map (s, rs); 100 __le32 * map = objectid_map (s, rs);
101 int i = 0; 101 int i = 0;
102 102
103 BUG_ON (!th->t_trans_id); 103 BUG_ON (!th->t_trans_id);
@@ -172,12 +172,12 @@ int reiserfs_convert_objectid_map_v1(struct super_block *s) {
172 int new_size = (s->s_blocksize - SB_SIZE) / sizeof(__u32) / 2 * 2 ; 172 int new_size = (s->s_blocksize - SB_SIZE) / sizeof(__u32) / 2 * 2 ;
173 int old_max = sb_oid_maxsize(disk_sb); 173 int old_max = sb_oid_maxsize(disk_sb);
174 struct reiserfs_super_block_v1 *disk_sb_v1 ; 174 struct reiserfs_super_block_v1 *disk_sb_v1 ;
175 __u32 *objectid_map, *new_objectid_map ; 175 __le32 *objectid_map, *new_objectid_map ;
176 int i ; 176 int i ;
177 177
178 disk_sb_v1=(struct reiserfs_super_block_v1 *)(SB_BUFFER_WITH_SB(s)->b_data); 178 disk_sb_v1=(struct reiserfs_super_block_v1 *)(SB_BUFFER_WITH_SB(s)->b_data);
179 objectid_map = (__u32 *)(disk_sb_v1 + 1) ; 179 objectid_map = (__le32 *)(disk_sb_v1 + 1) ;
180 new_objectid_map = (__u32 *)(disk_sb + 1) ; 180 new_objectid_map = (__le32 *)(disk_sb + 1) ;
181 181
182 if (cur_size > new_size) { 182 if (cur_size > new_size) {
183 /* mark everyone used that was listed as free at the end of the objectid 183 /* mark everyone used that was listed as free at the end of the objectid
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index f4ea81ae0e0f..e242ebc7f6f6 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -73,8 +73,8 @@ int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset,
73#define DFL( x ) D4C( rs -> s_v1.x ) 73#define DFL( x ) D4C( rs -> s_v1.x )
74 74
75#define objectid_map( s, rs ) (old_format_only (s) ? \ 75#define objectid_map( s, rs ) (old_format_only (s) ? \
76 (__u32 *)((struct reiserfs_super_block_v1 *)rs + 1) : \ 76 (__le32 *)((struct reiserfs_super_block_v1 *)rs + 1) : \
77 (__u32 *)(rs + 1)) 77 (__le32 *)(rs + 1))
78#define MAP( i ) D4C( objectid_map( sb, rs )[ i ] ) 78#define MAP( i ) D4C( objectid_map( sb, rs )[ i ] )
79 79
80#define DJF( x ) le32_to_cpu( rs -> x ) 80#define DJF( x ) le32_to_cpu( rs -> x )
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,
87inline int comp_short_keys (const struct reiserfs_key * le_key, 87inline 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;
228const struct reiserfs_key MIN_KEY = {0, 0, {{0, 0},}}; 229const 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. */
231const struct reiserfs_key MAX_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}}; 232const 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};
232const struct in_core_key MAX_IN_CORE_KEY = {0xffffffff, 0xffffffff, {{0xffffffff, 0xffffffff},}}; 238const 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;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index d6d1d7e2801f..2283f18aa1dc 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -216,7 +216,7 @@ static int finish_unfinished (struct super_block * s)
216 216
217 /* reiserfs_iget needs k_dirid and k_objectid only */ 217 /* reiserfs_iget needs k_dirid and k_objectid only */
218 item = B_I_PITEM (bh, ih); 218 item = B_I_PITEM (bh, ih);
219 obj_key.on_disk_key.k_dir_id = le32_to_cpu (*(__u32 *)item); 219 obj_key.on_disk_key.k_dir_id = le32_to_cpu (*(__le32 *)item);
220 obj_key.on_disk_key.k_objectid = le32_to_cpu (ih->ih_key.k_objectid); 220 obj_key.on_disk_key.k_objectid = le32_to_cpu (ih->ih_key.k_objectid);
221 obj_key.on_disk_key.u.k_offset_v1.k_offset = 0; 221 obj_key.on_disk_key.u.k_offset_v1.k_offset = 0;
222 obj_key.on_disk_key.u.k_offset_v1.k_uniqueness = 0; 222 obj_key.on_disk_key.u.k_offset_v1.k_uniqueness = 0;
@@ -304,7 +304,7 @@ void add_save_link (struct reiserfs_transaction_handle * th,
304 int retval; 304 int retval;
305 struct cpu_key key; 305 struct cpu_key key;
306 struct item_head ih; 306 struct item_head ih;
307 __u32 link; 307 __le32 link;
308 308
309 BUG_ON (!th->t_trans_id); 309 BUG_ON (!th->t_trans_id);
310 310
@@ -1336,7 +1336,7 @@ static int read_super_block (struct super_block * s, int offset)
1336 return 1; 1336 return 1;
1337 } 1337 }
1338 1338
1339 if ( rs->s_v1.s_root_block == -1 ) { 1339 if ( rs->s_v1.s_root_block == cpu_to_le32(-1) ) {
1340 brelse(bh) ; 1340 brelse(bh) ;
1341 reiserfs_warning (s, "Unfinished reiserfsck --rebuild-tree run detected. Please run\n" 1341 reiserfs_warning (s, "Unfinished reiserfsck --rebuild-tree run detected. Please run\n"
1342 "reiserfsck --rebuild-tree and wait for a completion. If that fails\n" 1342 "reiserfsck --rebuild-tree and wait for a completion. If that fails\n"
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index a57e973af0bd..2aef9c3f5ce8 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -5,18 +5,18 @@
5#define REISERFS_ACL_VERSION 0x0001 5#define REISERFS_ACL_VERSION 0x0001
6 6
7typedef struct { 7typedef struct {
8 __u16 e_tag; 8 __le16 e_tag;
9 __u16 e_perm; 9 __le16 e_perm;
10 __u32 e_id; 10 __le32 e_id;
11} reiserfs_acl_entry; 11} reiserfs_acl_entry;
12 12
13typedef struct { 13typedef struct {
14 __u16 e_tag; 14 __le16 e_tag;
15 __u16 e_perm; 15 __le16 e_perm;
16} reiserfs_acl_entry_short; 16} reiserfs_acl_entry_short;
17 17
18typedef struct { 18typedef struct {
19 __u32 a_version; 19 __le32 a_version;
20} reiserfs_acl_header; 20} reiserfs_acl_header;
21 21
22static inline size_t reiserfs_acl_size(int count) 22static inline size_t reiserfs_acl_size(int count)
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index d0867873a1b5..cc39c5305b80 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -114,47 +114,47 @@ if( !( cond ) ) \
114 114
115 115
116struct journal_params { 116struct journal_params {
117 __u32 jp_journal_1st_block; /* where does journal start from on its 117 __le32 jp_journal_1st_block; /* where does journal start from on its
118 * device */ 118 * device */
119 __u32 jp_journal_dev; /* journal device st_rdev */ 119 __le32 jp_journal_dev; /* journal device st_rdev */
120 __u32 jp_journal_size; /* size of the journal */ 120 __le32 jp_journal_size; /* size of the journal */
121 __u32 jp_journal_trans_max; /* max number of blocks in a transaction. */ 121 __le32 jp_journal_trans_max; /* max number of blocks in a transaction. */
122 __u32 jp_journal_magic; /* random value made on fs creation (this 122 __le32 jp_journal_magic; /* random value made on fs creation (this
123 * was sb_journal_block_count) */ 123 * was sb_journal_block_count) */
124 __u32 jp_journal_max_batch; /* max number of blocks to batch into a 124 __le32 jp_journal_max_batch; /* max number of blocks to batch into a
125 * trans */ 125 * trans */
126 __u32 jp_journal_max_commit_age; /* in seconds, how old can an async 126 __le32 jp_journal_max_commit_age; /* in seconds, how old can an async
127 * commit be */ 127 * commit be */
128 __u32 jp_journal_max_trans_age; /* in seconds, how old can a transaction 128 __le32 jp_journal_max_trans_age; /* in seconds, how old can a transaction
129 * be */ 129 * be */
130}; 130};
131 131
132/* this is the super from 3.5.X, where X >= 10 */ 132/* this is the super from 3.5.X, where X >= 10 */
133struct reiserfs_super_block_v1 133struct reiserfs_super_block_v1
134{ 134{
135 __u32 s_block_count; /* blocks count */ 135 __le32 s_block_count; /* blocks count */
136 __u32 s_free_blocks; /* free blocks count */ 136 __le32 s_free_blocks; /* free blocks count */
137 __u32 s_root_block; /* root block number */ 137 __le32 s_root_block; /* root block number */
138 struct journal_params s_journal; 138 struct journal_params s_journal;
139 __u16 s_blocksize; /* block size */ 139 __le16 s_blocksize; /* block size */
140 __u16 s_oid_maxsize; /* max size of object id array, see 140 __le16 s_oid_maxsize; /* max size of object id array, see
141 * get_objectid() commentary */ 141 * get_objectid() commentary */
142 __u16 s_oid_cursize; /* current size of object id array */ 142 __le16 s_oid_cursize; /* current size of object id array */
143 __u16 s_umount_state; /* this is set to 1 when filesystem was 143 __le16 s_umount_state; /* this is set to 1 when filesystem was
144 * umounted, to 2 - when not */ 144 * umounted, to 2 - when not */
145 char s_magic[10]; /* reiserfs magic string indicates that 145 char s_magic[10]; /* reiserfs magic string indicates that
146 * file system is reiserfs: 146 * file system is reiserfs:
147 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */ 147 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */
148 __u16 s_fs_state; /* it is set to used by fsck to mark which 148 __le16 s_fs_state; /* it is set to used by fsck to mark which
149 * phase of rebuilding is done */ 149 * phase of rebuilding is done */
150 __u32 s_hash_function_code; /* indicate, what hash function is being use 150 __le32 s_hash_function_code; /* indicate, what hash function is being use
151 * to sort names in a directory*/ 151 * to sort names in a directory*/
152 __u16 s_tree_height; /* height of disk tree */ 152 __le16 s_tree_height; /* height of disk tree */
153 __u16 s_bmap_nr; /* amount of bitmap blocks needed to address 153 __le16 s_bmap_nr; /* amount of bitmap blocks needed to address
154 * each block of file system */ 154 * each block of file system */
155 __u16 s_version; /* this field is only reliable on filesystem 155 __le16 s_version; /* this field is only reliable on filesystem
156 * with non-standard journal */ 156 * with non-standard journal */
157 __u16 s_reserved_for_journal; /* size in blocks of journal area on main 157 __le16 s_reserved_for_journal; /* size in blocks of journal area on main
158 * device, we need to keep after 158 * device, we need to keep after
159 * making fs with non-standard journal */ 159 * making fs with non-standard journal */
160} __attribute__ ((__packed__)); 160} __attribute__ ((__packed__));
@@ -165,8 +165,8 @@ struct reiserfs_super_block_v1
165struct reiserfs_super_block 165struct reiserfs_super_block
166{ 166{
167 struct reiserfs_super_block_v1 s_v1; 167 struct reiserfs_super_block_v1 s_v1;
168 __u32 s_inode_generation; 168 __le32 s_inode_generation;
169 __u32 s_flags; /* Right now used only by inode-attributes, if enabled */ 169 __le32 s_flags; /* Right now used only by inode-attributes, if enabled */
170 unsigned char s_uuid[16]; /* filesystem unique identifier */ 170 unsigned char s_uuid[16]; /* filesystem unique identifier */
171 unsigned char s_label[16]; /* filesystem volume label */ 171 unsigned char s_label[16]; /* filesystem volume label */
172 char s_unused[88] ; /* zero filled by mkreiserfs and 172 char s_unused[88] ; /* zero filled by mkreiserfs and
@@ -269,7 +269,7 @@ int is_reiserfs_jr (struct reiserfs_super_block * rs);
269#define QUOTA_EXCEEDED -6 269#define QUOTA_EXCEEDED -6
270 270
271typedef __u32 b_blocknr_t; 271typedef __u32 b_blocknr_t;
272typedef __u32 unp_t; 272typedef __le32 unp_t;
273 273
274struct unfm_nodeinfo { 274struct unfm_nodeinfo {
275 unp_t unfm_nodenum; 275 unp_t unfm_nodenum;
@@ -376,8 +376,8 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
376// directories use this key as well as old files 376// directories use this key as well as old files
377// 377//
378struct offset_v1 { 378struct offset_v1 {
379 __u32 k_offset; 379 __le32 k_offset;
380 __u32 k_uniqueness; 380 __le32 k_uniqueness;
381} __attribute__ ((__packed__)); 381} __attribute__ ((__packed__));
382 382
383struct offset_v2 { 383struct offset_v2 {
@@ -453,9 +453,9 @@ struct in_core_offset_v2 {
453/* Key of an item determines its location in the S+tree, and 453/* Key of an item determines its location in the S+tree, and
454 is composed of 4 components */ 454 is composed of 4 components */
455struct reiserfs_key { 455struct reiserfs_key {
456 __u32 k_dir_id; /* packing locality: by default parent 456 __le32 k_dir_id; /* packing locality: by default parent
457 directory object id */ 457 directory object id */
458 __u32 k_objectid; /* object identifier */ 458 __le32 k_objectid; /* object identifier */
459 union { 459 union {
460 struct offset_v1 k_offset_v1; 460 struct offset_v1 k_offset_v1;
461 struct offset_v2 k_offset_v2; 461 struct offset_v2 k_offset_v2;
@@ -534,15 +534,15 @@ struct item_head
534 item. Note that the key, not this field, is used to 534 item. Note that the key, not this field, is used to
535 determine the item type, and thus which field this 535 determine the item type, and thus which field this
536 union contains. */ 536 union contains. */
537 __u16 ih_free_space_reserved; 537 __le16 ih_free_space_reserved;
538 /* Iff this is a directory item, this field equals the 538 /* Iff this is a directory item, this field equals the
539 number of directory entries in the directory item. */ 539 number of directory entries in the directory item. */
540 __u16 ih_entry_count; 540 __le16 ih_entry_count;
541 } __attribute__ ((__packed__)) u; 541 } __attribute__ ((__packed__)) u;
542 __u16 ih_item_len; /* total size of the item body */ 542 __le16 ih_item_len; /* total size of the item body */
543 __u16 ih_item_location; /* an offset to the item body 543 __le16 ih_item_location; /* an offset to the item body
544 * within the block */ 544 * within the block */
545 __u16 ih_version; /* 0 for all old items, 2 for new 545 __le16 ih_version; /* 0 for all old items, 2 for new
546 ones. Highest bit is set by fsck 546 ones. Highest bit is set by fsck
547 temporary, cleaned after all 547 temporary, cleaned after all
548 done */ 548 done */
@@ -778,10 +778,10 @@ extern struct reiserfs_key root_key;
778/* Header of a disk block. More precisely, header of a formatted leaf 778/* Header of a disk block. More precisely, header of a formatted leaf
779 or internal node, and not the header of an unformatted node. */ 779 or internal node, and not the header of an unformatted node. */
780struct block_head { 780struct block_head {
781 __u16 blk_level; /* Level of a block in the tree. */ 781 __le16 blk_level; /* Level of a block in the tree. */
782 __u16 blk_nr_item; /* Number of keys/items in a block. */ 782 __le16 blk_nr_item; /* Number of keys/items in a block. */
783 __u16 blk_free_space; /* Block free space in bytes. */ 783 __le16 blk_free_space; /* Block free space in bytes. */
784 __u16 blk_reserved; 784 __le16 blk_reserved;
785 /* dump this in v4/planA */ 785 /* dump this in v4/planA */
786 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */ 786 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */
787}; 787};
@@ -845,19 +845,19 @@ struct block_head {
845// 845//
846struct stat_data_v1 846struct stat_data_v1
847{ 847{
848 __u16 sd_mode; /* file type, permissions */ 848 __le16 sd_mode; /* file type, permissions */
849 __u16 sd_nlink; /* number of hard links */ 849 __le16 sd_nlink; /* number of hard links */
850 __u16 sd_uid; /* owner */ 850 __le16 sd_uid; /* owner */
851 __u16 sd_gid; /* group */ 851 __le16 sd_gid; /* group */
852 __u32 sd_size; /* file size */ 852 __le32 sd_size; /* file size */
853 __u32 sd_atime; /* time of last access */ 853 __le32 sd_atime; /* time of last access */
854 __u32 sd_mtime; /* time file was last modified */ 854 __le32 sd_mtime; /* time file was last modified */
855 __u32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 855 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
856 union { 856 union {
857 __u32 sd_rdev; 857 __le32 sd_rdev;
858 __u32 sd_blocks; /* number of blocks file uses */ 858 __le32 sd_blocks; /* number of blocks file uses */
859 } __attribute__ ((__packed__)) u; 859 } __attribute__ ((__packed__)) u;
860 __u32 sd_first_direct_byte; /* first byte of file which is stored 860 __le32 sd_first_direct_byte; /* first byte of file which is stored
861 in a direct item: except that if it 861 in a direct item: except that if it
862 equals 1 it is a symlink and if it 862 equals 1 it is a symlink and if it
863 equals ~(__u32)0 there is no 863 equals ~(__u32)0 there is no
@@ -923,20 +923,20 @@ struct stat_data_v1
923/* Stat Data on disk (reiserfs version of UFS disk inode minus the 923/* Stat Data on disk (reiserfs version of UFS disk inode minus the
924 address blocks) */ 924 address blocks) */
925struct stat_data { 925struct stat_data {
926 __u16 sd_mode; /* file type, permissions */ 926 __le16 sd_mode; /* file type, permissions */
927 __u16 sd_attrs; /* persistent inode flags */ 927 __le16 sd_attrs; /* persistent inode flags */
928 __u32 sd_nlink; /* number of hard links */ 928 __le32 sd_nlink; /* number of hard links */
929 __u64 sd_size; /* file size */ 929 __le64 sd_size; /* file size */
930 __u32 sd_uid; /* owner */ 930 __le32 sd_uid; /* owner */
931 __u32 sd_gid; /* group */ 931 __le32 sd_gid; /* group */
932 __u32 sd_atime; /* time of last access */ 932 __le32 sd_atime; /* time of last access */
933 __u32 sd_mtime; /* time file was last modified */ 933 __le32 sd_mtime; /* time file was last modified */
934 __u32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 934 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
935 __u32 sd_blocks; 935 __le32 sd_blocks;
936 union { 936 union {
937 __u32 sd_rdev; 937 __le32 sd_rdev;
938 __u32 sd_generation; 938 __le32 sd_generation;
939 //__u32 sd_first_direct_byte; 939 //__le32 sd_first_direct_byte;
940 /* first byte of file which is stored in a 940 /* first byte of file which is stored in a
941 direct item: except that if it equals 1 941 direct item: except that if it equals 1
942 it is a symlink and if it equals 942 it is a symlink and if it equals
@@ -1019,12 +1019,12 @@ struct stat_data {
1019 1019
1020struct reiserfs_de_head 1020struct reiserfs_de_head
1021{ 1021{
1022 __u32 deh_offset; /* third component of the directory entry key */ 1022 __le32 deh_offset; /* third component of the directory entry key */
1023 __u32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced 1023 __le32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced
1024 by directory entry */ 1024 by directory entry */
1025 __u32 deh_objectid; /* objectid of the object, that is referenced by directory entry */ 1025 __le32 deh_objectid; /* objectid of the object, that is referenced by directory entry */
1026 __u16 deh_location; /* offset of name in the whole item */ 1026 __le16 deh_location; /* offset of name in the whole item */
1027 __u16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether 1027 __le16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether
1028 entry is hidden (unlinked) */ 1028 entry is hidden (unlinked) */
1029} __attribute__ ((__packed__)); 1029} __attribute__ ((__packed__));
1030#define DEH_SIZE sizeof(struct reiserfs_de_head) 1030#define DEH_SIZE sizeof(struct reiserfs_de_head)
@@ -1084,10 +1084,10 @@ struct reiserfs_de_head
1084#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 1084#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1085#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 1085#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1086 1086
1087extern void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid, 1087extern void make_empty_dir_item_v1 (char * body, __le32 dirid, __le32 objid,
1088 __u32 par_dirid, __u32 par_objid); 1088 __le32 par_dirid, __le32 par_objid);
1089extern void make_empty_dir_item (char * body, __u32 dirid, __u32 objid, 1089extern void make_empty_dir_item (char * body, __le32 dirid, __le32 objid,
1090 __u32 par_dirid, __u32 par_objid); 1090 __le32 par_dirid, __le32 par_objid);
1091 1091
1092/* array of the entry headers */ 1092/* array of the entry headers */
1093 /* get item body */ 1093 /* get item body */
@@ -1186,9 +1186,9 @@ struct reiserfs_dir_entry
1186/* Disk child pointer: The pointer from an internal node of the tree 1186/* Disk child pointer: The pointer from an internal node of the tree
1187 to a node that is on disk. */ 1187 to a node that is on disk. */
1188struct disk_child { 1188struct disk_child {
1189 __u32 dc_block_number; /* Disk child's block number. */ 1189 __le32 dc_block_number; /* Disk child's block number. */
1190 __u16 dc_size; /* Disk child's used space. */ 1190 __le16 dc_size; /* Disk child's used space. */
1191 __u16 dc_reserved; 1191 __le16 dc_reserved;
1192}; 1192};
1193 1193
1194#define DC_SIZE (sizeof(struct disk_child)) 1194#define DC_SIZE (sizeof(struct disk_child))
@@ -1656,10 +1656,10 @@ struct reiserfs_iget_args {
1656 1656
1657/* first block written in a commit. */ 1657/* first block written in a commit. */
1658struct reiserfs_journal_desc { 1658struct reiserfs_journal_desc {
1659 __u32 j_trans_id ; /* id of commit */ 1659 __le32 j_trans_id ; /* id of commit */
1660 __u32 j_len ; /* length of commit. len +1 is the commit block */ 1660 __le32 j_len ; /* length of commit. len +1 is the commit block */
1661 __u32 j_mount_id ; /* mount id of this trans*/ 1661 __le32 j_mount_id ; /* mount id of this trans*/
1662 __u32 j_realblock[1] ; /* real locations for each block */ 1662 __le32 j_realblock[1] ; /* real locations for each block */
1663} ; 1663} ;
1664 1664
1665#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id) 1665#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id)
@@ -1672,9 +1672,9 @@ struct reiserfs_journal_desc {
1672 1672
1673/* last block written in a commit */ 1673/* last block written in a commit */
1674struct reiserfs_journal_commit { 1674struct reiserfs_journal_commit {
1675 __u32 j_trans_id ; /* must match j_trans_id from the desc block */ 1675 __le32 j_trans_id ; /* must match j_trans_id from the desc block */
1676 __u32 j_len ; /* ditto */ 1676 __le32 j_len ; /* ditto */
1677 __u32 j_realblock[1] ; /* real locations for each block */ 1677 __le32 j_realblock[1] ; /* real locations for each block */
1678} ; 1678} ;
1679 1679
1680#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id) 1680#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id)
@@ -1689,9 +1689,9 @@ struct reiserfs_journal_commit {
1689** and this transaction does not need to be replayed. 1689** and this transaction does not need to be replayed.
1690*/ 1690*/
1691struct reiserfs_journal_header { 1691struct reiserfs_journal_header {
1692 __u32 j_last_flush_trans_id ; /* id of last fully flushed transaction */ 1692 __le32 j_last_flush_trans_id ; /* id of last fully flushed transaction */
1693 __u32 j_first_unflushed_offset ; /* offset in the log of where to start replay after a crash */ 1693 __le32 j_first_unflushed_offset ; /* offset in the log of where to start replay after a crash */
1694 __u32 j_mount_id ; 1694 __le32 j_mount_id ;
1695 /* 12 */ struct journal_params jh_journal; 1695 /* 12 */ struct journal_params jh_journal;
1696} ; 1696} ;
1697 1697
@@ -2170,7 +2170,7 @@ void reiserfs_init_alloc_options (struct super_block *s);
2170 * to use for a new object underneat it. The locality is returned 2170 * to use for a new object underneat it. The locality is returned
2171 * in disk byte order (le). 2171 * in disk byte order (le).
2172 */ 2172 */
2173u32 reiserfs_choose_packing(struct inode *dir); 2173__le32 reiserfs_choose_packing(struct inode *dir);
2174 2174
2175int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value); 2175int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value);
2176void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted); 2176void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted);
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 1eaa48eca811..9244c5748820 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -10,8 +10,8 @@
10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ 10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
11 11
12struct reiserfs_xattr_header { 12struct reiserfs_xattr_header {
13 __u32 h_magic; /* magic number for identification */ 13 __le32 h_magic; /* magic number for identification */
14 __u32 h_hash; /* hash of the value */ 14 __le32 h_hash; /* hash of the value */
15}; 15};
16 16
17#ifdef __KERNEL__ 17#ifdef __KERNEL__