Commit a7fb1571 authored by Ben Fennema's avatar Ben Fennema Committed by Linus Torvalds

[PATCH] udf patch for 2.5.7-pre1 (part 1/4)

This patch adds some missing byte swaps needed for big endian archs.
parent 597db13e
...@@ -1053,11 +1053,11 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) ...@@ -1053,11 +1053,11 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
UDF_I_LENALLOC(inode) = 0; UDF_I_LENALLOC(inode) = 0;
UDF_I_NEXT_ALLOC_BLOCK(inode) = 0; UDF_I_NEXT_ALLOC_BLOCK(inode) = 0;
UDF_I_NEXT_ALLOC_GOAL(inode) = 0; UDF_I_NEXT_ALLOC_GOAL(inode) = 0;
if (fe->descTag.tagIdent == TID_EXTENDED_FILE_ENTRY) if (le16_to_cpu(fe->descTag.tagIdent) == TID_EXTENDED_FILE_ENTRY)
UDF_I_EXTENDED_FE(inode) = 1; UDF_I_EXTENDED_FE(inode) = 1;
else if (fe->descTag.tagIdent == TID_FILE_ENTRY) else if (le16_to_cpu(fe->descTag.tagIdent) == TID_FILE_ENTRY)
UDF_I_EXTENDED_FE(inode) = 0; UDF_I_EXTENDED_FE(inode) = 0;
else if (fe->descTag.tagIdent == TID_UNALLOCATED_SPACE_ENTRY) else if (le16_to_cpu(fe->descTag.tagIdent) == TID_UNALLOCATED_SPACE_ENTRY)
{ {
UDF_I_LENALLOC(inode) = UDF_I_LENALLOC(inode) =
le32_to_cpu( le32_to_cpu(
...@@ -1341,7 +1341,7 @@ udf_update_inode(struct inode *inode, int do_sync) ...@@ -1341,7 +1341,7 @@ udf_update_inode(struct inode *inode, int do_sync)
UDF_I_NEW_INODE(inode) = 0; UDF_I_NEW_INODE(inode) = 0;
} }
if (fe->descTag.tagIdent == TID_UNALLOCATED_SPACE_ENTRY) if (le16_to_cpu(fe->descTag.tagIdent) == TID_UNALLOCATED_SPACE_ENTRY)
{ {
struct UnallocatedSpaceEntry *use = struct UnallocatedSpaceEntry *use =
(struct UnallocatedSpaceEntry *)bh->b_data; (struct UnallocatedSpaceEntry *)bh->b_data;
...@@ -1831,7 +1831,7 @@ Sint8 udf_next_aext(struct inode *inode, lb_addr *bloc, int *extoffset, ...@@ -1831,7 +1831,7 @@ Sint8 udf_next_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
} }
} }
tagIdent = ((tag *)(*bh)->b_data)->tagIdent; tagIdent = le16_to_cpu(((tag *)(*bh)->b_data)->tagIdent);
if (!memcmp(&UDF_I_LOCATION(inode), bloc, sizeof(lb_addr))) if (!memcmp(&UDF_I_LOCATION(inode), bloc, sizeof(lb_addr)))
{ {
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
#define UDF_SB_LASTBLOCK(X) ( UDF_SB(X)->s_lastblock ) #define UDF_SB_LASTBLOCK(X) ( UDF_SB(X)->s_lastblock )
#define UDF_SB_LVIDBH(X) ( UDF_SB(X)->s_lvidbh ) #define UDF_SB_LVIDBH(X) ( UDF_SB(X)->s_lvidbh )
#define UDF_SB_LVID(X) ( (struct LogicalVolIntegrityDesc *)UDF_SB_LVIDBH(X)->b_data ) #define UDF_SB_LVID(X) ( (struct LogicalVolIntegrityDesc *)UDF_SB_LVIDBH(X)->b_data )
#define UDF_SB_LVIDIU(X) ( (struct LogicalVolIntegrityDescImpUse *)&(UDF_SB_LVID(X)->impUse[UDF_SB_LVID(X)->numOfPartitions * 2 * sizeof(Uint32)/sizeof(Uint8)]) ) #define UDF_SB_LVIDIU(X) ( (struct LogicalVolIntegrityDescImpUse *)&(UDF_SB_LVID(X)->impUse[le32_to_cpu(UDF_SB_LVID(X)->numOfPartitions) * 2 * sizeof(Uint32)/sizeof(Uint8)]) )
#define UDF_SB_UMASK(X) ( UDF_SB(X)->s_umask ) #define UDF_SB_UMASK(X) ( UDF_SB(X)->s_umask )
#define UDF_SB_GID(X) ( UDF_SB(X)->s_gid ) #define UDF_SB_GID(X) ( UDF_SB(X)->s_gid )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment