Commit 58a618cf authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] udf endianness annotations

That one was slightly messier than ext2 - several data structures had
been used both in little-endian (on-disk) and host-endian (in-core)
situations.  They had to be split, the rest was trivial annotations. 

Gets UDF sparse-clean with -Wbitwise.  Note that here we just annotate -
bug fixes from the original version of that patch had already been
merged.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 380768f5
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define xleNUM_to_cpup(x,y) (le ## x ## _to_cpup(y)) #define xleNUM_to_cpup(x,y) (le ## x ## _to_cpup(y))
#define uintBPL_t uint(BITS_PER_LONG) #define uintBPL_t uint(BITS_PER_LONG)
#define uint(x) xuint(x) #define uint(x) xuint(x)
#define xuint(x) uint ## x ## _t #define xuint(x) __le ## x
extern inline int find_next_one_bit (void * addr, int size, int offset) extern inline int find_next_one_bit (void * addr, int size, int offset)
{ {
...@@ -91,7 +91,7 @@ static int read_block_bitmap(struct super_block * sb, ...@@ -91,7 +91,7 @@ static int read_block_bitmap(struct super_block * sb,
{ {
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
int retval = 0; int retval = 0;
lb_addr loc; kernel_lb_addr loc;
loc.logicalBlockNum = bitmap->s_extPosition; loc.logicalBlockNum = bitmap->s_extPosition;
loc.partitionReferenceNum = UDF_SB_PARTITION(sb); loc.partitionReferenceNum = UDF_SB_PARTITION(sb);
...@@ -145,7 +145,8 @@ static inline int load_block_bitmap(struct super_block * sb, ...@@ -145,7 +145,8 @@ static inline int load_block_bitmap(struct super_block * sb,
static void udf_bitmap_free_blocks(struct super_block * sb, static void udf_bitmap_free_blocks(struct super_block * sb,
struct inode * inode, struct inode * inode,
struct udf_bitmap *bitmap, lb_addr bloc, uint32_t offset, uint32_t count) struct udf_bitmap *bitmap,
kernel_lb_addr bloc, uint32_t offset, uint32_t count)
{ {
struct buffer_head * bh = NULL; struct buffer_head * bh = NULL;
unsigned long block; unsigned long block;
...@@ -424,11 +425,12 @@ static int udf_bitmap_new_block(struct super_block * sb, ...@@ -424,11 +425,12 @@ static int udf_bitmap_new_block(struct super_block * sb,
static void udf_table_free_blocks(struct super_block * sb, static void udf_table_free_blocks(struct super_block * sb,
struct inode * inode, struct inode * inode,
struct inode * table, lb_addr bloc, uint32_t offset, uint32_t count) struct inode * table,
kernel_lb_addr bloc, uint32_t offset, uint32_t count)
{ {
uint32_t start, end; uint32_t start, end;
uint32_t nextoffset, oextoffset, elen; uint32_t nextoffset, oextoffset, elen;
lb_addr nbloc, obloc, eloc; kernel_lb_addr nbloc, obloc, eloc;
struct buffer_head *obh, *nbh; struct buffer_head *obh, *nbh;
int8_t etype; int8_t etype;
int i; int i;
...@@ -678,7 +680,7 @@ static int udf_table_prealloc_blocks(struct super_block * sb, ...@@ -678,7 +680,7 @@ static int udf_table_prealloc_blocks(struct super_block * sb,
{ {
int alloc_count = 0; int alloc_count = 0;
uint32_t extoffset, elen, adsize; uint32_t extoffset, elen, adsize;
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
struct buffer_head *bh; struct buffer_head *bh;
int8_t etype = -1; int8_t etype = -1;
...@@ -748,7 +750,7 @@ static int udf_table_new_block(struct super_block * sb, ...@@ -748,7 +750,7 @@ static int udf_table_new_block(struct super_block * sb,
uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF; uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF;
uint32_t newblock = 0, adsize; uint32_t newblock = 0, adsize;
uint32_t extoffset, goal_extoffset, elen, goal_elen = 0; uint32_t extoffset, goal_extoffset, elen, goal_elen = 0;
lb_addr bloc, goal_bloc, eloc, goal_eloc; kernel_lb_addr bloc, goal_bloc, eloc, goal_eloc;
struct buffer_head *bh, *goal_bh; struct buffer_head *bh, *goal_bh;
int8_t etype; int8_t etype;
...@@ -854,7 +856,7 @@ static int udf_table_new_block(struct super_block * sb, ...@@ -854,7 +856,7 @@ static int udf_table_new_block(struct super_block * sb,
inline void udf_free_blocks(struct super_block * sb, inline void udf_free_blocks(struct super_block * sb,
struct inode * inode, struct inode * inode,
lb_addr bloc, uint32_t offset, uint32_t count) kernel_lb_addr bloc, uint32_t offset, uint32_t count)
{ {
uint16_t partition = bloc.partitionReferenceNum; uint16_t partition = bloc.partitionReferenceNum;
......
...@@ -117,7 +117,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d ...@@ -117,7 +117,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
uint8_t lfi; uint8_t lfi;
loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2; loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
struct buffer_head * bh = NULL, * tmp, * bha[16]; struct buffer_head * bh = NULL, * tmp, * bha[16];
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset; uint32_t extoffset, elen, offset;
int i, num; int i, num;
unsigned int dt_type; unsigned int dt_type;
...@@ -237,7 +237,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d ...@@ -237,7 +237,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
} }
else else
{ {
lb_addr tloc = lelb_to_cpu(cfi.icb.extLocation); kernel_lb_addr tloc = lelb_to_cpu(cfi.icb.extLocation);
iblock = udf_get_lb_pblock(dir->i_sb, tloc, 0); iblock = udf_get_lb_pblock(dir->i_sb, tloc, 0);
flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi); flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#if 0 #if 0
static uint8_t * static uint8_t *
udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size, udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
lb_addr fe_loc, int *pos, int *offset, kernel_lb_addr fe_loc, int *pos, int *offset,
struct buffer_head **bh, int *error) struct buffer_head **bh, int *error)
{ {
int loffset = *offset; int loffset = *offset;
...@@ -80,8 +80,8 @@ struct fileIdentDesc * ...@@ -80,8 +80,8 @@ struct fileIdentDesc *
udf_fileident_read(struct inode *dir, loff_t *nf_pos, udf_fileident_read(struct inode *dir, loff_t *nf_pos,
struct udf_fileident_bh *fibh, struct udf_fileident_bh *fibh,
struct fileIdentDesc *cfi, struct fileIdentDesc *cfi,
lb_addr *bloc, uint32_t *extoffset, kernel_lb_addr *bloc, uint32_t *extoffset,
lb_addr *eloc, uint32_t *elen, kernel_lb_addr *eloc, uint32_t *elen,
uint32_t *offset, struct buffer_head **bh) uint32_t *offset, struct buffer_head **bh)
{ {
struct fileIdentDesc *fi; struct fileIdentDesc *fi;
......
...@@ -58,6 +58,20 @@ typedef struct ...@@ -58,6 +58,20 @@ typedef struct
typedef uint8_t dstring; typedef uint8_t dstring;
/* Timestamp (ECMA 167r3 1/7.3) */ /* Timestamp (ECMA 167r3 1/7.3) */
typedef struct
{
__le16 typeAndTimezone;
__le16 year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
uint8_t centiseconds;
uint8_t hundredsOfMicroseconds;
uint8_t microseconds;
} __attribute__ ((packed)) timestamp;
typedef struct typedef struct
{ {
uint16_t typeAndTimezone; uint16_t typeAndTimezone;
...@@ -70,7 +84,7 @@ typedef struct ...@@ -70,7 +84,7 @@ typedef struct
uint8_t centiseconds; uint8_t centiseconds;
uint8_t hundredsOfMicroseconds; uint8_t hundredsOfMicroseconds;
uint8_t microseconds; uint8_t microseconds;
} __attribute__ ((packed)) timestamp; } __attribute__ ((packed)) kernel_timestamp;
/* Type and Time Zone (ECMA 167r3 1/7.3.1) */ /* Type and Time Zone (ECMA 167r3 1/7.3.1) */
#define TIMESTAMP_TYPE_MASK 0xF000 #define TIMESTAMP_TYPE_MASK 0xF000
...@@ -139,12 +153,12 @@ struct bootDesc ...@@ -139,12 +153,12 @@ struct bootDesc
uint8_t reserved1; uint8_t reserved1;
regid archType; regid archType;
regid bootIdent; regid bootIdent;
uint32_t bootExtLocation; __le32 bootExtLocation;
uint32_t bootExtLength; __le32 bootExtLength;
uint64_t loadAddress; __le64 loadAddress;
uint64_t startAddress; __le64 startAddress;
timestamp descCreationDateAndTime; timestamp descCreationDateAndTime;
uint16_t flags; __le16 flags;
uint8_t reserved2[32]; uint8_t reserved2[32];
uint8_t bootUse[1906]; uint8_t bootUse[1906];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -153,23 +167,29 @@ struct bootDesc ...@@ -153,23 +167,29 @@ struct bootDesc
#define BOOT_FLAGS_ERASE 0x01 #define BOOT_FLAGS_ERASE 0x01
/* Extent Descriptor (ECMA 167r3 3/7.1) */ /* Extent Descriptor (ECMA 167r3 3/7.1) */
typedef struct
{
__le32 extLength;
__le32 extLocation;
} __attribute__ ((packed)) extent_ad;
typedef struct typedef struct
{ {
uint32_t extLength; uint32_t extLength;
uint32_t extLocation; uint32_t extLocation;
} __attribute__ ((packed)) extent_ad; } kernel_extent_ad;
/* Descriptor Tag (ECMA 167r3 3/7.2) */ /* Descriptor Tag (ECMA 167r3 3/7.2) */
typedef struct typedef struct
{ {
uint16_t tagIdent; __le16 tagIdent;
uint16_t descVersion; __le16 descVersion;
uint8_t tagChecksum; uint8_t tagChecksum;
uint8_t reserved; uint8_t reserved;
uint16_t tagSerialNum; __le16 tagSerialNum;
uint16_t descCRC; __le16 descCRC;
uint16_t descCRCLength; __le16 descCRCLength;
uint32_t tagLocation; __le32 tagLocation;
} __attribute__ ((packed)) tag; } __attribute__ ((packed)) tag;
/* Tag Identifier (ECMA 167r3 3/7.2.1) */ /* Tag Identifier (ECMA 167r3 3/7.2.1) */
...@@ -197,15 +217,15 @@ struct NSRDesc ...@@ -197,15 +217,15 @@ struct NSRDesc
struct primaryVolDesc struct primaryVolDesc
{ {
tag descTag; tag descTag;
uint32_t volDescSeqNum; __le32 volDescSeqNum;
uint32_t primaryVolDescNum; __le32 primaryVolDescNum;
dstring volIdent[32]; dstring volIdent[32];
uint16_t volSeqNum; __le16 volSeqNum;
uint16_t maxVolSeqNum; __le16 maxVolSeqNum;
uint16_t interchangeLvl; __le16 interchangeLvl;
uint16_t maxInterchangeLvl; __le16 maxInterchangeLvl;
uint32_t charSetList; __le32 charSetList;
uint32_t maxCharSetList; __le32 maxCharSetList;
dstring volSetIdent[128]; dstring volSetIdent[128];
charspec descCharSet; charspec descCharSet;
charspec explanatoryCharSet; charspec explanatoryCharSet;
...@@ -215,8 +235,8 @@ struct primaryVolDesc ...@@ -215,8 +235,8 @@ struct primaryVolDesc
timestamp recordingDateAndTime; timestamp recordingDateAndTime;
regid impIdent; regid impIdent;
uint8_t impUse[64]; uint8_t impUse[64];
uint32_t predecessorVolDescSeqLocation; __le32 predecessorVolDescSeqLocation;
uint16_t flags; __le16 flags;
uint8_t reserved[22]; uint8_t reserved[22];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -236,7 +256,7 @@ struct anchorVolDescPtr ...@@ -236,7 +256,7 @@ struct anchorVolDescPtr
struct volDescPtr struct volDescPtr
{ {
tag descTag; tag descTag;
uint32_t volDescSeqNum; __le32 volDescSeqNum;
extent_ad nextVolDescSeqExt; extent_ad nextVolDescSeqExt;
uint8_t reserved[484]; uint8_t reserved[484];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -245,7 +265,7 @@ struct volDescPtr ...@@ -245,7 +265,7 @@ struct volDescPtr
struct impUseVolDesc struct impUseVolDesc
{ {
tag descTag; tag descTag;
uint32_t volDescSeqNum; __le32 volDescSeqNum;
regid impIdent; regid impIdent;
uint8_t impUse[460]; uint8_t impUse[460];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -254,14 +274,14 @@ struct impUseVolDesc ...@@ -254,14 +274,14 @@ struct impUseVolDesc
struct partitionDesc struct partitionDesc
{ {
tag descTag; tag descTag;
uint32_t volDescSeqNum; __le32 volDescSeqNum;
uint16_t partitionFlags; __le16 partitionFlags;
uint16_t partitionNumber; __le16 partitionNumber;
regid partitionContents; regid partitionContents;
uint8_t partitionContentsUse[128]; uint8_t partitionContentsUse[128];
uint32_t accessType; __le32 accessType;
uint32_t partitionStartingLocation; __le32 partitionStartingLocation;
uint32_t partitionLength; __le32 partitionLength;
regid impIdent; regid impIdent;
uint8_t impUse[128]; uint8_t impUse[128];
uint8_t reserved[156]; uint8_t reserved[156];
...@@ -290,14 +310,14 @@ struct partitionDesc ...@@ -290,14 +310,14 @@ struct partitionDesc
struct logicalVolDesc struct logicalVolDesc
{ {
tag descTag; tag descTag;
uint32_t volDescSeqNum; __le32 volDescSeqNum;
charspec descCharSet; charspec descCharSet;
dstring logicalVolIdent[128]; dstring logicalVolIdent[128];
uint32_t logicalBlockSize; __le32 logicalBlockSize;
regid domainIdent; regid domainIdent;
uint8_t logicalVolContentsUse[16]; uint8_t logicalVolContentsUse[16];
uint32_t mapTableLength; __le32 mapTableLength;
uint32_t numPartitionMaps; __le32 numPartitionMaps;
regid impIdent; regid impIdent;
uint8_t impUse[128]; uint8_t impUse[128];
extent_ad integritySeqExt; extent_ad integritySeqExt;
...@@ -322,8 +342,8 @@ struct genericPartitionMap1 ...@@ -322,8 +342,8 @@ struct genericPartitionMap1
{ {
uint8_t partitionMapType; uint8_t partitionMapType;
uint8_t partitionMapLength; uint8_t partitionMapLength;
uint16_t volSeqNum; __le16 volSeqNum;
uint16_t partitionNum; __le16 partitionNum;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */ /* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */
...@@ -338,8 +358,8 @@ struct genericPartitionMap2 ...@@ -338,8 +358,8 @@ struct genericPartitionMap2
struct unallocSpaceDesc struct unallocSpaceDesc
{ {
tag descTag; tag descTag;
uint32_t volDescSeqNum; __le32 volDescSeqNum;
uint32_t numAllocDescs; __le32 numAllocDescs;
extent_ad allocDescs[0]; extent_ad allocDescs[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -355,13 +375,13 @@ struct logicalVolIntegrityDesc ...@@ -355,13 +375,13 @@ struct logicalVolIntegrityDesc
{ {
tag descTag; tag descTag;
timestamp recordingDateAndTime; timestamp recordingDateAndTime;
uint32_t integrityType; __le32 integrityType;
extent_ad nextIntegrityExt; extent_ad nextIntegrityExt;
uint8_t logicalVolContentsUse[32]; uint8_t logicalVolContentsUse[32];
uint32_t numOfPartitions; __le32 numOfPartitions;
uint32_t lengthOfImpUse; __le32 lengthOfImpUse;
uint32_t freeSpaceTable[0]; __le32 freeSpaceTable[0];
uint32_t sizeTable[0]; __le32 sizeTable[0];
uint8_t impUse[0]; uint8_t impUse[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -371,34 +391,56 @@ struct logicalVolIntegrityDesc ...@@ -371,34 +391,56 @@ struct logicalVolIntegrityDesc
/* Recorded Address (ECMA 167r3 4/7.1) */ /* Recorded Address (ECMA 167r3 4/7.1) */
typedef struct typedef struct
{
__le32 logicalBlockNum;
__le16 partitionReferenceNum;
} __attribute__ ((packed)) lb_addr;
/* ... and its in-core analog */
typedef struct
{ {
uint32_t logicalBlockNum; uint32_t logicalBlockNum;
uint16_t partitionReferenceNum; uint16_t partitionReferenceNum;
} __attribute__ ((packed)) lb_addr; } kernel_lb_addr;
/* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */ /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
typedef struct typedef struct
{ {
uint32_t extLength; __le32 extLength;
uint32_t extPosition; __le32 extPosition;
} __attribute__ ((packed)) short_ad; } __attribute__ ((packed)) short_ad;
/* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */ /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
typedef struct typedef struct
{ {
uint32_t extLength; __le32 extLength;
lb_addr extLocation; lb_addr extLocation;
uint8_t impUse[6]; uint8_t impUse[6];
} __attribute__ ((packed)) long_ad; } __attribute__ ((packed)) long_ad;
typedef struct
{
uint32_t extLength;
kernel_lb_addr extLocation;
uint8_t impUse[6];
} kernel_long_ad;
/* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */ /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
typedef struct
{
__le32 extLength;
__le32 recordedLength;
__le32 informationLength;
lb_addr extLocation;
} __attribute__ ((packed)) ext_ad;
typedef struct typedef struct
{ {
uint32_t extLength; uint32_t extLength;
uint32_t recordedLength; uint32_t recordedLength;
uint32_t informationLength; uint32_t informationLength;
lb_addr extLocation; kernel_lb_addr extLocation;
} __attribute__ ((packed)) ext_ad; } kernel_ext_ad;
/* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */ /* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */
...@@ -420,12 +462,12 @@ struct fileSetDesc ...@@ -420,12 +462,12 @@ struct fileSetDesc
{ {
tag descTag; tag descTag;
timestamp recordingDateAndTime; timestamp recordingDateAndTime;
uint16_t interchangeLvl; __le16 interchangeLvl;
uint16_t maxInterchangeLvl; __le16 maxInterchangeLvl;
uint32_t charSetList; __le32 charSetList;
uint32_t maxCharSetList; __le32 maxCharSetList;
uint32_t fileSetNum; __le32 fileSetNum;
uint32_t fileSetDescNum; __le32 fileSetDescNum;
charspec logicalVolIdentCharSet; charspec logicalVolIdentCharSet;
dstring logicalVolIdent[128]; dstring logicalVolIdent[128];
charspec fileSetCharSet; charspec fileSetCharSet;
...@@ -454,11 +496,11 @@ struct partitionHeaderDesc ...@@ -454,11 +496,11 @@ struct partitionHeaderDesc
struct fileIdentDesc struct fileIdentDesc
{ {
tag descTag; tag descTag;
uint16_t fileVersionNum; __le16 fileVersionNum;
uint8_t fileCharacteristics; uint8_t fileCharacteristics;
uint8_t lengthFileIdent; uint8_t lengthFileIdent;
long_ad icb; long_ad icb;
uint16_t lengthOfImpUse; __le16 lengthOfImpUse;
uint8_t impUse[0]; uint8_t impUse[0];
uint8_t fileIdent[0]; uint8_t fileIdent[0];
uint8_t padding[0]; uint8_t padding[0];
...@@ -475,21 +517,21 @@ struct fileIdentDesc ...@@ -475,21 +517,21 @@ struct fileIdentDesc
struct allocExtDesc struct allocExtDesc
{ {
tag descTag; tag descTag;
uint32_t previousAllocExtLocation; __le32 previousAllocExtLocation;
uint32_t lengthAllocDescs; __le32 lengthAllocDescs;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* ICB Tag (ECMA 167r3 4/14.6) */ /* ICB Tag (ECMA 167r3 4/14.6) */
typedef struct typedef struct
{ {
uint32_t priorRecordedNumDirectEntries; __le32 priorRecordedNumDirectEntries;
uint16_t strategyType; __le16 strategyType;
uint16_t strategyParameter; __le16 strategyParameter;
uint16_t numEntries; __le16 numEntries;
uint8_t reserved; uint8_t reserved;
uint8_t fileType; uint8_t fileType;
lb_addr parentICBLocation; lb_addr parentICBLocation;
uint16_t flags; __le16 flags;
} __attribute__ ((packed)) icbtag; } __attribute__ ((packed)) icbtag;
/* Strategy Type (ECMA 167r3 4/14.6.2) */ /* Strategy Type (ECMA 167r3 4/14.6.2) */
...@@ -553,24 +595,24 @@ struct fileEntry ...@@ -553,24 +595,24 @@ struct fileEntry
{ {
tag descTag; tag descTag;
icbtag icbTag; icbtag icbTag;
uint32_t uid; __le32 uid;
uint32_t gid; __le32 gid;
uint32_t permissions; __le32 permissions;
uint16_t fileLinkCount; __le16 fileLinkCount;
uint8_t recordFormat; uint8_t recordFormat;
uint8_t recordDisplayAttr; uint8_t recordDisplayAttr;
uint32_t recordLength; __le32 recordLength;
uint64_t informationLength; __le64 informationLength;
uint64_t logicalBlocksRecorded; __le64 logicalBlocksRecorded;
timestamp accessTime; timestamp accessTime;
timestamp modificationTime; timestamp modificationTime;
timestamp attrTime; timestamp attrTime;
uint32_t checkpoint; __le32 checkpoint;
long_ad extendedAttrICB; long_ad extendedAttrICB;
regid impIdent; regid impIdent;
uint64_t uniqueID; __le64 uniqueID;
uint32_t lengthExtendedAttr; __le32 lengthExtendedAttr;
uint32_t lengthAllocDescs; __le32 lengthAllocDescs;
uint8_t extendedAttr[0]; uint8_t extendedAttr[0];
uint8_t allocDescs[0]; uint8_t allocDescs[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -616,28 +658,28 @@ struct fileEntry ...@@ -616,28 +658,28 @@ struct fileEntry
struct extendedAttrHeaderDesc struct extendedAttrHeaderDesc
{ {
tag descTag; tag descTag;
uint32_t impAttrLocation; __le32 impAttrLocation;
uint32_t appAttrLocation; __le32 appAttrLocation;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Generic Format (ECMA 167r3 4/14.10.2) */ /* Generic Format (ECMA 167r3 4/14.10.2) */
struct genericFormat struct genericFormat
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint8_t attrData[0]; uint8_t attrData[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Character Set Information (ECMA 167r3 4/14.10.3) */ /* Character Set Information (ECMA 167r3 4/14.10.3) */
struct charSetInfo struct charSetInfo
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint32_t escapeSeqLength; __le32 escapeSeqLength;
uint8_t charSetType; uint8_t charSetType;
uint8_t escapeSeq[0]; uint8_t escapeSeq[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -645,24 +687,24 @@ struct charSetInfo ...@@ -645,24 +687,24 @@ struct charSetInfo
/* Alternate Permissions (ECMA 167r3 4/14.10.4) */ /* Alternate Permissions (ECMA 167r3 4/14.10.4) */
struct altPerms struct altPerms
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint16_t ownerIdent; __le16 ownerIdent;
uint16_t groupIdent; __le16 groupIdent;
uint16_t permission; __le16 permission;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */ /* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */
struct fileTimesExtAttr struct fileTimesExtAttr
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint32_t dataLength; __le32 dataLength;
uint32_t fileTimeExistence; __le32 fileTimeExistence;
uint8_t fileTimes; uint8_t fileTimes;
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -675,36 +717,36 @@ struct fileTimesExtAttr ...@@ -675,36 +717,36 @@ struct fileTimesExtAttr
/* Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */ /* Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */
struct infoTimesExtAttr struct infoTimesExtAttr
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint32_t dataLength; __le32 dataLength;
uint32_t infoTimeExistence; __le32 infoTimeExistence;
uint8_t infoTimes[0]; uint8_t infoTimes[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Device Specification (ECMA 167r3 4/14.10.7) */ /* Device Specification (ECMA 167r3 4/14.10.7) */
struct deviceSpec struct deviceSpec
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint32_t impUseLength; __le32 impUseLength;
uint32_t majorDeviceIdent; __le32 majorDeviceIdent;
uint32_t minorDeviceIdent; __le32 minorDeviceIdent;
uint8_t impUse[0]; uint8_t impUse[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */ /* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */
struct impUseExtAttr struct impUseExtAttr
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint32_t impUseLength; __le32 impUseLength;
regid impIdent; regid impIdent;
uint8_t impUse[0]; uint8_t impUse[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -712,11 +754,11 @@ struct impUseExtAttr ...@@ -712,11 +754,11 @@ struct impUseExtAttr
/* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */ /* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */
struct appUseExtAttr struct appUseExtAttr
{ {
uint32_t attrType; __le32 attrType;
uint8_t attrSubtype; uint8_t attrSubtype;
uint8_t reserved[3]; uint8_t reserved[3];
uint32_t attrLength; __le32 attrLength;
uint32_t appUseLength; __le32 appUseLength;
regid appIdent; regid appIdent;
uint8_t appUse[0]; uint8_t appUse[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -735,7 +777,7 @@ struct unallocSpaceEntry ...@@ -735,7 +777,7 @@ struct unallocSpaceEntry
{ {
tag descTag; tag descTag;
icbtag icbTag; icbtag icbTag;
uint32_t lengthAllocDescs; __le32 lengthAllocDescs;
uint8_t allocDescs[0]; uint8_t allocDescs[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -743,8 +785,8 @@ struct unallocSpaceEntry ...@@ -743,8 +785,8 @@ struct unallocSpaceEntry
struct spaceBitmapDesc struct spaceBitmapDesc
{ {
tag descTag; tag descTag;
uint32_t numOfBits; __le32 numOfBits;
uint32_t numOfBytes; __le32 numOfBytes;
uint8_t bitmap[0]; uint8_t bitmap[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -775,7 +817,7 @@ struct partitionIntegrityEntry ...@@ -775,7 +817,7 @@ struct partitionIntegrityEntry
/* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */ /* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */
struct logicalVolHeaderDesc struct logicalVolHeaderDesc
{ {
uint64_t uniqueID; __le64 uniqueID;
uint8_t reserved[24]; uint8_t reserved[24];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -784,7 +826,7 @@ struct pathComponent ...@@ -784,7 +826,7 @@ struct pathComponent
{ {
uint8_t componentType; uint8_t componentType;
uint8_t lengthComponentIdent; uint8_t lengthComponentIdent;
uint16_t componentFileVersionNum; __le16 componentFileVersionNum;
dstring componentIdent[0]; dstring componentIdent[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -793,28 +835,28 @@ struct extendedFileEntry ...@@ -793,28 +835,28 @@ struct extendedFileEntry
{ {
tag descTag; tag descTag;
icbtag icbTag; icbtag icbTag;
uint32_t uid; __le32 uid;
uint32_t gid; __le32 gid;
uint32_t permissions; __le32 permissions;
uint16_t fileLinkCount; __le16 fileLinkCount;
uint8_t recordFormat; uint8_t recordFormat;
uint8_t recordDisplayAttr; uint8_t recordDisplayAttr;
uint32_t recordLength; __le32 recordLength;
uint64_t informationLength; __le64 informationLength;
uint64_t objectSize; __le64 objectSize;
uint64_t logicalBlocksRecorded; __le64 logicalBlocksRecorded;
timestamp accessTime; timestamp accessTime;
timestamp modificationTime; timestamp modificationTime;
timestamp createTime; timestamp createTime;
timestamp attrTime; timestamp attrTime;
uint32_t checkpoint; __le32 checkpoint;
uint32_t reserved; __le32 reserved;
long_ad extendedAttrICB; long_ad extendedAttrICB;
long_ad streamDirectoryICB; long_ad streamDirectoryICB;
regid impIdent; regid impIdent;
uint64_t uniqueID; __le64 uniqueID;
uint32_t lengthExtendedAttr; __le32 lengthExtendedAttr;
uint32_t lengthAllocDescs; __le32 lengthAllocDescs;
uint8_t extendedAttr[0]; uint8_t extendedAttr[0];
uint8_t allocDescs[0]; uint8_t allocDescs[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
......
...@@ -59,14 +59,14 @@ static struct buffer_head *inode_getblk(struct inode *, long, int *, ...@@ -59,14 +59,14 @@ static struct buffer_head *inode_getblk(struct inode *, long, int *,
static int8_t udf_insert_aext(struct inode *, lb_addr, int, static int8_t udf_insert_aext(struct inode *, lb_addr, int,
lb_addr, uint32_t, struct buffer_head *); lb_addr, uint32_t, struct buffer_head *);
static void udf_split_extents(struct inode *, int *, int, int, static void udf_split_extents(struct inode *, int *, int, int,
long_ad [EXTENT_MERGE_SIZE], int *); kernel_long_ad [EXTENT_MERGE_SIZE], int *);
static void udf_prealloc_extents(struct inode *, int, int, static void udf_prealloc_extents(struct inode *, int, int,
long_ad [EXTENT_MERGE_SIZE], int *); kernel_long_ad [EXTENT_MERGE_SIZE], int *);
static void udf_merge_extents(struct inode *, static void udf_merge_extents(struct inode *,
long_ad [EXTENT_MERGE_SIZE], int *); kernel_long_ad [EXTENT_MERGE_SIZE], int *);
static void udf_update_extents(struct inode *, static void udf_update_extents(struct inode *,
long_ad [EXTENT_MERGE_SIZE], int, int, kernel_long_ad [EXTENT_MERGE_SIZE], int, int,
lb_addr, uint32_t, struct buffer_head **); kernel_lb_addr, uint32_t, struct buffer_head **);
static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int); static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int);
/* /*
...@@ -216,7 +216,7 @@ struct buffer_head * udf_expand_dir_adinicb(struct inode *inode, int *block, int ...@@ -216,7 +216,7 @@ struct buffer_head * udf_expand_dir_adinicb(struct inode *inode, int *block, int
{ {
int newblock; int newblock;
struct buffer_head *sbh = NULL, *dbh = NULL; struct buffer_head *sbh = NULL, *dbh = NULL;
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t elen, extoffset; uint32_t elen, extoffset;
uint8_t alloctype; uint8_t alloctype;
...@@ -381,11 +381,11 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block, ...@@ -381,11 +381,11 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block,
int *err, long *phys, int *new) int *err, long *phys, int *new)
{ {
struct buffer_head *pbh = NULL, *cbh = NULL, *nbh = NULL, *result = NULL; struct buffer_head *pbh = NULL, *cbh = NULL, *nbh = NULL, *result = NULL;
long_ad laarr[EXTENT_MERGE_SIZE]; kernel_long_ad laarr[EXTENT_MERGE_SIZE];
uint32_t pextoffset = 0, cextoffset = 0, nextoffset = 0; uint32_t pextoffset = 0, cextoffset = 0, nextoffset = 0;
int count = 0, startnum = 0, endnum = 0; int count = 0, startnum = 0, endnum = 0;
uint32_t elen = 0; uint32_t elen = 0;
lb_addr eloc, pbloc, cbloc, nbloc; kernel_lb_addr eloc, pbloc, cbloc, nbloc;
int c = 1; int c = 1;
uint64_t lbcount = 0, b_off = 0; uint64_t lbcount = 0, b_off = 0;
uint32_t newblocknum, newblock, offset = 0; uint32_t newblocknum, newblock, offset = 0;
...@@ -479,7 +479,7 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block, ...@@ -479,7 +479,7 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block,
c = !c; c = !c;
laarr[c].extLength = EXT_NOT_RECORDED_NOT_ALLOCATED | laarr[c].extLength = EXT_NOT_RECORDED_NOT_ALLOCATED |
((offset + 1) << inode->i_sb->s_blocksize_bits); ((offset + 1) << inode->i_sb->s_blocksize_bits);
memset(&laarr[c].extLocation, 0x00, sizeof(lb_addr)); memset(&laarr[c].extLocation, 0x00, sizeof(kernel_lb_addr));
count ++; count ++;
endnum ++; endnum ++;
lastblock = 1; lastblock = 1;
...@@ -578,7 +578,7 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block, ...@@ -578,7 +578,7 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block,
} }
static void udf_split_extents(struct inode *inode, int *c, int offset, int newblocknum, static void udf_split_extents(struct inode *inode, int *c, int offset, int newblocknum,
long_ad laarr[EXTENT_MERGE_SIZE], int *endnum) kernel_long_ad laarr[EXTENT_MERGE_SIZE], int *endnum)
{ {
if ((laarr[*c].extLength >> 30) == (EXT_NOT_RECORDED_ALLOCATED >> 30) || if ((laarr[*c].extLength >> 30) == (EXT_NOT_RECORDED_ALLOCATED >> 30) ||
(laarr[*c].extLength >> 30) == (EXT_NOT_RECORDED_NOT_ALLOCATED >> 30)) (laarr[*c].extLength >> 30) == (EXT_NOT_RECORDED_NOT_ALLOCATED >> 30))
...@@ -640,7 +640,7 @@ static void udf_split_extents(struct inode *inode, int *c, int offset, int newbl ...@@ -640,7 +640,7 @@ static void udf_split_extents(struct inode *inode, int *c, int offset, int newbl
} }
static void udf_prealloc_extents(struct inode *inode, int c, int lastblock, static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
long_ad laarr[EXTENT_MERGE_SIZE], int *endnum) kernel_long_ad laarr[EXTENT_MERGE_SIZE], int *endnum)
{ {
int start, length = 0, currlength = 0, i; int start, length = 0, currlength = 0, i;
...@@ -732,7 +732,7 @@ static void udf_prealloc_extents(struct inode *inode, int c, int lastblock, ...@@ -732,7 +732,7 @@ static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
} }
static void udf_merge_extents(struct inode *inode, static void udf_merge_extents(struct inode *inode,
long_ad laarr[EXTENT_MERGE_SIZE], int *endnum) kernel_long_ad laarr[EXTENT_MERGE_SIZE], int *endnum)
{ {
int i; int i;
...@@ -817,11 +817,11 @@ static void udf_merge_extents(struct inode *inode, ...@@ -817,11 +817,11 @@ static void udf_merge_extents(struct inode *inode,
} }
static void udf_update_extents(struct inode *inode, static void udf_update_extents(struct inode *inode,
long_ad laarr[EXTENT_MERGE_SIZE], int startnum, int endnum, kernel_long_ad laarr[EXTENT_MERGE_SIZE], int startnum, int endnum,
lb_addr pbloc, uint32_t pextoffset, struct buffer_head **pbh) kernel_lb_addr pbloc, uint32_t pextoffset, struct buffer_head **pbh)
{ {
int start = 0, i; int start = 0, i;
lb_addr tmploc; kernel_lb_addr tmploc;
uint32_t tmplen; uint32_t tmplen;
if (startnum > endnum) if (startnum > endnum)
...@@ -941,7 +941,7 @@ void udf_truncate(struct inode * inode) ...@@ -941,7 +941,7 @@ void udf_truncate(struct inode * inode)
void void
udf_read_inode(struct inode *inode) udf_read_inode(struct inode *inode)
{ {
memset(&UDF_I_LOCATION(inode), 0xFF, sizeof(lb_addr)); memset(&UDF_I_LOCATION(inode), 0xFF, sizeof(kernel_lb_addr));
} }
static void static void
...@@ -997,7 +997,7 @@ __udf_read_inode(struct inode *inode) ...@@ -997,7 +997,7 @@ __udf_read_inode(struct inode *inode)
{ {
if (ibh) if (ibh)
{ {
lb_addr loc; kernel_lb_addr loc;
ie = (struct indirectEntry *)ibh->b_data; ie = (struct indirectEntry *)ibh->b_data;
loc = lelb_to_cpu(ie->indirectICB.extLocation); loc = lelb_to_cpu(ie->indirectICB.extLocation);
...@@ -1008,7 +1008,7 @@ __udf_read_inode(struct inode *inode) ...@@ -1008,7 +1008,7 @@ __udf_read_inode(struct inode *inode)
if (ident == TAG_IDENT_FE || if (ident == TAG_IDENT_FE ||
ident == TAG_IDENT_EFE) ident == TAG_IDENT_EFE)
{ {
memcpy(&UDF_I_LOCATION(inode), &loc, sizeof(lb_addr)); memcpy(&UDF_I_LOCATION(inode), &loc, sizeof(kernel_lb_addr));
udf_release_data(bh); udf_release_data(bh);
udf_release_data(ibh); udf_release_data(ibh);
udf_release_data(nbh); udf_release_data(nbh);
...@@ -1338,7 +1338,7 @@ udf_update_inode(struct inode *inode, int do_sync) ...@@ -1338,7 +1338,7 @@ udf_update_inode(struct inode *inode, int do_sync)
uint16_t icbflags; uint16_t icbflags;
uint16_t crclen; uint16_t crclen;
int i; int i;
timestamp cpu_time; kernel_timestamp cpu_time;
int err = 0; int err = 0;
bh = udf_tread(inode->i_sb, bh = udf_tread(inode->i_sb,
...@@ -1449,7 +1449,7 @@ udf_update_inode(struct inode *inode, int do_sync) ...@@ -1449,7 +1449,7 @@ udf_update_inode(struct inode *inode, int do_sync)
fe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode)); fe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode));
fe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(inode)); fe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(inode));
fe->lengthAllocDescs = cpu_to_le32(UDF_I_LENALLOC(inode)); fe->lengthAllocDescs = cpu_to_le32(UDF_I_LENALLOC(inode));
fe->descTag.tagIdent = le16_to_cpu(TAG_IDENT_FE); fe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_FE);
crclen = sizeof(struct fileEntry); crclen = sizeof(struct fileEntry);
} }
else else
...@@ -1495,7 +1495,7 @@ udf_update_inode(struct inode *inode, int do_sync) ...@@ -1495,7 +1495,7 @@ udf_update_inode(struct inode *inode, int do_sync)
efe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode)); efe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode));
efe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(inode)); efe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(inode));
efe->lengthAllocDescs = cpu_to_le32(UDF_I_LENALLOC(inode)); efe->lengthAllocDescs = cpu_to_le32(UDF_I_LENALLOC(inode));
efe->descTag.tagIdent = le16_to_cpu(TAG_IDENT_EFE); efe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EFE);
crclen = sizeof(struct extendedFileEntry); crclen = sizeof(struct extendedFileEntry);
} }
if (UDF_I_STRAT4096(inode)) if (UDF_I_STRAT4096(inode))
...@@ -1581,7 +1581,7 @@ udf_update_inode(struct inode *inode, int do_sync) ...@@ -1581,7 +1581,7 @@ udf_update_inode(struct inode *inode, int do_sync)
* 12/19/98 dgb Added semaphore and changed to be a wrapper of iget * 12/19/98 dgb Added semaphore and changed to be a wrapper of iget
*/ */
struct inode * struct inode *
udf_iget(struct super_block *sb, lb_addr ino) udf_iget(struct super_block *sb, kernel_lb_addr ino)
{ {
struct inode *inode; struct inode *inode;
unsigned long block; unsigned long block;
...@@ -1606,7 +1606,7 @@ udf_iget(struct super_block *sb, lb_addr ino) ...@@ -1606,7 +1606,7 @@ udf_iget(struct super_block *sb, lb_addr ino)
else if (UDF_I_LOCATION(inode).logicalBlockNum == 0xFFFFFFFF && else if (UDF_I_LOCATION(inode).logicalBlockNum == 0xFFFFFFFF &&
UDF_I_LOCATION(inode).partitionReferenceNum == 0xFFFF) UDF_I_LOCATION(inode).partitionReferenceNum == 0xFFFF)
{ {
memcpy(&UDF_I_LOCATION(inode), &ino, sizeof(lb_addr)); memcpy(&UDF_I_LOCATION(inode), &ino, sizeof(kernel_lb_addr));
__udf_read_inode(inode); __udf_read_inode(inode);
if (is_bad_inode(inode)) if (is_bad_inode(inode))
{ {
...@@ -1627,8 +1627,8 @@ udf_iget(struct super_block *sb, lb_addr ino) ...@@ -1627,8 +1627,8 @@ udf_iget(struct super_block *sb, lb_addr ino)
return inode; return inode;
} }
int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset, int8_t udf_add_aext(struct inode *inode, kernel_lb_addr *bloc, int *extoffset,
lb_addr eloc, uint32_t elen, struct buffer_head **bh, int inc) kernel_lb_addr eloc, uint32_t elen, struct buffer_head **bh, int inc)
{ {
int adsize; int adsize;
short_ad *sad = NULL; short_ad *sad = NULL;
...@@ -1654,7 +1654,7 @@ int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset, ...@@ -1654,7 +1654,7 @@ int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
char *sptr, *dptr; char *sptr, *dptr;
struct buffer_head *nbh; struct buffer_head *nbh;
int err, loffset; int err, loffset;
lb_addr obloc = *bloc; kernel_lb_addr obloc = *bloc;
if (!(bloc->logicalBlockNum = udf_new_block(inode->i_sb, NULL, if (!(bloc->logicalBlockNum = udf_new_block(inode->i_sb, NULL,
obloc.partitionReferenceNum, obloc.logicalBlockNum, &err))) obloc.partitionReferenceNum, obloc.logicalBlockNum, &err)))
...@@ -1767,8 +1767,8 @@ int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset, ...@@ -1767,8 +1767,8 @@ int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
return etype; return etype;
} }
int8_t udf_write_aext(struct inode *inode, lb_addr bloc, int *extoffset, int8_t udf_write_aext(struct inode *inode, kernel_lb_addr bloc, int *extoffset,
lb_addr eloc, uint32_t elen, struct buffer_head *bh, int inc) kernel_lb_addr eloc, uint32_t elen, struct buffer_head *bh, int inc)
{ {
int adsize; int adsize;
uint8_t *ptr; uint8_t *ptr;
...@@ -1823,8 +1823,8 @@ int8_t udf_write_aext(struct inode *inode, lb_addr bloc, int *extoffset, ...@@ -1823,8 +1823,8 @@ int8_t udf_write_aext(struct inode *inode, lb_addr bloc, int *extoffset,
return (elen >> 30); return (elen >> 30);
} }
int8_t udf_next_aext(struct inode *inode, lb_addr *bloc, int *extoffset, int8_t udf_next_aext(struct inode *inode, kernel_lb_addr *bloc, int *extoffset,
lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc) kernel_lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc)
{ {
int8_t etype; int8_t etype;
...@@ -1845,8 +1845,8 @@ int8_t udf_next_aext(struct inode *inode, lb_addr *bloc, int *extoffset, ...@@ -1845,8 +1845,8 @@ int8_t udf_next_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
return etype; return etype;
} }
int8_t udf_current_aext(struct inode *inode, lb_addr *bloc, int *extoffset, int8_t udf_current_aext(struct inode *inode, kernel_lb_addr *bloc, int *extoffset,
lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc) kernel_lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc)
{ {
int alen; int alen;
int8_t etype; int8_t etype;
...@@ -1905,10 +1905,10 @@ int8_t udf_current_aext(struct inode *inode, lb_addr *bloc, int *extoffset, ...@@ -1905,10 +1905,10 @@ int8_t udf_current_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
} }
static int8_t static int8_t
udf_insert_aext(struct inode *inode, lb_addr bloc, int extoffset, udf_insert_aext(struct inode *inode, kernel_lb_addr bloc, int extoffset,
lb_addr neloc, uint32_t nelen, struct buffer_head *bh) kernel_lb_addr neloc, uint32_t nelen, struct buffer_head *bh)
{ {
lb_addr oeloc; kernel_lb_addr oeloc;
uint32_t oelen; uint32_t oelen;
int8_t etype; int8_t etype;
...@@ -1927,11 +1927,11 @@ udf_insert_aext(struct inode *inode, lb_addr bloc, int extoffset, ...@@ -1927,11 +1927,11 @@ udf_insert_aext(struct inode *inode, lb_addr bloc, int extoffset,
return (nelen >> 30); return (nelen >> 30);
} }
int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset, int8_t udf_delete_aext(struct inode *inode, kernel_lb_addr nbloc, int nextoffset,
lb_addr eloc, uint32_t elen, struct buffer_head *nbh) kernel_lb_addr eloc, uint32_t elen, struct buffer_head *nbh)
{ {
struct buffer_head *obh; struct buffer_head *obh;
lb_addr obloc; kernel_lb_addr obloc;
int oextoffset, adsize; int oextoffset, adsize;
int8_t etype; int8_t etype;
struct allocExtDesc *aed; struct allocExtDesc *aed;
...@@ -1968,7 +1968,7 @@ int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset, ...@@ -1968,7 +1968,7 @@ int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset,
oextoffset = nextoffset - adsize; oextoffset = nextoffset - adsize;
} }
} }
memset(&eloc, 0x00, sizeof(lb_addr)); memset(&eloc, 0x00, sizeof(kernel_lb_addr));
elen = 0; elen = 0;
if (nbh != obh) if (nbh != obh)
...@@ -2019,8 +2019,8 @@ int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset, ...@@ -2019,8 +2019,8 @@ int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset,
return (elen >> 30); return (elen >> 30);
} }
int8_t inode_bmap(struct inode *inode, int block, lb_addr *bloc, uint32_t *extoffset, int8_t inode_bmap(struct inode *inode, int block, kernel_lb_addr *bloc, uint32_t *extoffset,
lb_addr *eloc, uint32_t *elen, uint32_t *offset, struct buffer_head **bh) kernel_lb_addr *eloc, uint32_t *elen, uint32_t *offset, struct buffer_head **bh)
{ {
uint64_t lbcount = 0, bcount = (uint64_t)block << inode->i_sb->s_blocksize_bits; uint64_t lbcount = 0, bcount = (uint64_t)block << inode->i_sb->s_blocksize_bits;
int8_t etype; int8_t etype;
...@@ -2058,7 +2058,7 @@ int8_t inode_bmap(struct inode *inode, int block, lb_addr *bloc, uint32_t *extof ...@@ -2058,7 +2058,7 @@ int8_t inode_bmap(struct inode *inode, int block, lb_addr *bloc, uint32_t *extof
long udf_block_map(struct inode *inode, long block) long udf_block_map(struct inode *inode, long block)
{ {
lb_addr eloc, bloc; kernel_lb_addr eloc, bloc;
uint32_t offset, extoffset, elen; uint32_t offset, extoffset, elen;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
int ret; int ret;
......
...@@ -273,7 +273,7 @@ udf_read_tagged(struct super_block *sb, uint32_t block, uint32_t location, uint1 ...@@ -273,7 +273,7 @@ udf_read_tagged(struct super_block *sb, uint32_t block, uint32_t location, uint1
} }
struct buffer_head * struct buffer_head *
udf_read_ptagged(struct super_block *sb, lb_addr loc, uint32_t offset, uint16_t *ident) udf_read_ptagged(struct super_block *sb, kernel_lb_addr loc, uint32_t offset, uint16_t *ident)
{ {
return udf_read_tagged(sb, udf_get_lb_pblock(sb, loc, offset), return udf_read_tagged(sb, udf_get_lb_pblock(sb, loc, offset),
loc.logicalBlockNum + offset, ident); loc.logicalBlockNum + offset, ident);
...@@ -293,8 +293,8 @@ void udf_update_tag(char *data, int length) ...@@ -293,8 +293,8 @@ void udf_update_tag(char *data, int length)
length -= sizeof(tag); length -= sizeof(tag);
tptr->tagChecksum = 0; tptr->tagChecksum = 0;
tptr->descCRCLength = le16_to_cpu(length); tptr->descCRCLength = cpu_to_le16(length);
tptr->descCRC = le16_to_cpu(udf_crc(data + sizeof(tag), length, 0)); tptr->descCRC = cpu_to_le16(udf_crc(data + sizeof(tag), length, 0));
for (i=0; i<16; i++) for (i=0; i<16; i++)
if (i != 4) if (i != 4)
...@@ -305,9 +305,9 @@ void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum, ...@@ -305,9 +305,9 @@ void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum,
uint32_t loc, int length) uint32_t loc, int length)
{ {
tag *tptr = (tag *)data; tag *tptr = (tag *)data;
tptr->tagIdent = le16_to_cpu(ident); tptr->tagIdent = cpu_to_le16(ident);
tptr->descVersion = le16_to_cpu(version); tptr->descVersion = cpu_to_le16(version);
tptr->tagSerialNum = le16_to_cpu(snum); tptr->tagSerialNum = cpu_to_le16(snum);
tptr->tagLocation = le32_to_cpu(loc); tptr->tagLocation = cpu_to_le32(loc);
udf_update_tag(data, length); udf_update_tag(data, length);
} }
...@@ -160,7 +160,7 @@ udf_find_entry(struct inode *dir, struct dentry *dentry, ...@@ -160,7 +160,7 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
uint8_t lfi; uint8_t lfi;
uint16_t liu; uint16_t liu;
loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2; loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset; uint32_t extoffset, elen, offset;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
...@@ -314,7 +314,7 @@ udf_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) ...@@ -314,7 +314,7 @@ udf_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
/* temporary shorthand for specifying files by inode number */ /* temporary shorthand for specifying files by inode number */
if (!strncmp(dentry->d_name.name, ".B=", 3) ) if (!strncmp(dentry->d_name.name, ".B=", 3) )
{ {
lb_addr lb = { 0, simple_strtoul(dentry->d_name.name+3, NULL, 0) }; kernel_lb_addr lb = { 0, simple_strtoul(dentry->d_name.name+3, NULL, 0) };
inode = udf_iget(dir->i_sb, lb); inode = udf_iget(dir->i_sb, lb);
if (!inode) if (!inode)
{ {
...@@ -360,7 +360,7 @@ udf_add_entry(struct inode *dir, struct dentry *dentry, ...@@ -360,7 +360,7 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
uint8_t lfi; uint8_t lfi;
uint16_t liu; uint16_t liu;
int block; int block;
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset; uint32_t extoffset, elen, offset;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
...@@ -655,7 +655,7 @@ static int udf_create(struct inode *dir, struct dentry *dentry, int mode, struct ...@@ -655,7 +655,7 @@ static int udf_create(struct inode *dir, struct dentry *dentry, int mode, struct
} }
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode));
*(uint32_t *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL); cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL);
udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB)
...@@ -698,7 +698,7 @@ static int udf_mknod(struct inode * dir, struct dentry * dentry, int mode, dev_t ...@@ -698,7 +698,7 @@ static int udf_mknod(struct inode * dir, struct dentry * dentry, int mode, dev_t
} }
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode));
*(uint32_t *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL); cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL);
udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB)
...@@ -746,7 +746,7 @@ static int udf_mkdir(struct inode * dir, struct dentry * dentry, int mode) ...@@ -746,7 +746,7 @@ static int udf_mkdir(struct inode * dir, struct dentry * dentry, int mode)
inode->i_nlink = 2; inode->i_nlink = 2;
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(dir)); cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(dir));
*(uint32_t *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
cpu_to_le32(UDF_I_UNIQUE(dir) & 0x00000000FFFFFFFFUL); cpu_to_le32(UDF_I_UNIQUE(dir) & 0x00000000FFFFFFFFUL);
cfi.fileCharacteristics = FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT; cfi.fileCharacteristics = FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT;
udf_write_fi(inode, &cfi, fi, &fibh, NULL, NULL); udf_write_fi(inode, &cfi, fi, &fibh, NULL, NULL);
...@@ -765,7 +765,7 @@ static int udf_mkdir(struct inode * dir, struct dentry * dentry, int mode) ...@@ -765,7 +765,7 @@ static int udf_mkdir(struct inode * dir, struct dentry * dentry, int mode)
} }
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode));
*(uint32_t *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL); cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL);
cfi.fileCharacteristics |= FID_FILE_CHAR_DIRECTORY; cfi.fileCharacteristics |= FID_FILE_CHAR_DIRECTORY;
udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
...@@ -788,7 +788,7 @@ static int empty_dir(struct inode *dir) ...@@ -788,7 +788,7 @@ static int empty_dir(struct inode *dir)
loff_t f_pos; loff_t f_pos;
loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2; loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
int block; int block;
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset; uint32_t extoffset, elen, offset;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
...@@ -861,7 +861,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry) ...@@ -861,7 +861,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
struct inode * inode = dentry->d_inode; struct inode * inode = dentry->d_inode;
struct udf_fileident_bh fibh; struct udf_fileident_bh fibh;
struct fileIdentDesc *fi, cfi; struct fileIdentDesc *fi, cfi;
lb_addr tloc; kernel_lb_addr tloc;
retval = -ENOENT; retval = -ENOENT;
lock_kernel(); lock_kernel();
...@@ -906,7 +906,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry) ...@@ -906,7 +906,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
struct udf_fileident_bh fibh; struct udf_fileident_bh fibh;
struct fileIdentDesc *fi; struct fileIdentDesc *fi;
struct fileIdentDesc cfi; struct fileIdentDesc cfi;
lb_addr tloc; kernel_lb_addr tloc;
retval = -ENOENT; retval = -ENOENT;
lock_kernel(); lock_kernel();
...@@ -971,7 +971,7 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char * ...@@ -971,7 +971,7 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char *
if (UDF_I_ALLOCTYPE(inode) != ICBTAG_FLAG_AD_IN_ICB) if (UDF_I_ALLOCTYPE(inode) != ICBTAG_FLAG_AD_IN_ICB)
{ {
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t elen, extoffset; uint32_t elen, extoffset;
block = udf_new_block(inode->i_sb, inode, block = udf_new_block(inode->i_sb, inode,
...@@ -1085,7 +1085,7 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char * ...@@ -1085,7 +1085,7 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char *
uint64_t uniqueID; uint64_t uniqueID;
lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse); lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse);
uniqueID = le64_to_cpu(lvhd->uniqueID); uniqueID = le64_to_cpu(lvhd->uniqueID);
*(uint32_t *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL); cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL);
if (!(++uniqueID & 0x00000000FFFFFFFFUL)) if (!(++uniqueID & 0x00000000FFFFFFFFUL))
uniqueID += 16; uniqueID += 16;
...@@ -1142,7 +1142,7 @@ static int udf_link(struct dentry * old_dentry, struct inode * dir, ...@@ -1142,7 +1142,7 @@ static int udf_link(struct dentry * old_dentry, struct inode * dir,
uint64_t uniqueID; uint64_t uniqueID;
lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse); lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse);
uniqueID = le64_to_cpu(lvhd->uniqueID); uniqueID = le64_to_cpu(lvhd->uniqueID);
*(uint32_t *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL); cpu_to_le32(uniqueID & 0x00000000FFFFFFFFUL);
if (!(++uniqueID & 0x00000000FFFFFFFFUL)) if (!(++uniqueID & 0x00000000FFFFFFFFUL))
uniqueID += 16; uniqueID += 16;
...@@ -1178,7 +1178,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, ...@@ -1178,7 +1178,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
struct fileIdentDesc *ofi = NULL, *nfi = NULL, *dir_fi = NULL, ocfi, ncfi; struct fileIdentDesc *ofi = NULL, *nfi = NULL, *dir_fi = NULL, ocfi, ncfi;
struct buffer_head *dir_bh = NULL; struct buffer_head *dir_bh = NULL;
int retval = -ENOENT; int retval = -ENOENT;
lb_addr tloc; kernel_lb_addr tloc;
lock_kernel(); lock_kernel();
if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi))) if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi)))
...@@ -1231,7 +1231,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, ...@@ -1231,7 +1231,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
} }
if (!dir_fi) if (!dir_fi)
goto end_rename; goto end_rename;
tloc = cpu_to_lelb(dir_fi->icb.extLocation); tloc = lelb_to_cpu(dir_fi->icb.extLocation);
if (udf_get_lb_pblock(old_inode->i_sb, tloc, 0) if (udf_get_lb_pblock(old_inode->i_sb, tloc, 0)
!= old_dir->i_ino) != old_dir->i_ino)
goto end_rename; goto end_rename;
...@@ -1277,9 +1277,9 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry, ...@@ -1277,9 +1277,9 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
if (dir_fi) if (dir_fi)
{ {
dir_fi->icb.extLocation = lelb_to_cpu(UDF_I_LOCATION(new_dir)); dir_fi->icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(new_dir));
udf_update_tag((char *)dir_fi, (sizeof(struct fileIdentDesc) + udf_update_tag((char *)dir_fi, (sizeof(struct fileIdentDesc) +
cpu_to_le16(dir_fi->lengthOfImpUse) + 3) & ~3); le16_to_cpu(dir_fi->lengthOfImpUse) + 3) & ~3);
if (UDF_I_ALLOCTYPE(old_inode) == ICBTAG_FLAG_AD_IN_ICB) if (UDF_I_ALLOCTYPE(old_inode) == ICBTAG_FLAG_AD_IN_ICB)
{ {
mark_inode_dirty(old_inode); mark_inode_dirty(old_inode);
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
struct UDFIdentSuffix struct UDFIdentSuffix
{ {
uint16_t UDFRevision; __le16 UDFRevision;
uint8_t OSClass; uint8_t OSClass;
uint8_t OSIdentifier; uint8_t OSIdentifier;
uint8_t reserved[4]; uint8_t reserved[4];
...@@ -90,11 +90,11 @@ struct appIdentSuffix ...@@ -90,11 +90,11 @@ struct appIdentSuffix
struct logicalVolIntegrityDescImpUse struct logicalVolIntegrityDescImpUse
{ {
regid impIdent; regid impIdent;
uint32_t numFiles; __le32 numFiles;
uint32_t numDirs; __le32 numDirs;
uint16_t minUDFReadRev; __le16 minUDFReadRev;
uint16_t minUDFWriteRev; __le16 minUDFWriteRev;
uint16_t maxUDFWriteRev; __le16 maxUDFWriteRev;
uint8_t impUse[0]; uint8_t impUse[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -117,8 +117,8 @@ struct udfPartitionMap2 ...@@ -117,8 +117,8 @@ struct udfPartitionMap2
uint8_t partitionMapLength; uint8_t partitionMapLength;
uint8_t reserved1[2]; uint8_t reserved1[2];
regid partIdent; regid partIdent;
uint16_t volSeqNum; __le16 volSeqNum;
uint16_t partitionNum; __le16 partitionNum;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Virtual Partition Map (UDF 2.50 2.2.8) */ /* Virtual Partition Map (UDF 2.50 2.2.8) */
...@@ -128,8 +128,8 @@ struct virtualPartitionMap ...@@ -128,8 +128,8 @@ struct virtualPartitionMap
uint8_t partitionMapLength; uint8_t partitionMapLength;
uint8_t reserved1[2]; uint8_t reserved1[2];
regid partIdent; regid partIdent;
uint16_t volSeqNum; __le16 volSeqNum;
uint16_t partitionNum; __le16 partitionNum;
uint8_t reserved2[24]; uint8_t reserved2[24];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -140,13 +140,13 @@ struct sparablePartitionMap ...@@ -140,13 +140,13 @@ struct sparablePartitionMap
uint8_t partitionMapLength; uint8_t partitionMapLength;
uint8_t reserved1[2]; uint8_t reserved1[2];
regid partIdent; regid partIdent;
uint16_t volSeqNum; __le16 volSeqNum;
uint16_t partitionNum; __le16 partitionNum;
uint16_t packetLength; __le16 packetLength;
uint8_t numSparingTables; uint8_t numSparingTables;
uint8_t reserved2[1]; uint8_t reserved2[1];
uint32_t sizeSparingTable; __le32 sizeSparingTable;
uint32_t locSparingTable[4]; __le32 locSparingTable[4];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Metadata Partition Map (UDF 2.4.0 2.2.10) */ /* Metadata Partition Map (UDF 2.4.0 2.2.10) */
...@@ -156,13 +156,13 @@ struct metadataPartitionMap ...@@ -156,13 +156,13 @@ struct metadataPartitionMap
uint8_t partitionMapLength; uint8_t partitionMapLength;
uint8_t reserved1[2]; uint8_t reserved1[2];
regid partIdent; regid partIdent;
uint16_t volSeqNum; __le16 volSeqNum;
uint16_t partitionNum; __le16 partitionNum;
uint32_t metadataFileLoc; __le32 metadataFileLoc;
uint32_t metadataMirrorFileLoc; __le32 metadataMirrorFileLoc;
uint32_t metadataBitmapFileLoc; __le32 metadataBitmapFileLoc;
uint32_t allocUnitSize; __le32 allocUnitSize;
uint16_t alignUnitSize; __le16 alignUnitSize;
uint8_t flags; uint8_t flags;
uint8_t reserved2[5]; uint8_t reserved2[5];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -170,9 +170,9 @@ struct metadataPartitionMap ...@@ -170,9 +170,9 @@ struct metadataPartitionMap
/* Virtual Allocation Table (UDF 1.5 2.2.10) */ /* Virtual Allocation Table (UDF 1.5 2.2.10) */
struct virtualAllocationTable15 struct virtualAllocationTable15
{ {
uint32_t VirtualSector[0]; __le32 VirtualSector[0];
regid vatIdent; regid vatIdent;
uint32_t previousVATICBLoc; __le32 previousVATICBLoc;
} __attribute__ ((packed)); } __attribute__ ((packed));
#define ICBTAG_FILE_TYPE_VAT15 0x00U #define ICBTAG_FILE_TYPE_VAT15 0x00U
...@@ -180,18 +180,18 @@ struct virtualAllocationTable15 ...@@ -180,18 +180,18 @@ struct virtualAllocationTable15
/* Virtual Allocation Table (UDF 2.50 2.2.11) */ /* Virtual Allocation Table (UDF 2.50 2.2.11) */
struct virtualAllocationTable20 struct virtualAllocationTable20
{ {
uint16_t lengthHeader; __le16 lengthHeader;
uint16_t lengthImpUse; __le16 lengthImpUse;
dstring logicalVolIdent[128]; dstring logicalVolIdent[128];
uint32_t previousVATICBLoc; __le32 previousVATICBLoc;
uint32_t numFiles; __le32 numFiles;
uint32_t numDirs; __le32 numDirs;
uint16_t minReadRevision; __le16 minReadRevision;
uint16_t minWriteRevision; __le16 minWriteRevision;
uint16_t maxWriteRevision; __le16 maxWriteRevision;
uint16_t reserved; __le16 reserved;
uint8_t impUse[0]; uint8_t impUse[0];
uint32_t vatEntry[0]; __le32 vatEntry[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
#define ICBTAG_FILE_TYPE_VAT20 0xF8U #define ICBTAG_FILE_TYPE_VAT20 0xF8U
...@@ -199,17 +199,17 @@ struct virtualAllocationTable20 ...@@ -199,17 +199,17 @@ struct virtualAllocationTable20
/* Sparing Table (UDF 2.50 2.2.12) */ /* Sparing Table (UDF 2.50 2.2.12) */
struct sparingEntry struct sparingEntry
{ {
uint32_t origLocation; __le32 origLocation;
uint32_t mappedLocation; __le32 mappedLocation;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct sparingTable struct sparingTable
{ {
tag descTag; tag descTag;
regid sparingIdent; regid sparingIdent;
uint16_t reallocationTableLen; __le16 reallocationTableLen;
uint16_t reserved; __le16 reserved;
uint32_t sequenceNum; __le32 sequenceNum;
struct sparingEntry struct sparingEntry
mapEntry[0]; mapEntry[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -222,7 +222,7 @@ struct sparingTable ...@@ -222,7 +222,7 @@ struct sparingTable
/* struct long_ad ICB - ADImpUse (UDF 2.50 2.2.4.3) */ /* struct long_ad ICB - ADImpUse (UDF 2.50 2.2.4.3) */
struct allocDescImpUse struct allocDescImpUse
{ {
uint16_t flags; __le16 flags;
uint8_t impUse[4]; uint8_t impUse[4];
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -235,14 +235,14 @@ struct allocDescImpUse ...@@ -235,14 +235,14 @@ struct allocDescImpUse
/* FreeEASpace (UDF 2.50 3.3.4.5.1.1) */ /* FreeEASpace (UDF 2.50 3.3.4.5.1.1) */
struct freeEaSpace struct freeEaSpace
{ {
uint16_t headerChecksum; __le16 headerChecksum;
uint8_t freeEASpace[0]; uint8_t freeEASpace[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* DVD Copyright Management Information (UDF 2.50 3.3.4.5.1.2) */ /* DVD Copyright Management Information (UDF 2.50 3.3.4.5.1.2) */
struct DVDCopyrightImpUse struct DVDCopyrightImpUse
{ {
uint16_t headerChecksum; __le16 headerChecksum;
uint8_t CGMSInfo; uint8_t CGMSInfo;
uint8_t dataType; uint8_t dataType;
uint8_t protectionSystemInfo[4]; uint8_t protectionSystemInfo[4];
...@@ -252,7 +252,7 @@ struct DVDCopyrightImpUse ...@@ -252,7 +252,7 @@ struct DVDCopyrightImpUse
/* FreeAppEASpace (UDF 2.50 3.3.4.6.1) */ /* FreeAppEASpace (UDF 2.50 3.3.4.6.1) */
struct freeAppEASpace struct freeAppEASpace
{ {
uint16_t headerChecksum; __le16 headerChecksum;
uint8_t freeEASpace[0]; uint8_t freeEASpace[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
......
...@@ -84,7 +84,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, uint16_t ...@@ -84,7 +84,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, uint16_t
return 0xFFFFFFFF; return 0xFFFFFFFF;
} }
loc = le32_to_cpu(((uint32_t *)bh->b_data)[index]); loc = le32_to_cpu(((__le32 *)bh->b_data)[index]);
udf_release_data(bh); udf_release_data(bh);
......
...@@ -85,13 +85,13 @@ static void udf_write_super(struct super_block *); ...@@ -85,13 +85,13 @@ static void udf_write_super(struct super_block *);
static int udf_remount_fs(struct super_block *, int *, char *); static int udf_remount_fs(struct super_block *, int *, char *);
static int udf_check_valid(struct super_block *, int, int); static int udf_check_valid(struct super_block *, int, int);
static int udf_vrs(struct super_block *sb, int silent); static int udf_vrs(struct super_block *sb, int silent);
static int udf_load_partition(struct super_block *, lb_addr *); static int udf_load_partition(struct super_block *, kernel_lb_addr *);
static int udf_load_logicalvol(struct super_block *, struct buffer_head *, lb_addr *); static int udf_load_logicalvol(struct super_block *, struct buffer_head *, kernel_lb_addr *);
static void udf_load_logicalvolint(struct super_block *, extent_ad); static void udf_load_logicalvolint(struct super_block *, kernel_extent_ad);
static void udf_find_anchor(struct super_block *); static void udf_find_anchor(struct super_block *);
static int udf_find_fileset(struct super_block *, lb_addr *, lb_addr *); static int udf_find_fileset(struct super_block *, kernel_lb_addr *, kernel_lb_addr *);
static void udf_load_pvoldesc(struct super_block *, struct buffer_head *); static void udf_load_pvoldesc(struct super_block *, struct buffer_head *);
static void udf_load_fileset(struct super_block *, struct buffer_head *, lb_addr *); static void udf_load_fileset(struct super_block *, struct buffer_head *, kernel_lb_addr *);
static void udf_load_partdesc(struct super_block *, struct buffer_head *); static void udf_load_partdesc(struct super_block *, struct buffer_head *);
static void udf_open_lvid(struct super_block *); static void udf_open_lvid(struct super_block *);
static void udf_close_lvid(struct super_block *); static void udf_close_lvid(struct super_block *);
...@@ -769,7 +769,7 @@ udf_find_anchor(struct super_block *sb) ...@@ -769,7 +769,7 @@ udf_find_anchor(struct super_block *sb)
} }
static int static int
udf_find_fileset(struct super_block *sb, lb_addr *fileset, lb_addr *root) udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr *root)
{ {
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
long lastblock; long lastblock;
...@@ -792,7 +792,7 @@ udf_find_fileset(struct super_block *sb, lb_addr *fileset, lb_addr *root) ...@@ -792,7 +792,7 @@ udf_find_fileset(struct super_block *sb, lb_addr *fileset, lb_addr *root)
if (!bh) /* Search backwards through the partitions */ if (!bh) /* Search backwards through the partitions */
{ {
lb_addr newfileset; kernel_lb_addr newfileset;
return 1; return 1;
...@@ -874,7 +874,7 @@ udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh) ...@@ -874,7 +874,7 @@ udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh)
if ( udf_stamp_to_time(&recording, &recording_usec, if ( udf_stamp_to_time(&recording, &recording_usec,
lets_to_cpu(pvoldesc->recordingDateAndTime)) ) lets_to_cpu(pvoldesc->recordingDateAndTime)) )
{ {
timestamp ts; kernel_timestamp ts;
ts = lets_to_cpu(pvoldesc->recordingDateAndTime); ts = lets_to_cpu(pvoldesc->recordingDateAndTime);
udf_debug("recording time %ld/%ld, %04u/%02u/%02u %02u:%02u (%x)\n", udf_debug("recording time %ld/%ld, %04u/%02u/%02u %02u:%02u (%x)\n",
recording, recording_usec, recording, recording_usec,
...@@ -901,7 +901,7 @@ udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh) ...@@ -901,7 +901,7 @@ udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh)
} }
static void static void
udf_load_fileset(struct super_block *sb, struct buffer_head *bh, lb_addr *root) udf_load_fileset(struct super_block *sb, struct buffer_head *bh, kernel_lb_addr *root)
{ {
struct fileSetDesc *fset; struct fileSetDesc *fset;
...@@ -948,7 +948,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh) ...@@ -948,7 +948,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
phd = (struct partitionHeaderDesc *)(p->partitionContentsUse); phd = (struct partitionHeaderDesc *)(p->partitionContentsUse);
if (phd->unallocSpaceTable.extLength) if (phd->unallocSpaceTable.extLength)
{ {
lb_addr loc = { le32_to_cpu(phd->unallocSpaceTable.extPosition), i }; kernel_lb_addr loc = { le32_to_cpu(phd->unallocSpaceTable.extPosition), i };
UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table = UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table =
udf_iget(sb, loc); udf_iget(sb, loc);
...@@ -974,7 +974,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh) ...@@ -974,7 +974,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
udf_debug("partitionIntegrityTable (part %d)\n", i); udf_debug("partitionIntegrityTable (part %d)\n", i);
if (phd->freedSpaceTable.extLength) if (phd->freedSpaceTable.extLength)
{ {
lb_addr loc = { le32_to_cpu(phd->freedSpaceTable.extPosition), i }; kernel_lb_addr loc = { le32_to_cpu(phd->freedSpaceTable.extPosition), i };
UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table = UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table =
udf_iget(sb, loc); udf_iget(sb, loc);
...@@ -1013,7 +1013,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh) ...@@ -1013,7 +1013,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
} }
static int static int
udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, lb_addr *fileset) udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, kernel_lb_addr *fileset)
{ {
struct logicalVolDesc *lvd; struct logicalVolDesc *lvd;
int i, j, offset; int i, j, offset;
...@@ -1041,12 +1041,12 @@ udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, lb_addr *fi ...@@ -1041,12 +1041,12 @@ udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, lb_addr *fi
struct udfPartitionMap2 *upm2 = (struct udfPartitionMap2 *)&(lvd->partitionMaps[offset]); struct udfPartitionMap2 *upm2 = (struct udfPartitionMap2 *)&(lvd->partitionMaps[offset]);
if (!strncmp(upm2->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL))) if (!strncmp(upm2->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)))
{ {
if (le16_to_cpu(((uint16_t *)upm2->partIdent.identSuffix)[0]) == 0x0150) if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0150)
{ {
UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP15; UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP15;
UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt15; UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt15;
} }
else if (le16_to_cpu(((uint16_t *)upm2->partIdent.identSuffix)[0]) == 0x0200) else if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0200)
{ {
UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP20; UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP20;
UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt20; UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt20;
...@@ -1110,7 +1110,7 @@ udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, lb_addr *fi ...@@ -1110,7 +1110,7 @@ udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, lb_addr *fi
* *
*/ */
static void static void
udf_load_logicalvolint(struct super_block *sb, extent_ad loc) udf_load_logicalvolint(struct super_block *sb, kernel_extent_ad loc)
{ {
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
uint16_t ident; uint16_t ident;
...@@ -1150,7 +1150,7 @@ udf_load_logicalvolint(struct super_block *sb, extent_ad loc) ...@@ -1150,7 +1150,7 @@ udf_load_logicalvolint(struct super_block *sb, extent_ad loc)
* Written, tested, and released. * Written, tested, and released.
*/ */
static int static int
udf_process_sequence(struct super_block *sb, long block, long lastblock, lb_addr *fileset) udf_process_sequence(struct super_block *sb, long block, long lastblock, kernel_lb_addr *fileset)
{ {
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
struct udf_vds_record vds[VDS_POS_LENGTH]; struct udf_vds_record vds[VDS_POS_LENGTH];
...@@ -1293,7 +1293,7 @@ udf_check_valid(struct super_block *sb, int novrs, int silent) ...@@ -1293,7 +1293,7 @@ udf_check_valid(struct super_block *sb, int novrs, int silent)
} }
static int static int
udf_load_partition(struct super_block *sb, lb_addr *fileset) udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
{ {
struct anchorVolDescPtr *anchor; struct anchorVolDescPtr *anchor;
uint16_t ident; uint16_t ident;
...@@ -1350,7 +1350,7 @@ udf_load_partition(struct super_block *sb, lb_addr *fileset) ...@@ -1350,7 +1350,7 @@ udf_load_partition(struct super_block *sb, lb_addr *fileset)
case UDF_VIRTUAL_MAP15: case UDF_VIRTUAL_MAP15:
case UDF_VIRTUAL_MAP20: case UDF_VIRTUAL_MAP20:
{ {
lb_addr ino; kernel_lb_addr ino;
if (!UDF_SB_LASTBLOCK(sb)) if (!UDF_SB_LASTBLOCK(sb))
{ {
...@@ -1415,7 +1415,7 @@ static void udf_open_lvid(struct super_block *sb) ...@@ -1415,7 +1415,7 @@ static void udf_open_lvid(struct super_block *sb)
if (UDF_SB_LVIDBH(sb)) if (UDF_SB_LVIDBH(sb))
{ {
int i; int i;
timestamp cpu_time; kernel_timestamp cpu_time;
UDF_SB_LVIDIU(sb)->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; UDF_SB_LVIDIU(sb)->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
UDF_SB_LVIDIU(sb)->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; UDF_SB_LVIDIU(sb)->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
...@@ -1443,7 +1443,7 @@ static void udf_close_lvid(struct super_block *sb) ...@@ -1443,7 +1443,7 @@ static void udf_close_lvid(struct super_block *sb)
UDF_SB_LVID(sb)->integrityType == LVID_INTEGRITY_TYPE_OPEN) UDF_SB_LVID(sb)->integrityType == LVID_INTEGRITY_TYPE_OPEN)
{ {
int i; int i;
timestamp cpu_time; kernel_timestamp cpu_time;
UDF_SB_LVIDIU(sb)->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; UDF_SB_LVIDIU(sb)->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
UDF_SB_LVIDIU(sb)->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; UDF_SB_LVIDIU(sb)->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
...@@ -1492,7 +1492,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -1492,7 +1492,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
int i; int i;
struct inode *inode=NULL; struct inode *inode=NULL;
struct udf_options uopt; struct udf_options uopt;
lb_addr rootdir, fileset; kernel_lb_addr rootdir, fileset;
struct udf_sb_info *sbi; struct udf_sb_info *sbi;
uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT); uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT);
...@@ -1616,7 +1616,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -1616,7 +1616,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
if (!silent) if (!silent)
{ {
timestamp ts; kernel_timestamp ts;
udf_time_to_stamp(&ts, UDF_SB_RECORDTIME(sb)); udf_time_to_stamp(&ts, UDF_SB_RECORDTIME(sb));
udf_info("UDF %s (%s) Mounting volume '%s', timestamp %04u/%02u/%02u %02u:%02u (%x)\n", udf_info("UDF %s (%s) Mounting volume '%s', timestamp %04u/%02u/%02u %02u:%02u (%x)\n",
UDFFS_VERSION, UDFFS_DATE, UDFFS_VERSION, UDFFS_DATE,
...@@ -1799,7 +1799,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap) ...@@ -1799,7 +1799,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap)
unsigned int accum = 0; unsigned int accum = 0;
int index; int index;
int block = 0, newblock; int block = 0, newblock;
lb_addr loc; kernel_lb_addr loc;
uint32_t bytes; uint32_t bytes;
uint8_t value; uint8_t value;
uint8_t *ptr; uint8_t *ptr;
...@@ -1866,7 +1866,7 @@ udf_count_free_table(struct super_block *sb, struct inode * table) ...@@ -1866,7 +1866,7 @@ udf_count_free_table(struct super_block *sb, struct inode * table)
{ {
unsigned int accum = 0; unsigned int accum = 0;
uint32_t extoffset, elen; uint32_t extoffset, elen;
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
int8_t etype; int8_t etype;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
#include "udf_i.h" #include "udf_i.h"
#include "udf_sb.h" #include "udf_sb.h"
static void extent_trunc(struct inode * inode, lb_addr bloc, int extoffset, static void extent_trunc(struct inode * inode, kernel_lb_addr bloc, int extoffset,
lb_addr eloc, int8_t etype, uint32_t elen, struct buffer_head *bh, uint32_t nelen) kernel_lb_addr eloc, int8_t etype, uint32_t elen, struct buffer_head *bh, uint32_t nelen)
{ {
lb_addr neloc = { 0, 0 }; kernel_lb_addr neloc = { 0, 0 };
int last_block = (elen + inode->i_sb->s_blocksize - 1) >> inode->i_sb->s_blocksize_bits; int last_block = (elen + inode->i_sb->s_blocksize - 1) >> inode->i_sb->s_blocksize_bits;
int first_block = (nelen + inode->i_sb->s_blocksize - 1) >> inode->i_sb->s_blocksize_bits; int first_block = (nelen + inode->i_sb->s_blocksize - 1) >> inode->i_sb->s_blocksize_bits;
...@@ -68,7 +68,7 @@ static void extent_trunc(struct inode * inode, lb_addr bloc, int extoffset, ...@@ -68,7 +68,7 @@ static void extent_trunc(struct inode * inode, lb_addr bloc, int extoffset,
void udf_discard_prealloc(struct inode * inode) void udf_discard_prealloc(struct inode * inode)
{ {
lb_addr bloc, eloc; kernel_lb_addr bloc, eloc;
uint32_t extoffset = 0, elen, nelen; uint32_t extoffset = 0, elen, nelen;
uint64_t lbcount = 0; uint64_t lbcount = 0;
int8_t etype = -1, netype; int8_t etype = -1, netype;
...@@ -129,7 +129,7 @@ void udf_discard_prealloc(struct inode * inode) ...@@ -129,7 +129,7 @@ void udf_discard_prealloc(struct inode * inode)
void udf_truncate_extents(struct inode * inode) void udf_truncate_extents(struct inode * inode)
{ {
lb_addr bloc, eloc, neloc = { 0, 0 }; kernel_lb_addr bloc, eloc, neloc = { 0, 0 };
uint32_t extoffset, elen, offset, nelen = 0, lelen = 0, lenalloc; uint32_t extoffset, elen, offset, nelen = 0, lelen = 0, lenalloc;
int8_t etype; int8_t etype;
int first_block = inode->i_size >> inode->i_sb->s_blocksize_bits; int first_block = inode->i_size >> inode->i_sb->s_blocksize_bits;
...@@ -254,7 +254,7 @@ void udf_truncate_extents(struct inode * inode) ...@@ -254,7 +254,7 @@ void udf_truncate_extents(struct inode * inode)
} }
else if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30)) else if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30))
{ {
lb_addr neloc = { 0, 0 }; kernel_lb_addr neloc = { 0, 0 };
extoffset -= adsize; extoffset -= adsize;
nelen = EXT_NOT_RECORDED_NOT_ALLOCATED | nelen = EXT_NOT_RECORDED_NOT_ALLOCATED |
((elen + offset + inode->i_sb->s_blocksize - 1) & ((elen + offset + inode->i_sb->s_blocksize - 1) &
...@@ -272,7 +272,7 @@ void udf_truncate_extents(struct inode * inode) ...@@ -272,7 +272,7 @@ void udf_truncate_extents(struct inode * inode)
~(inode->i_sb->s_blocksize - 1)); ~(inode->i_sb->s_blocksize - 1));
udf_write_aext(inode, bloc, &extoffset, eloc, elen, bh, 1); udf_write_aext(inode, bloc, &extoffset, eloc, elen, bh, 1);
} }
memset(&eloc, 0x00, sizeof(lb_addr)); memset(&eloc, 0x00, sizeof(kernel_lb_addr));
elen = EXT_NOT_RECORDED_NOT_ALLOCATED | offset; elen = EXT_NOT_RECORDED_NOT_ALLOCATED | offset;
udf_add_aext(inode, &bloc, &extoffset, eloc, elen, &bh, 1); udf_add_aext(inode, &bloc, &extoffset, eloc, elen, &bh, 1);
} }
......
...@@ -68,7 +68,7 @@ struct udf_vds_record ...@@ -68,7 +68,7 @@ struct udf_vds_record
struct generic_desc struct generic_desc
{ {
tag descTag; tag descTag;
uint32_t volDescSeqNum; __le32 volDescSeqNum;
}; };
struct ustr struct ustr
...@@ -89,7 +89,7 @@ extern int udf_write_fi(struct inode *inode, struct fileIdentDesc *, struct file ...@@ -89,7 +89,7 @@ extern int udf_write_fi(struct inode *inode, struct fileIdentDesc *, struct file
extern int udf_ioctl(struct inode *, struct file *, unsigned int, unsigned long); extern int udf_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
/* inode.c */ /* inode.c */
extern struct inode *udf_iget(struct super_block *, lb_addr); extern struct inode *udf_iget(struct super_block *, kernel_lb_addr);
extern int udf_sync_inode(struct inode *); extern int udf_sync_inode(struct inode *);
extern void udf_expand_file_adinicb(struct inode *, int, int *); extern void udf_expand_file_adinicb(struct inode *, int, int *);
extern struct buffer_head * udf_expand_dir_adinicb(struct inode *, int *, int *); extern struct buffer_head * udf_expand_dir_adinicb(struct inode *, int *, int *);
...@@ -101,12 +101,12 @@ extern void udf_delete_inode(struct inode *); ...@@ -101,12 +101,12 @@ extern void udf_delete_inode(struct inode *);
extern void udf_clear_inode(struct inode *); extern void udf_clear_inode(struct inode *);
extern void udf_write_inode(struct inode *, int); extern void udf_write_inode(struct inode *, int);
extern long udf_block_map(struct inode *, long); extern long udf_block_map(struct inode *, long);
extern int8_t inode_bmap(struct inode *, int, lb_addr *, uint32_t *, lb_addr *, uint32_t *, uint32_t *, struct buffer_head **); extern int8_t inode_bmap(struct inode *, int, kernel_lb_addr *, uint32_t *, kernel_lb_addr *, uint32_t *, uint32_t *, struct buffer_head **);
extern int8_t udf_add_aext(struct inode *, lb_addr *, int *, lb_addr, uint32_t, struct buffer_head **, int); extern int8_t udf_add_aext(struct inode *, kernel_lb_addr *, int *, kernel_lb_addr, uint32_t, struct buffer_head **, int);
extern int8_t udf_write_aext(struct inode *, lb_addr, int *, lb_addr, uint32_t, struct buffer_head *, int); extern int8_t udf_write_aext(struct inode *, kernel_lb_addr, int *, kernel_lb_addr, uint32_t, struct buffer_head *, int);
extern int8_t udf_delete_aext(struct inode *, lb_addr, int, lb_addr, uint32_t, struct buffer_head *); extern int8_t udf_delete_aext(struct inode *, kernel_lb_addr, int, kernel_lb_addr, uint32_t, struct buffer_head *);
extern int8_t udf_next_aext(struct inode *, lb_addr *, int *, lb_addr *, uint32_t *, struct buffer_head **, int); extern int8_t udf_next_aext(struct inode *, kernel_lb_addr *, int *, kernel_lb_addr *, uint32_t *, struct buffer_head **, int);
extern int8_t udf_current_aext(struct inode *, lb_addr *, int *, lb_addr *, uint32_t *, struct buffer_head **, int); extern int8_t udf_current_aext(struct inode *, kernel_lb_addr *, int *, kernel_lb_addr *, uint32_t *, struct buffer_head **, int);
/* misc.c */ /* misc.c */
extern struct buffer_head *udf_tgetblk(struct super_block *, int); extern struct buffer_head *udf_tgetblk(struct super_block *, int);
...@@ -114,7 +114,7 @@ extern struct buffer_head *udf_tread(struct super_block *, int); ...@@ -114,7 +114,7 @@ extern struct buffer_head *udf_tread(struct super_block *, int);
extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, uint32_t, uint8_t); extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, uint32_t, uint8_t);
extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, uint8_t); extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, uint8_t);
extern struct buffer_head *udf_read_tagged(struct super_block *, uint32_t, uint32_t, uint16_t *); extern struct buffer_head *udf_read_tagged(struct super_block *, uint32_t, uint32_t, uint16_t *);
extern struct buffer_head *udf_read_ptagged(struct super_block *, lb_addr, uint32_t, uint16_t *); extern struct buffer_head *udf_read_ptagged(struct super_block *, kernel_lb_addr, uint32_t, uint16_t *);
extern void udf_release_data(struct buffer_head *); extern void udf_release_data(struct buffer_head *);
extern void udf_update_tag(char *, int); extern void udf_update_tag(char *, int);
extern void udf_new_tag(char *, uint16_t, uint16_t, uint16_t, uint32_t, int); extern void udf_new_tag(char *, uint16_t, uint16_t, uint16_t, uint32_t, int);
...@@ -145,7 +145,7 @@ extern void udf_discard_prealloc(struct inode *); ...@@ -145,7 +145,7 @@ extern void udf_discard_prealloc(struct inode *);
extern void udf_truncate_extents(struct inode *); extern void udf_truncate_extents(struct inode *);
/* balloc.c */ /* balloc.c */
extern void udf_free_blocks(struct super_block *, struct inode *, lb_addr, uint32_t, uint32_t); extern void udf_free_blocks(struct super_block *, struct inode *, kernel_lb_addr, uint32_t, uint32_t);
extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t, uint32_t, uint32_t); extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t, uint32_t, uint32_t);
extern int udf_new_block(struct super_block *, struct inode *, uint16_t, uint32_t, int *); extern int udf_new_block(struct super_block *, struct inode *, uint16_t, uint32_t, int *);
...@@ -153,7 +153,7 @@ extern int udf_new_block(struct super_block *, struct inode *, uint16_t, uint32_ ...@@ -153,7 +153,7 @@ extern int udf_new_block(struct super_block *, struct inode *, uint16_t, uint32_
extern int udf_fsync_file(struct file *, struct dentry *, int); extern int udf_fsync_file(struct file *, struct dentry *, int);
/* directory.c */ /* directory.c */
extern struct fileIdentDesc * udf_fileident_read(struct inode *, loff_t *, struct udf_fileident_bh *, struct fileIdentDesc *, lb_addr *, uint32_t *, lb_addr *, uint32_t *, uint32_t *, struct buffer_head **); extern struct fileIdentDesc * udf_fileident_read(struct inode *, loff_t *, struct udf_fileident_bh *, struct fileIdentDesc *, kernel_lb_addr *, uint32_t *, kernel_lb_addr *, uint32_t *, uint32_t *, struct buffer_head **);
extern struct fileIdentDesc * udf_get_fileident(void * buffer, int bufsize, int * offset); extern struct fileIdentDesc * udf_get_fileident(void * buffer, int bufsize, int * offset);
extern long_ad * udf_get_filelongad(uint8_t *, int, int *, int); extern long_ad * udf_get_filelongad(uint8_t *, int, int *, int);
extern short_ad * udf_get_fileshortad(uint8_t *, int, int *, int); extern short_ad * udf_get_fileshortad(uint8_t *, int, int *, int);
...@@ -162,7 +162,7 @@ extern short_ad * udf_get_fileshortad(uint8_t *, int, int *, int); ...@@ -162,7 +162,7 @@ extern short_ad * udf_get_fileshortad(uint8_t *, int, int *, int);
extern uint16_t udf_crc(uint8_t *, uint32_t, uint16_t); extern uint16_t udf_crc(uint8_t *, uint32_t, uint16_t);
/* udftime.c */ /* udftime.c */
extern time_t *udf_stamp_to_time(time_t *, long *, timestamp); extern time_t *udf_stamp_to_time(time_t *, long *, kernel_timestamp);
extern timestamp *udf_time_to_stamp(timestamp *, struct timespec); extern kernel_timestamp *udf_time_to_stamp(kernel_timestamp *, struct timespec);
#endif /* __UDF_DECL_H */ #endif /* __UDF_DECL_H */
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/string.h> #include <linux/string.h>
static inline lb_addr lelb_to_cpu(lb_addr in) static inline kernel_lb_addr lelb_to_cpu(lb_addr in)
{ {
lb_addr out; kernel_lb_addr out;
out.logicalBlockNum = le32_to_cpu(in.logicalBlockNum); out.logicalBlockNum = le32_to_cpu(in.logicalBlockNum);
out.partitionReferenceNum = le16_to_cpu(in.partitionReferenceNum); out.partitionReferenceNum = le16_to_cpu(in.partitionReferenceNum);
return out; return out;
} }
static inline lb_addr cpu_to_lelb(lb_addr in) static inline lb_addr cpu_to_lelb(kernel_lb_addr in)
{ {
lb_addr out; lb_addr out;
out.logicalBlockNum = cpu_to_le32(in.logicalBlockNum); out.logicalBlockNum = cpu_to_le32(in.logicalBlockNum);
...@@ -20,9 +20,9 @@ static inline lb_addr cpu_to_lelb(lb_addr in) ...@@ -20,9 +20,9 @@ static inline lb_addr cpu_to_lelb(lb_addr in)
return out; return out;
} }
static inline timestamp lets_to_cpu(timestamp in) static inline kernel_timestamp lets_to_cpu(timestamp in)
{ {
timestamp out; kernel_timestamp out;
memcpy(&out, &in, sizeof(timestamp)); memcpy(&out, &in, sizeof(timestamp));
out.typeAndTimezone = le16_to_cpu(in.typeAndTimezone); out.typeAndTimezone = le16_to_cpu(in.typeAndTimezone);
out.year = le16_to_cpu(in.year); out.year = le16_to_cpu(in.year);
...@@ -45,15 +45,15 @@ static inline short_ad cpu_to_lesa(short_ad in) ...@@ -45,15 +45,15 @@ static inline short_ad cpu_to_lesa(short_ad in)
return out; return out;
} }
static inline long_ad lela_to_cpu(long_ad in) static inline kernel_long_ad lela_to_cpu(long_ad in)
{ {
long_ad out; kernel_long_ad out;
out.extLength = le32_to_cpu(in.extLength); out.extLength = le32_to_cpu(in.extLength);
out.extLocation = lelb_to_cpu(in.extLocation); out.extLocation = lelb_to_cpu(in.extLocation);
return out; return out;
} }
static inline long_ad cpu_to_lela(long_ad in) static inline long_ad cpu_to_lela(kernel_long_ad in)
{ {
long_ad out; long_ad out;
out.extLength = cpu_to_le32(in.extLength); out.extLength = cpu_to_le32(in.extLength);
...@@ -61,15 +61,15 @@ static inline long_ad cpu_to_lela(long_ad in) ...@@ -61,15 +61,15 @@ static inline long_ad cpu_to_lela(long_ad in)
return out; return out;
} }
static inline extent_ad leea_to_cpu(extent_ad in) static inline kernel_extent_ad leea_to_cpu(extent_ad in)
{ {
extent_ad out; kernel_extent_ad out;
out.extLength = le32_to_cpu(in.extLength); out.extLength = le32_to_cpu(in.extLength);
out.extLocation = le32_to_cpu(in.extLocation); out.extLocation = le32_to_cpu(in.extLocation);
return out; return out;
} }
static inline timestamp cpu_to_lets(timestamp in) static inline timestamp cpu_to_lets(kernel_timestamp in)
{ {
timestamp out; timestamp out;
memcpy(&out, &in, sizeof(timestamp)); memcpy(&out, &in, sizeof(timestamp));
......
...@@ -85,7 +85,7 @@ extern struct timezone sys_tz; ...@@ -85,7 +85,7 @@ extern struct timezone sys_tz;
#define SECS_PER_DAY (SECS_PER_HOUR * 24) #define SECS_PER_DAY (SECS_PER_HOUR * 24)
time_t * time_t *
udf_stamp_to_time(time_t *dest, long *dest_usec, timestamp src) udf_stamp_to_time(time_t *dest, long *dest_usec, kernel_timestamp src)
{ {
int yday; int yday;
uint8_t type = src.typeAndTimezone >> 12; uint8_t type = src.typeAndTimezone >> 12;
...@@ -120,8 +120,8 @@ udf_stamp_to_time(time_t *dest, long *dest_usec, timestamp src) ...@@ -120,8 +120,8 @@ udf_stamp_to_time(time_t *dest, long *dest_usec, timestamp src)
} }
timestamp * kernel_timestamp *
udf_time_to_stamp(timestamp *dest, struct timespec ts) udf_time_to_stamp(kernel_timestamp *dest, struct timespec ts)
{ {
long int days, rem, y; long int days, rem, y;
const unsigned short int *ip; const unsigned short int *ip;
......
...@@ -45,7 +45,7 @@ struct udf_inode_info ...@@ -45,7 +45,7 @@ struct udf_inode_info
{ {
struct timespec i_crtime; struct timespec i_crtime;
/* Physical address of inode */ /* Physical address of inode */
lb_addr i_location; kernel_lb_addr i_location;
__u64 i_unique; __u64 i_unique;
__u32 i_lenEAttr; __u32 i_lenEAttr;
__u32 i_lenAlloc; __u32 i_lenAlloc;
......
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