diff options
author | Al Viro <viro@www.linux.org.uk> | 2005-05-01 11:59:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:59:17 -0400 |
commit | 6a3a16f2ef6f335286e2b2bf8284b0ab4ff38ec0 (patch) | |
tree | ae559ba5915bf0ca29d6d5dfbd9f44e666f388ea /include/linux/reiserfs_fs.h | |
parent | d46aa455dd5457fdbebad17db4ff4df655cbfbae (diff) |
[PATCH] reiserfs endianness: clone struct reiserfs_key
struct reiserfs_key cloned; (currently) identical struct in_core_key added.
Places that expect host-endian data in reiserfs_key switched to in_core_key.
Basically, we get annotation of reiserfs_key users and keep the resulting tree
obviously equivalent to original.
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 'include/linux/reiserfs_fs.h')
-rw-r--r-- | include/linux/reiserfs_fs.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index bccff8b17dc4..d0867873a1b5 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -433,6 +433,23 @@ static inline void set_offset_v2_k_offset( struct offset_v2 *v2, loff_t offset ) | |||
433 | # define set_offset_v2_k_offset(v2,val) (offset_v2_k_offset(v2) = (val)) | 433 | # define set_offset_v2_k_offset(v2,val) (offset_v2_k_offset(v2) = (val)) |
434 | #endif | 434 | #endif |
435 | 435 | ||
436 | struct in_core_offset_v1 { | ||
437 | __u32 k_offset; | ||
438 | __u32 k_uniqueness; | ||
439 | } __attribute__ ((__packed__)); | ||
440 | |||
441 | struct in_core_offset_v2 { | ||
442 | #ifdef __LITTLE_ENDIAN | ||
443 | /* little endian version */ | ||
444 | __u64 k_offset:60; | ||
445 | __u64 k_type: 4; | ||
446 | #else | ||
447 | /* big endian version */ | ||
448 | __u64 k_type: 4; | ||
449 | __u64 k_offset:60; | ||
450 | #endif | ||
451 | } __attribute__ ((__packed__)); | ||
452 | |||
436 | /* 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 |
437 | is composed of 4 components */ | 454 | is composed of 4 components */ |
438 | struct reiserfs_key { | 455 | struct reiserfs_key { |
@@ -445,9 +462,18 @@ struct reiserfs_key { | |||
445 | } __attribute__ ((__packed__)) u; | 462 | } __attribute__ ((__packed__)) u; |
446 | } __attribute__ ((__packed__)); | 463 | } __attribute__ ((__packed__)); |
447 | 464 | ||
465 | struct in_core_key { | ||
466 | __u32 k_dir_id; /* packing locality: by default parent | ||
467 | directory object id */ | ||
468 | __u32 k_objectid; /* object identifier */ | ||
469 | union { | ||
470 | struct in_core_offset_v1 k_offset_v1; | ||
471 | struct in_core_offset_v2 k_offset_v2; | ||
472 | } __attribute__ ((__packed__)) u; | ||
473 | } __attribute__ ((__packed__)); | ||
448 | 474 | ||
449 | struct cpu_key { | 475 | struct cpu_key { |
450 | struct reiserfs_key on_disk_key; | 476 | struct in_core_key on_disk_key; |
451 | int version; | 477 | int version; |
452 | int key_length; /* 3 in all cases but direct2indirect and | 478 | int key_length; /* 3 in all cases but direct2indirect and |
453 | indirect2direct conversion */ | 479 | indirect2direct conversion */ |
@@ -1476,7 +1502,7 @@ struct tree_balance | |||
1476 | int fs_gen; /* saved value of `reiserfs_generation' counter | 1502 | int fs_gen; /* saved value of `reiserfs_generation' counter |
1477 | see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */ | 1503 | see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */ |
1478 | #ifdef DISPLACE_NEW_PACKING_LOCALITIES | 1504 | #ifdef DISPLACE_NEW_PACKING_LOCALITIES |
1479 | struct reiserfs_key key; /* key pointer, to pass to block allocator or | 1505 | struct in_core_key key; /* key pointer, to pass to block allocator or |
1480 | another low-level subsystem */ | 1506 | another low-level subsystem */ |
1481 | #endif | 1507 | #endif |
1482 | } ; | 1508 | } ; |
@@ -2117,7 +2143,7 @@ struct buffer_head * get_FEB (struct tree_balance *); | |||
2117 | struct __reiserfs_blocknr_hint { | 2143 | struct __reiserfs_blocknr_hint { |
2118 | struct inode * inode; /* inode passed to allocator, if we allocate unf. nodes */ | 2144 | struct inode * inode; /* inode passed to allocator, if we allocate unf. nodes */ |
2119 | long block; /* file offset, in blocks */ | 2145 | long block; /* file offset, in blocks */ |
2120 | struct reiserfs_key key; | 2146 | struct in_core_key key; |
2121 | struct path * path; /* search path, used by allocator to deternine search_start by | 2147 | struct path * path; /* search path, used by allocator to deternine search_start by |
2122 | * various ways */ | 2148 | * various ways */ |
2123 | struct reiserfs_transaction_handle * th; /* transaction handle is needed to log super blocks and | 2149 | struct reiserfs_transaction_handle * th; /* transaction handle is needed to log super blocks and |