#define xleNUM_to_cpup(x,y) (le ## x ## _to_cpup(y))
#define uintBPL_t uint(BITS_PER_LONG)
#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)
{
{
struct buffer_head *bh = NULL;
int retval = 0;
- lb_addr loc;
+ kernel_lb_addr loc;
loc.logicalBlockNum = bitmap->s_extPosition;
loc.partitionReferenceNum = UDF_SB_PARTITION(sb);
static void udf_bitmap_free_blocks(struct super_block * sb,
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;
unsigned long block;
static void udf_table_free_blocks(struct super_block * sb,
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 nextoffset, oextoffset, elen;
- lb_addr nbloc, obloc, eloc;
+ kernel_lb_addr nbloc, obloc, eloc;
struct buffer_head *obh, *nbh;
int8_t etype;
int i;
{
int alloc_count = 0;
uint32_t extoffset, elen, adsize;
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
struct buffer_head *bh;
int8_t etype = -1;
uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF;
uint32_t newblock = 0, adsize;
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;
int8_t etype;
inline void udf_free_blocks(struct super_block * sb,
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;
uint8_t lfi;
loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
struct buffer_head * bh = NULL, * tmp, * bha[16];
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset;
int i, num;
unsigned int dt_type;
}
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);
flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);
#if 0
static uint8_t *
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)
{
int loffset = *offset;
udf_fileident_read(struct inode *dir, loff_t *nf_pos,
struct udf_fileident_bh *fibh,
struct fileIdentDesc *cfi,
- lb_addr *bloc, uint32_t *extoffset,
- lb_addr *eloc, uint32_t *elen,
+ kernel_lb_addr *bloc, uint32_t *extoffset,
+ kernel_lb_addr *eloc, uint32_t *elen,
uint32_t *offset, struct buffer_head **bh)
{
struct fileIdentDesc *fi;
typedef uint8_t dstring;
/* 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
{
uint16_t typeAndTimezone;
uint8_t centiseconds;
uint8_t hundredsOfMicroseconds;
uint8_t microseconds;
-} __attribute__ ((packed)) timestamp;
+} __attribute__ ((packed)) kernel_timestamp;
/* Type and Time Zone (ECMA 167r3 1/7.3.1) */
#define TIMESTAMP_TYPE_MASK 0xF000
uint8_t reserved1;
regid archType;
regid bootIdent;
- uint32_t bootExtLocation;
- uint32_t bootExtLength;
- uint64_t loadAddress;
- uint64_t startAddress;
+ __le32 bootExtLocation;
+ __le32 bootExtLength;
+ __le64 loadAddress;
+ __le64 startAddress;
timestamp descCreationDateAndTime;
- uint16_t flags;
+ __le16 flags;
uint8_t reserved2[32];
uint8_t bootUse[1906];
} __attribute__ ((packed));
#define BOOT_FLAGS_ERASE 0x01
/* Extent Descriptor (ECMA 167r3 3/7.1) */
+typedef struct
+{
+ __le32 extLength;
+ __le32 extLocation;
+} __attribute__ ((packed)) extent_ad;
+
typedef struct
{
uint32_t extLength;
uint32_t extLocation;
-} __attribute__ ((packed)) extent_ad;
+} kernel_extent_ad;
/* Descriptor Tag (ECMA 167r3 3/7.2) */
typedef struct
{
- uint16_t tagIdent;
- uint16_t descVersion;
+ __le16 tagIdent;
+ __le16 descVersion;
uint8_t tagChecksum;
uint8_t reserved;
- uint16_t tagSerialNum;
- uint16_t descCRC;
- uint16_t descCRCLength;
- uint32_t tagLocation;
+ __le16 tagSerialNum;
+ __le16 descCRC;
+ __le16 descCRCLength;
+ __le32 tagLocation;
} __attribute__ ((packed)) tag;
/* Tag Identifier (ECMA 167r3 3/7.2.1) */
struct primaryVolDesc
{
tag descTag;
- uint32_t volDescSeqNum;
- uint32_t primaryVolDescNum;
+ __le32 volDescSeqNum;
+ __le32 primaryVolDescNum;
dstring volIdent[32];
- uint16_t volSeqNum;
- uint16_t maxVolSeqNum;
- uint16_t interchangeLvl;
- uint16_t maxInterchangeLvl;
- uint32_t charSetList;
- uint32_t maxCharSetList;
+ __le16 volSeqNum;
+ __le16 maxVolSeqNum;
+ __le16 interchangeLvl;
+ __le16 maxInterchangeLvl;
+ __le32 charSetList;
+ __le32 maxCharSetList;
dstring volSetIdent[128];
charspec descCharSet;
charspec explanatoryCharSet;
timestamp recordingDateAndTime;
regid impIdent;
uint8_t impUse[64];
- uint32_t predecessorVolDescSeqLocation;
- uint16_t flags;
+ __le32 predecessorVolDescSeqLocation;
+ __le16 flags;
uint8_t reserved[22];
} __attribute__ ((packed));
struct volDescPtr
{
tag descTag;
- uint32_t volDescSeqNum;
+ __le32 volDescSeqNum;
extent_ad nextVolDescSeqExt;
uint8_t reserved[484];
} __attribute__ ((packed));
struct impUseVolDesc
{
tag descTag;
- uint32_t volDescSeqNum;
+ __le32 volDescSeqNum;
regid impIdent;
uint8_t impUse[460];
} __attribute__ ((packed));
struct partitionDesc
{
tag descTag;
- uint32_t volDescSeqNum;
- uint16_t partitionFlags;
- uint16_t partitionNumber;
+ __le32 volDescSeqNum;
+ __le16 partitionFlags;
+ __le16 partitionNumber;
regid partitionContents;
uint8_t partitionContentsUse[128];
- uint32_t accessType;
- uint32_t partitionStartingLocation;
- uint32_t partitionLength;
+ __le32 accessType;
+ __le32 partitionStartingLocation;
+ __le32 partitionLength;
regid impIdent;
uint8_t impUse[128];
uint8_t reserved[156];
struct logicalVolDesc
{
tag descTag;
- uint32_t volDescSeqNum;
+ __le32 volDescSeqNum;
charspec descCharSet;
dstring logicalVolIdent[128];
- uint32_t logicalBlockSize;
+ __le32 logicalBlockSize;
regid domainIdent;
uint8_t logicalVolContentsUse[16];
- uint32_t mapTableLength;
- uint32_t numPartitionMaps;
+ __le32 mapTableLength;
+ __le32 numPartitionMaps;
regid impIdent;
uint8_t impUse[128];
extent_ad integritySeqExt;
{
uint8_t partitionMapType;
uint8_t partitionMapLength;
- uint16_t volSeqNum;
- uint16_t partitionNum;
+ __le16 volSeqNum;
+ __le16 partitionNum;
} __attribute__ ((packed));
/* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */
struct unallocSpaceDesc
{
tag descTag;
- uint32_t volDescSeqNum;
- uint32_t numAllocDescs;
+ __le32 volDescSeqNum;
+ __le32 numAllocDescs;
extent_ad allocDescs[0];
} __attribute__ ((packed));
{
tag descTag;
timestamp recordingDateAndTime;
- uint32_t integrityType;
+ __le32 integrityType;
extent_ad nextIntegrityExt;
uint8_t logicalVolContentsUse[32];
- uint32_t numOfPartitions;
- uint32_t lengthOfImpUse;
- uint32_t freeSpaceTable[0];
- uint32_t sizeTable[0];
+ __le32 numOfPartitions;
+ __le32 lengthOfImpUse;
+ __le32 freeSpaceTable[0];
+ __le32 sizeTable[0];
uint8_t impUse[0];
} __attribute__ ((packed));
/* Recorded Address (ECMA 167r3 4/7.1) */
typedef struct
{
- uint32_t logicalBlockNum;
- uint16_t partitionReferenceNum;
+ __le32 logicalBlockNum;
+ __le16 partitionReferenceNum;
} __attribute__ ((packed)) lb_addr;
+/* ... and its in-core analog */
+typedef struct
+{
+ uint32_t logicalBlockNum;
+ uint16_t partitionReferenceNum;
+} kernel_lb_addr;
+
/* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
typedef struct
{
- uint32_t extLength;
- uint32_t extPosition;
+ __le32 extLength;
+ __le32 extPosition;
} __attribute__ ((packed)) short_ad;
/* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
typedef struct
{
- uint32_t extLength;
+ __le32 extLength;
lb_addr extLocation;
uint8_t impUse[6];
} __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) */
+typedef struct
+{
+ __le32 extLength;
+ __le32 recordedLength;
+ __le32 informationLength;
+ lb_addr extLocation;
+} __attribute__ ((packed)) ext_ad;
+
typedef struct
{
uint32_t extLength;
uint32_t recordedLength;
uint32_t informationLength;
- lb_addr extLocation;
-} __attribute__ ((packed)) ext_ad;
+ kernel_lb_addr extLocation;
+} kernel_ext_ad;
/* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */
{
tag descTag;
timestamp recordingDateAndTime;
- uint16_t interchangeLvl;
- uint16_t maxInterchangeLvl;
- uint32_t charSetList;
- uint32_t maxCharSetList;
- uint32_t fileSetNum;
- uint32_t fileSetDescNum;
+ __le16 interchangeLvl;
+ __le16 maxInterchangeLvl;
+ __le32 charSetList;
+ __le32 maxCharSetList;
+ __le32 fileSetNum;
+ __le32 fileSetDescNum;
charspec logicalVolIdentCharSet;
dstring logicalVolIdent[128];
charspec fileSetCharSet;
struct fileIdentDesc
{
tag descTag;
- uint16_t fileVersionNum;
+ __le16 fileVersionNum;
uint8_t fileCharacteristics;
uint8_t lengthFileIdent;
long_ad icb;
- uint16_t lengthOfImpUse;
+ __le16 lengthOfImpUse;
uint8_t impUse[0];
uint8_t fileIdent[0];
uint8_t padding[0];
struct allocExtDesc
{
tag descTag;
- uint32_t previousAllocExtLocation;
- uint32_t lengthAllocDescs;
+ __le32 previousAllocExtLocation;
+ __le32 lengthAllocDescs;
} __attribute__ ((packed));
/* ICB Tag (ECMA 167r3 4/14.6) */
typedef struct
{
- uint32_t priorRecordedNumDirectEntries;
- uint16_t strategyType;
- uint16_t strategyParameter;
- uint16_t numEntries;
+ __le32 priorRecordedNumDirectEntries;
+ __le16 strategyType;
+ __le16 strategyParameter;
+ __le16 numEntries;
uint8_t reserved;
uint8_t fileType;
lb_addr parentICBLocation;
- uint16_t flags;
+ __le16 flags;
} __attribute__ ((packed)) icbtag;
/* Strategy Type (ECMA 167r3 4/14.6.2) */
{
tag descTag;
icbtag icbTag;
- uint32_t uid;
- uint32_t gid;
- uint32_t permissions;
- uint16_t fileLinkCount;
+ __le32 uid;
+ __le32 gid;
+ __le32 permissions;
+ __le16 fileLinkCount;
uint8_t recordFormat;
uint8_t recordDisplayAttr;
- uint32_t recordLength;
- uint64_t informationLength;
- uint64_t logicalBlocksRecorded;
+ __le32 recordLength;
+ __le64 informationLength;
+ __le64 logicalBlocksRecorded;
timestamp accessTime;
timestamp modificationTime;
timestamp attrTime;
- uint32_t checkpoint;
+ __le32 checkpoint;
long_ad extendedAttrICB;
regid impIdent;
- uint64_t uniqueID;
- uint32_t lengthExtendedAttr;
- uint32_t lengthAllocDescs;
+ __le64 uniqueID;
+ __le32 lengthExtendedAttr;
+ __le32 lengthAllocDescs;
uint8_t extendedAttr[0];
uint8_t allocDescs[0];
} __attribute__ ((packed));
struct extendedAttrHeaderDesc
{
tag descTag;
- uint32_t impAttrLocation;
- uint32_t appAttrLocation;
+ __le32 impAttrLocation;
+ __le32 appAttrLocation;
} __attribute__ ((packed));
/* Generic Format (ECMA 167r3 4/14.10.2) */
struct genericFormat
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
+ __le32 attrLength;
uint8_t attrData[0];
} __attribute__ ((packed));
/* Character Set Information (ECMA 167r3 4/14.10.3) */
struct charSetInfo
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
- uint32_t escapeSeqLength;
+ __le32 attrLength;
+ __le32 escapeSeqLength;
uint8_t charSetType;
uint8_t escapeSeq[0];
} __attribute__ ((packed));
/* Alternate Permissions (ECMA 167r3 4/14.10.4) */
struct altPerms
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
- uint16_t ownerIdent;
- uint16_t groupIdent;
- uint16_t permission;
+ __le32 attrLength;
+ __le16 ownerIdent;
+ __le16 groupIdent;
+ __le16 permission;
} __attribute__ ((packed));
/* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */
struct fileTimesExtAttr
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
- uint32_t dataLength;
- uint32_t fileTimeExistence;
+ __le32 attrLength;
+ __le32 dataLength;
+ __le32 fileTimeExistence;
uint8_t fileTimes;
} __attribute__ ((packed));
/* Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */
struct infoTimesExtAttr
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
- uint32_t dataLength;
- uint32_t infoTimeExistence;
+ __le32 attrLength;
+ __le32 dataLength;
+ __le32 infoTimeExistence;
uint8_t infoTimes[0];
} __attribute__ ((packed));
/* Device Specification (ECMA 167r3 4/14.10.7) */
struct deviceSpec
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
- uint32_t impUseLength;
- uint32_t majorDeviceIdent;
- uint32_t minorDeviceIdent;
+ __le32 attrLength;
+ __le32 impUseLength;
+ __le32 majorDeviceIdent;
+ __le32 minorDeviceIdent;
uint8_t impUse[0];
} __attribute__ ((packed));
/* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */
struct impUseExtAttr
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
- uint32_t impUseLength;
+ __le32 attrLength;
+ __le32 impUseLength;
regid impIdent;
uint8_t impUse[0];
} __attribute__ ((packed));
/* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */
struct appUseExtAttr
{
- uint32_t attrType;
+ __le32 attrType;
uint8_t attrSubtype;
uint8_t reserved[3];
- uint32_t attrLength;
- uint32_t appUseLength;
+ __le32 attrLength;
+ __le32 appUseLength;
regid appIdent;
uint8_t appUse[0];
} __attribute__ ((packed));
{
tag descTag;
icbtag icbTag;
- uint32_t lengthAllocDescs;
+ __le32 lengthAllocDescs;
uint8_t allocDescs[0];
} __attribute__ ((packed));
struct spaceBitmapDesc
{
tag descTag;
- uint32_t numOfBits;
- uint32_t numOfBytes;
+ __le32 numOfBits;
+ __le32 numOfBytes;
uint8_t bitmap[0];
} __attribute__ ((packed));
/* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */
struct logicalVolHeaderDesc
{
- uint64_t uniqueID;
+ __le64 uniqueID;
uint8_t reserved[24];
} __attribute__ ((packed));
{
uint8_t componentType;
uint8_t lengthComponentIdent;
- uint16_t componentFileVersionNum;
+ __le16 componentFileVersionNum;
dstring componentIdent[0];
} __attribute__ ((packed));
{
tag descTag;
icbtag icbTag;
- uint32_t uid;
- uint32_t gid;
- uint32_t permissions;
- uint16_t fileLinkCount;
+ __le32 uid;
+ __le32 gid;
+ __le32 permissions;
+ __le16 fileLinkCount;
uint8_t recordFormat;
uint8_t recordDisplayAttr;
- uint32_t recordLength;
- uint64_t informationLength;
- uint64_t objectSize;
- uint64_t logicalBlocksRecorded;
+ __le32 recordLength;
+ __le64 informationLength;
+ __le64 objectSize;
+ __le64 logicalBlocksRecorded;
timestamp accessTime;
timestamp modificationTime;
timestamp createTime;
timestamp attrTime;
- uint32_t checkpoint;
- uint32_t reserved;
+ __le32 checkpoint;
+ __le32 reserved;
long_ad extendedAttrICB;
long_ad streamDirectoryICB;
regid impIdent;
- uint64_t uniqueID;
- uint32_t lengthExtendedAttr;
- uint32_t lengthAllocDescs;
+ __le64 uniqueID;
+ __le32 lengthExtendedAttr;
+ __le32 lengthAllocDescs;
uint8_t extendedAttr[0];
uint8_t allocDescs[0];
} __attribute__ ((packed));
static int8_t udf_insert_aext(struct inode *, lb_addr, int,
lb_addr, uint32_t, struct buffer_head *);
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,
- long_ad [EXTENT_MERGE_SIZE], int *);
+ kernel_long_ad [EXTENT_MERGE_SIZE], int *);
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 *,
- long_ad [EXTENT_MERGE_SIZE], int, int,
- lb_addr, uint32_t, struct buffer_head **);
+ kernel_long_ad [EXTENT_MERGE_SIZE], int, int,
+ kernel_lb_addr, uint32_t, struct buffer_head **);
static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int);
/*
{
int newblock;
struct buffer_head *sbh = NULL, *dbh = NULL;
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
uint32_t elen, extoffset;
uint8_t alloctype;
int *err, long *phys, int *new)
{
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;
int count = 0, startnum = 0, endnum = 0;
uint32_t elen = 0;
- lb_addr eloc, pbloc, cbloc, nbloc;
+ kernel_lb_addr eloc, pbloc, cbloc, nbloc;
int c = 1;
uint64_t lbcount = 0, b_off = 0;
uint32_t newblocknum, newblock, offset = 0;
c = !c;
laarr[c].extLength = EXT_NOT_RECORDED_NOT_ALLOCATED |
((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 ++;
endnum ++;
lastblock = 1;
}
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) ||
(laarr[*c].extLength >> 30) == (EXT_NOT_RECORDED_NOT_ALLOCATED >> 30))
}
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;
}
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;
}
static void udf_update_extents(struct inode *inode,
- long_ad laarr[EXTENT_MERGE_SIZE], int startnum, int endnum,
- lb_addr pbloc, uint32_t pextoffset, struct buffer_head **pbh)
+ kernel_long_ad laarr[EXTENT_MERGE_SIZE], int startnum, int endnum,
+ kernel_lb_addr pbloc, uint32_t pextoffset, struct buffer_head **pbh)
{
int start = 0, i;
- lb_addr tmploc;
+ kernel_lb_addr tmploc;
uint32_t tmplen;
if (startnum > endnum)
void
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
{
if (ibh)
{
- lb_addr loc;
+ kernel_lb_addr loc;
ie = (struct indirectEntry *)ibh->b_data;
loc = lelb_to_cpu(ie->indirectICB.extLocation);
if (ident == TAG_IDENT_FE ||
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(ibh);
udf_release_data(nbh);
uint16_t icbflags;
uint16_t crclen;
int i;
- timestamp cpu_time;
+ kernel_timestamp cpu_time;
int err = 0;
bh = udf_tread(inode->i_sb,
fe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode));
fe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(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);
}
else
efe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode));
efe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(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);
}
if (UDF_I_STRAT4096(inode))
* 12/19/98 dgb Added semaphore and changed to be a wrapper of iget
*/
struct inode *
-udf_iget(struct super_block *sb, lb_addr ino)
+udf_iget(struct super_block *sb, kernel_lb_addr ino)
{
struct inode *inode;
unsigned long block;
else if (UDF_I_LOCATION(inode).logicalBlockNum == 0xFFFFFFFF &&
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);
if (is_bad_inode(inode))
{
return inode;
}
-int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
- lb_addr eloc, uint32_t elen, struct buffer_head **bh, int inc)
+int8_t udf_add_aext(struct inode *inode, kernel_lb_addr *bloc, int *extoffset,
+ kernel_lb_addr eloc, uint32_t elen, struct buffer_head **bh, int inc)
{
int adsize;
short_ad *sad = NULL;
char *sptr, *dptr;
struct buffer_head *nbh;
int err, loffset;
- lb_addr obloc = *bloc;
+ kernel_lb_addr obloc = *bloc;
if (!(bloc->logicalBlockNum = udf_new_block(inode->i_sb, NULL,
obloc.partitionReferenceNum, obloc.logicalBlockNum, &err)))
return etype;
}
-int8_t udf_write_aext(struct inode *inode, lb_addr bloc, int *extoffset,
- lb_addr eloc, uint32_t elen, struct buffer_head *bh, int inc)
+int8_t udf_write_aext(struct inode *inode, kernel_lb_addr bloc, int *extoffset,
+ kernel_lb_addr eloc, uint32_t elen, struct buffer_head *bh, int inc)
{
int adsize;
uint8_t *ptr;
return (elen >> 30);
}
-int8_t udf_next_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
- lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc)
+int8_t udf_next_aext(struct inode *inode, kernel_lb_addr *bloc, int *extoffset,
+ kernel_lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc)
{
int8_t etype;
return etype;
}
-int8_t udf_current_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
- lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc)
+int8_t udf_current_aext(struct inode *inode, kernel_lb_addr *bloc, int *extoffset,
+ kernel_lb_addr *eloc, uint32_t *elen, struct buffer_head **bh, int inc)
{
int alen;
int8_t etype;
}
static int8_t
-udf_insert_aext(struct inode *inode, lb_addr bloc, int extoffset,
- lb_addr neloc, uint32_t nelen, struct buffer_head *bh)
+udf_insert_aext(struct inode *inode, kernel_lb_addr bloc, int extoffset,
+ kernel_lb_addr neloc, uint32_t nelen, struct buffer_head *bh)
{
- lb_addr oeloc;
+ kernel_lb_addr oeloc;
uint32_t oelen;
int8_t etype;
return (nelen >> 30);
}
-int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset,
- lb_addr eloc, uint32_t elen, struct buffer_head *nbh)
+int8_t udf_delete_aext(struct inode *inode, kernel_lb_addr nbloc, int nextoffset,
+ kernel_lb_addr eloc, uint32_t elen, struct buffer_head *nbh)
{
struct buffer_head *obh;
- lb_addr obloc;
+ kernel_lb_addr obloc;
int oextoffset, adsize;
int8_t etype;
struct allocExtDesc *aed;
oextoffset = nextoffset - adsize;
}
}
- memset(&eloc, 0x00, sizeof(lb_addr));
+ memset(&eloc, 0x00, sizeof(kernel_lb_addr));
elen = 0;
if (nbh != obh)
return (elen >> 30);
}
-int8_t inode_bmap(struct inode *inode, int block, lb_addr *bloc, uint32_t *extoffset,
- lb_addr *eloc, uint32_t *elen, uint32_t *offset, struct buffer_head **bh)
+int8_t inode_bmap(struct inode *inode, int block, kernel_lb_addr *bloc, uint32_t *extoffset,
+ 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;
int8_t etype;
long udf_block_map(struct inode *inode, long block)
{
- lb_addr eloc, bloc;
+ kernel_lb_addr eloc, bloc;
uint32_t offset, extoffset, elen;
struct buffer_head *bh = NULL;
int ret;
}
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),
loc.logicalBlockNum + offset, ident);
length -= sizeof(tag);
tptr->tagChecksum = 0;
- tptr->descCRCLength = le16_to_cpu(length);
- tptr->descCRC = le16_to_cpu(udf_crc(data + sizeof(tag), length, 0));
+ tptr->descCRCLength = cpu_to_le16(length);
+ tptr->descCRC = cpu_to_le16(udf_crc(data + sizeof(tag), length, 0));
for (i=0; i<16; i++)
if (i != 4)
uint32_t loc, int length)
{
tag *tptr = (tag *)data;
- tptr->tagIdent = le16_to_cpu(ident);
- tptr->descVersion = le16_to_cpu(version);
- tptr->tagSerialNum = le16_to_cpu(snum);
- tptr->tagLocation = le32_to_cpu(loc);
+ tptr->tagIdent = cpu_to_le16(ident);
+ tptr->descVersion = cpu_to_le16(version);
+ tptr->tagSerialNum = cpu_to_le16(snum);
+ tptr->tagLocation = cpu_to_le32(loc);
udf_update_tag(data, length);
}
uint8_t lfi;
uint16_t liu;
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;
struct buffer_head *bh = NULL;
/* temporary shorthand for specifying files by inode number */
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);
if (!inode)
{
uint8_t lfi;
uint16_t liu;
int block;
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset;
struct buffer_head *bh = NULL;
}
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
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);
udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB)
}
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
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);
udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB)
inode->i_nlink = 2;
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
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);
cfi.fileCharacteristics = FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT;
udf_write_fi(inode, &cfi, fi, &fibh, NULL, NULL);
}
cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
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);
cfi.fileCharacteristics |= FID_FILE_CHAR_DIRECTORY;
udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
loff_t f_pos;
loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
int block;
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
uint32_t extoffset, elen, offset;
struct buffer_head *bh = NULL;
struct inode * inode = dentry->d_inode;
struct udf_fileident_bh fibh;
struct fileIdentDesc *fi, cfi;
- lb_addr tloc;
+ kernel_lb_addr tloc;
retval = -ENOENT;
lock_kernel();
struct udf_fileident_bh fibh;
struct fileIdentDesc *fi;
struct fileIdentDesc cfi;
- lb_addr tloc;
+ kernel_lb_addr tloc;
retval = -ENOENT;
lock_kernel();
if (UDF_I_ALLOCTYPE(inode) != ICBTAG_FLAG_AD_IN_ICB)
{
struct buffer_head *bh = NULL;
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
uint32_t elen, extoffset;
block = udf_new_block(inode->i_sb, inode,
uint64_t uniqueID;
lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse);
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);
if (!(++uniqueID & 0x00000000FFFFFFFFUL))
uniqueID += 16;
uint64_t uniqueID;
lvhd = (struct logicalVolHeaderDesc *)(UDF_SB_LVID(inode->i_sb)->logicalVolContentsUse);
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);
if (!(++uniqueID & 0x00000000FFFFFFFFUL))
uniqueID += 16;
struct fileIdentDesc *ofi = NULL, *nfi = NULL, *dir_fi = NULL, ocfi, ncfi;
struct buffer_head *dir_bh = NULL;
int retval = -ENOENT;
- lb_addr tloc;
+ kernel_lb_addr tloc;
lock_kernel();
if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi)))
}
if (!dir_fi)
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)
!= old_dir->i_ino)
goto end_rename;
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) +
- 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)
{
mark_inode_dirty(old_inode);
struct UDFIdentSuffix
{
- uint16_t UDFRevision;
+ __le16 UDFRevision;
uint8_t OSClass;
uint8_t OSIdentifier;
uint8_t reserved[4];
struct logicalVolIntegrityDescImpUse
{
regid impIdent;
- uint32_t numFiles;
- uint32_t numDirs;
- uint16_t minUDFReadRev;
- uint16_t minUDFWriteRev;
- uint16_t maxUDFWriteRev;
+ __le32 numFiles;
+ __le32 numDirs;
+ __le16 minUDFReadRev;
+ __le16 minUDFWriteRev;
+ __le16 maxUDFWriteRev;
uint8_t impUse[0];
} __attribute__ ((packed));
uint8_t partitionMapLength;
uint8_t reserved1[2];
regid partIdent;
- uint16_t volSeqNum;
- uint16_t partitionNum;
+ __le16 volSeqNum;
+ __le16 partitionNum;
} __attribute__ ((packed));
/* Virtual Partition Map (UDF 2.50 2.2.8) */
uint8_t partitionMapLength;
uint8_t reserved1[2];
regid partIdent;
- uint16_t volSeqNum;
- uint16_t partitionNum;
+ __le16 volSeqNum;
+ __le16 partitionNum;
uint8_t reserved2[24];
} __attribute__ ((packed));
uint8_t partitionMapLength;
uint8_t reserved1[2];
regid partIdent;
- uint16_t volSeqNum;
- uint16_t partitionNum;
- uint16_t packetLength;
+ __le16 volSeqNum;
+ __le16 partitionNum;
+ __le16 packetLength;
uint8_t numSparingTables;
uint8_t reserved2[1];
- uint32_t sizeSparingTable;
- uint32_t locSparingTable[4];
+ __le32 sizeSparingTable;
+ __le32 locSparingTable[4];
} __attribute__ ((packed));
/* Metadata Partition Map (UDF 2.4.0 2.2.10) */
uint8_t partitionMapLength;
uint8_t reserved1[2];
regid partIdent;
- uint16_t volSeqNum;
- uint16_t partitionNum;
- uint32_t metadataFileLoc;
- uint32_t metadataMirrorFileLoc;
- uint32_t metadataBitmapFileLoc;
- uint32_t allocUnitSize;
- uint16_t alignUnitSize;
+ __le16 volSeqNum;
+ __le16 partitionNum;
+ __le32 metadataFileLoc;
+ __le32 metadataMirrorFileLoc;
+ __le32 metadataBitmapFileLoc;
+ __le32 allocUnitSize;
+ __le16 alignUnitSize;
uint8_t flags;
uint8_t reserved2[5];
} __attribute__ ((packed));
/* Virtual Allocation Table (UDF 1.5 2.2.10) */
struct virtualAllocationTable15
{
- uint32_t VirtualSector[0];
+ __le32 VirtualSector[0];
regid vatIdent;
- uint32_t previousVATICBLoc;
+ __le32 previousVATICBLoc;
} __attribute__ ((packed));
#define ICBTAG_FILE_TYPE_VAT15 0x00U
/* Virtual Allocation Table (UDF 2.50 2.2.11) */
struct virtualAllocationTable20
{
- uint16_t lengthHeader;
- uint16_t lengthImpUse;
+ __le16 lengthHeader;
+ __le16 lengthImpUse;
dstring logicalVolIdent[128];
- uint32_t previousVATICBLoc;
- uint32_t numFiles;
- uint32_t numDirs;
- uint16_t minReadRevision;
- uint16_t minWriteRevision;
- uint16_t maxWriteRevision;
- uint16_t reserved;
+ __le32 previousVATICBLoc;
+ __le32 numFiles;
+ __le32 numDirs;
+ __le16 minReadRevision;
+ __le16 minWriteRevision;
+ __le16 maxWriteRevision;
+ __le16 reserved;
uint8_t impUse[0];
- uint32_t vatEntry[0];
+ __le32 vatEntry[0];
} __attribute__ ((packed));
#define ICBTAG_FILE_TYPE_VAT20 0xF8U
/* Sparing Table (UDF 2.50 2.2.12) */
struct sparingEntry
{
- uint32_t origLocation;
- uint32_t mappedLocation;
+ __le32 origLocation;
+ __le32 mappedLocation;
} __attribute__ ((packed));
struct sparingTable
{
tag descTag;
regid sparingIdent;
- uint16_t reallocationTableLen;
- uint16_t reserved;
- uint32_t sequenceNum;
+ __le16 reallocationTableLen;
+ __le16 reserved;
+ __le32 sequenceNum;
struct sparingEntry
mapEntry[0];
} __attribute__ ((packed));
/* struct long_ad ICB - ADImpUse (UDF 2.50 2.2.4.3) */
struct allocDescImpUse
{
- uint16_t flags;
+ __le16 flags;
uint8_t impUse[4];
} __attribute__ ((packed));
/* FreeEASpace (UDF 2.50 3.3.4.5.1.1) */
struct freeEaSpace
{
- uint16_t headerChecksum;
+ __le16 headerChecksum;
uint8_t freeEASpace[0];
} __attribute__ ((packed));
/* DVD Copyright Management Information (UDF 2.50 3.3.4.5.1.2) */
struct DVDCopyrightImpUse
{
- uint16_t headerChecksum;
+ __le16 headerChecksum;
uint8_t CGMSInfo;
uint8_t dataType;
uint8_t protectionSystemInfo[4];
/* FreeAppEASpace (UDF 2.50 3.3.4.6.1) */
struct freeAppEASpace
{
- uint16_t headerChecksum;
+ __le16 headerChecksum;
uint8_t freeEASpace[0];
} __attribute__ ((packed));
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);
static int udf_remount_fs(struct super_block *, int *, char *);
static int udf_check_valid(struct super_block *, int, int);
static int udf_vrs(struct super_block *sb, int silent);
-static int udf_load_partition(struct super_block *, lb_addr *);
-static int udf_load_logicalvol(struct super_block *, struct buffer_head *, lb_addr *);
-static void udf_load_logicalvolint(struct super_block *, extent_ad);
+static int udf_load_partition(struct super_block *, kernel_lb_addr *);
+static int udf_load_logicalvol(struct super_block *, struct buffer_head *, kernel_lb_addr *);
+static void udf_load_logicalvolint(struct super_block *, kernel_extent_ad);
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_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_open_lvid(struct super_block *);
static void udf_close_lvid(struct super_block *);
}
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;
long lastblock;
if (!bh) /* Search backwards through the partitions */
{
- lb_addr newfileset;
+ kernel_lb_addr newfileset;
return 1;
if ( udf_stamp_to_time(&recording, &recording_usec,
lets_to_cpu(pvoldesc->recordingDateAndTime)) )
{
- timestamp ts;
+ kernel_timestamp ts;
ts = lets_to_cpu(pvoldesc->recordingDateAndTime);
udf_debug("recording time %ld/%ld, %04u/%02u/%02u %02u:%02u (%x)\n",
recording, recording_usec,
}
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;
phd = (struct partitionHeaderDesc *)(p->partitionContentsUse);
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_iget(sb, loc);
udf_debug("partitionIntegrityTable (part %d)\n", i);
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_iget(sb, loc);
}
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;
int i, j, offset;
struct udfPartitionMap2 *upm2 = (struct udfPartitionMap2 *)&(lvd->partitionMaps[offset]);
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_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_PARTFUNC(sb,i) = udf_get_pblock_virt20;
*
*/
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;
uint16_t ident;
* Written, tested, and released.
*/
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 udf_vds_record vds[VDS_POS_LENGTH];
}
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;
uint16_t ident;
case UDF_VIRTUAL_MAP15:
case UDF_VIRTUAL_MAP20:
{
- lb_addr ino;
+ kernel_lb_addr ino;
if (!UDF_SB_LASTBLOCK(sb))
{
if (UDF_SB_LVIDBH(sb))
{
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[1] = UDF_OS_ID_LINUX;
UDF_SB_LVID(sb)->integrityType == LVID_INTEGRITY_TYPE_OPEN)
{
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[1] = UDF_OS_ID_LINUX;
int i;
struct inode *inode=NULL;
struct udf_options uopt;
- lb_addr rootdir, fileset;
+ kernel_lb_addr rootdir, fileset;
struct udf_sb_info *sbi;
uopt.flags = (1 << UDF_FLAG_USE_AD_IN_ICB) | (1 << UDF_FLAG_STRICT);
if (!silent)
{
- timestamp ts;
+ kernel_timestamp ts;
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",
UDFFS_VERSION, UDFFS_DATE,
unsigned int accum = 0;
int index;
int block = 0, newblock;
- lb_addr loc;
+ kernel_lb_addr loc;
uint32_t bytes;
uint8_t value;
uint8_t *ptr;
{
unsigned int accum = 0;
uint32_t extoffset, elen;
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
int8_t etype;
struct buffer_head *bh = NULL;
#include "udf_i.h"
#include "udf_sb.h"
-static void extent_trunc(struct inode * inode, lb_addr bloc, int extoffset,
- lb_addr eloc, int8_t etype, uint32_t elen, struct buffer_head *bh, uint32_t nelen)
+static void extent_trunc(struct inode * inode, kernel_lb_addr bloc, int extoffset,
+ 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 first_block = (nelen + inode->i_sb->s_blocksize - 1) >> inode->i_sb->s_blocksize_bits;
void udf_discard_prealloc(struct inode * inode)
{
- lb_addr bloc, eloc;
+ kernel_lb_addr bloc, eloc;
uint32_t extoffset = 0, elen, nelen;
uint64_t lbcount = 0;
int8_t etype = -1, netype;
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;
int8_t etype;
int first_block = inode->i_size >> inode->i_sb->s_blocksize_bits;
}
else if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30))
{
- lb_addr neloc = { 0, 0 };
+ kernel_lb_addr neloc = { 0, 0 };
extoffset -= adsize;
nelen = EXT_NOT_RECORDED_NOT_ALLOCATED |
((elen + offset + inode->i_sb->s_blocksize - 1) &
~(inode->i_sb->s_blocksize - 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;
udf_add_aext(inode, &bloc, &extoffset, eloc, elen, &bh, 1);
}
struct generic_desc
{
tag descTag;
- uint32_t volDescSeqNum;
+ __le32 volDescSeqNum;
};
struct ustr
extern int udf_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
/* 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 void udf_expand_file_adinicb(struct inode *, int, int *);
extern struct buffer_head * udf_expand_dir_adinicb(struct inode *, int *, int *);
extern void udf_clear_inode(struct inode *);
extern void udf_write_inode(struct inode *, int);
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 udf_add_aext(struct inode *, lb_addr *, int *, 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_delete_aext(struct inode *, lb_addr, int, 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_current_aext(struct inode *, lb_addr *, int *, lb_addr *, uint32_t *, struct buffer_head **, int);
+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 *, kernel_lb_addr *, int *, kernel_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 *, kernel_lb_addr, int, kernel_lb_addr, uint32_t, struct buffer_head *);
+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 *, kernel_lb_addr *, int *, kernel_lb_addr *, uint32_t *, struct buffer_head **, int);
/* misc.c */
extern struct buffer_head *udf_tgetblk(struct super_block *, int);
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 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_update_tag(char *, int);
extern void udf_new_tag(char *, uint16_t, uint16_t, uint16_t, uint32_t, int);
extern void udf_truncate_extents(struct inode *);
/* 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_new_block(struct super_block *, struct inode *, uint16_t, uint32_t, int *);
extern int udf_fsync_file(struct file *, struct dentry *, int);
/* 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 long_ad * udf_get_filelongad(uint8_t *, int, int *, int);
extern short_ad * udf_get_fileshortad(uint8_t *, int, int *, int);
extern uint16_t udf_crc(uint8_t *, uint32_t, uint16_t);
/* udftime.c */
-extern time_t *udf_stamp_to_time(time_t *, long *, timestamp);
-extern timestamp *udf_time_to_stamp(timestamp *, struct timespec);
+extern time_t *udf_stamp_to_time(time_t *, long *, kernel_timestamp);
+extern kernel_timestamp *udf_time_to_stamp(kernel_timestamp *, struct timespec);
#endif /* __UDF_DECL_H */
#include <asm/byteorder.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.partitionReferenceNum = le16_to_cpu(in.partitionReferenceNum);
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;
out.logicalBlockNum = cpu_to_le32(in.logicalBlockNum);
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));
out.typeAndTimezone = le16_to_cpu(in.typeAndTimezone);
out.year = le16_to_cpu(in.year);
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.extLocation = lelb_to_cpu(in.extLocation);
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;
out.extLength = cpu_to_le32(in.extLength);
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.extLocation = le32_to_cpu(in.extLocation);
return out;
}
-static inline timestamp cpu_to_lets(timestamp in)
+static inline timestamp cpu_to_lets(kernel_timestamp in)
{
timestamp out;
memcpy(&out, &in, sizeof(timestamp));
#define SECS_PER_DAY (SECS_PER_HOUR * 24)
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;
uint8_t type = src.typeAndTimezone >> 12;
}
-timestamp *
-udf_time_to_stamp(timestamp *dest, struct timespec ts)
+kernel_timestamp *
+udf_time_to_stamp(kernel_timestamp *dest, struct timespec ts)
{
long int days, rem, y;
const unsigned short int *ip;
{
struct timespec i_crtime;
/* Physical address of inode */
- lb_addr i_location;
+ kernel_lb_addr i_location;
__u64 i_unique;
__u32 i_lenEAttr;
__u32 i_lenAlloc;