]> git.hungrycats.org Git - linux/commitdiff
[PATCH] udf endianness annotations
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Thu, 9 Sep 2004 04:49:50 +0000 (21:49 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 9 Sep 2004 04:49:50 +0000 (21:49 -0700)
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: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 files changed:
fs/udf/balloc.c
fs/udf/dir.c
fs/udf/directory.c
fs/udf/ecma_167.h
fs/udf/inode.c
fs/udf/misc.c
fs/udf/namei.c
fs/udf/osta_udf.h
fs/udf/partition.c
fs/udf/super.c
fs/udf/truncate.c
fs/udf/udfdecl.h
fs/udf/udfend.h
fs/udf/udftime.c
include/linux/udf_fs_i.h

index 8f7d9eff554b0a00ad516ec55db2dc0cfd6b6f92..448a8983294be682de0e09e29b3f63f4d9646e6f 100644 (file)
@@ -44,7 +44,7 @@
 #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)
 {
@@ -91,7 +91,7 @@ static int read_block_bitmap(struct super_block * sb,
 {
        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);
@@ -145,7 +145,8 @@ static inline int load_block_bitmap(struct super_block * 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;
@@ -424,11 +425,12 @@ error_return:
 
 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;
@@ -678,7 +680,7 @@ static int udf_table_prealloc_blocks(struct super_block * sb,
 {
        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;
 
@@ -748,7 +750,7 @@ static int udf_table_new_block(struct super_block * sb,
        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;
 
@@ -854,7 +856,7 @@ static int udf_table_new_block(struct super_block * sb,
 
 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;
 
index 33228f1493cf647a92cf3ac17b62ee2c32c4cf05..82440b731142f0b1ec8d2e2281ca30d0087b9f3f 100644 (file)
@@ -117,7 +117,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
        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;
@@ -237,7 +237,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
                }
                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);
index 1f967a033ed9413c00e0aa3537216b4406cc587f..9a61ecc5451b07422e6c44563b8c0ac306a1a4d3 100644 (file)
@@ -26,7 +26,7 @@
 #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;
@@ -80,8 +80,8 @@ struct fileIdentDesc *
 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;
index 9132ff515a18752b826922e64d539a7d3a4bb22f..f81f2ebbf5089ab96bf06ebdeec5723d0562d1df 100644 (file)
@@ -58,6 +58,20 @@ typedef struct
 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;
@@ -70,7 +84,7 @@ typedef struct
        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
@@ -139,12 +153,12 @@ struct bootDesc
        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));
@@ -153,23 +167,29 @@ struct bootDesc
 #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) */
@@ -197,15 +217,15 @@ struct NSRDesc
 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;
@@ -215,8 +235,8 @@ struct primaryVolDesc
        timestamp       recordingDateAndTime;
        regid           impIdent;
        uint8_t         impUse[64];
-       uint32_t        predecessorVolDescSeqLocation;
-       uint16_t        flags;
+       __le32          predecessorVolDescSeqLocation;
+       __le16          flags;
        uint8_t         reserved[22];
 } __attribute__ ((packed));
 
@@ -236,7 +256,7 @@ struct anchorVolDescPtr
 struct volDescPtr
 {
        tag             descTag;
-       uint32_t        volDescSeqNum;
+       __le32          volDescSeqNum;
        extent_ad       nextVolDescSeqExt;
        uint8_t         reserved[484];
 } __attribute__ ((packed));
@@ -245,7 +265,7 @@ struct volDescPtr
 struct impUseVolDesc
 {
        tag             descTag;
-       uint32_t        volDescSeqNum;
+       __le32          volDescSeqNum;
        regid           impIdent;
        uint8_t         impUse[460];
 } __attribute__ ((packed));
@@ -254,14 +274,14 @@ struct impUseVolDesc
 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];
@@ -290,14 +310,14 @@ struct partitionDesc
 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;
@@ -322,8 +342,8 @@ struct genericPartitionMap1
 {
        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) */
@@ -338,8 +358,8 @@ struct genericPartitionMap2
 struct unallocSpaceDesc
 {
        tag             descTag;
-       uint32_t        volDescSeqNum;
-       uint32_t        numAllocDescs;
+       __le32          volDescSeqNum;
+       __le32          numAllocDescs;
        extent_ad       allocDescs[0];
 } __attribute__ ((packed));
 
@@ -355,13 +375,13 @@ struct logicalVolIntegrityDesc
 {
        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));
 
@@ -372,33 +392,55 @@ struct logicalVolIntegrityDesc
 /* 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) */
 
@@ -420,12 +462,12 @@ struct fileSetDesc
 {
        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;
@@ -454,11 +496,11 @@ struct partitionHeaderDesc
 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];
@@ -475,21 +517,21 @@ struct fileIdentDesc
 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) */
@@ -553,24 +595,24 @@ struct fileEntry
 {
        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));
@@ -616,28 +658,28 @@ struct fileEntry
 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));
@@ -645,24 +687,24 @@ struct charSetInfo
 /* 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));
 
@@ -675,36 +717,36 @@ struct fileTimesExtAttr
 /* 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));
@@ -712,11 +754,11 @@ struct impUseExtAttr
 /* 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));
@@ -735,7 +777,7 @@ struct unallocSpaceEntry
 {
        tag             descTag;
        icbtag          icbTag;
-       uint32_t        lengthAllocDescs;
+       __le32          lengthAllocDescs;
        uint8_t         allocDescs[0];
 } __attribute__ ((packed));
 
@@ -743,8 +785,8 @@ struct unallocSpaceEntry
 struct spaceBitmapDesc
 {
        tag             descTag;
-       uint32_t        numOfBits;
-       uint32_t        numOfBytes;
+       __le32          numOfBits;
+       __le32          numOfBytes;
        uint8_t         bitmap[0];
 } __attribute__ ((packed));
 
@@ -775,7 +817,7 @@ struct partitionIntegrityEntry
 /* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */
 struct logicalVolHeaderDesc
 {
-       uint64_t        uniqueID;
+       __le64          uniqueID;
        uint8_t         reserved[24];
 } __attribute__ ((packed));
 
@@ -784,7 +826,7 @@ struct pathComponent
 {
        uint8_t         componentType;
        uint8_t         lengthComponentIdent;
-       uint16_t        componentFileVersionNum;
+       __le16          componentFileVersionNum;
        dstring         componentIdent[0];
 } __attribute__ ((packed));
 
@@ -793,28 +835,28 @@ struct extendedFileEntry
 {
        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));
index a1aa1752585516a899a940ade5b693a2bdd53b19..2308451709b4cf8234052ae67ded0efb542859b9 100644 (file)
@@ -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,
        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);
 
 /*
@@ -216,7 +216,7 @@ struct buffer_head * udf_expand_dir_adinicb(struct inode *inode, int *block, 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;
 
@@ -381,11 +381,11 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block,
        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;
@@ -479,7 +479,7 @@ static struct buffer_head * inode_getblk(struct inode * inode, long block,
                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;
@@ -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,
-       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))
@@ -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,
-        long_ad laarr[EXTENT_MERGE_SIZE], int *endnum)
+        kernel_long_ad laarr[EXTENT_MERGE_SIZE], int *endnum)
 {
        int start, length = 0, currlength = 0, i;
 
@@ -732,7 +732,7 @@ static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
 }
 
 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;
 
@@ -817,11 +817,11 @@ static void udf_merge_extents(struct inode *inode,
 }
 
 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)
@@ -941,7 +941,7 @@ void udf_truncate(struct inode * inode)
 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
@@ -997,7 +997,7 @@ __udf_read_inode(struct inode *inode)
                {
                        if (ibh)
                        {
-                               lb_addr loc;
+                               kernel_lb_addr loc;
                                ie = (struct indirectEntry *)ibh->b_data;
        
                                loc = lelb_to_cpu(ie->indirectICB.extLocation);
@@ -1008,7 +1008,7 @@ __udf_read_inode(struct inode *inode)
                                        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);
@@ -1338,7 +1338,7 @@ udf_update_inode(struct inode *inode, int do_sync)
        uint16_t icbflags;
        uint16_t crclen;
        int i;
-       timestamp cpu_time;
+       kernel_timestamp cpu_time;
        int err = 0;
 
        bh = udf_tread(inode->i_sb,
@@ -1449,7 +1449,7 @@ udf_update_inode(struct inode *inode, int do_sync)
                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
@@ -1495,7 +1495,7 @@ udf_update_inode(struct inode *inode, int do_sync)
                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))
@@ -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
  */
 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;
@@ -1606,7 +1606,7 @@ udf_iget(struct super_block *sb, lb_addr ino)
        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))
                {
@@ -1627,8 +1627,8 @@ udf_iget(struct super_block *sb, lb_addr ino)
        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;
@@ -1654,7 +1654,7 @@ int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
                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)))
@@ -1767,8 +1767,8 @@ int8_t udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
        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;
@@ -1823,8 +1823,8 @@ int8_t udf_write_aext(struct inode *inode, lb_addr bloc, int *extoffset,
        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;
 
@@ -1845,8 +1845,8 @@ int8_t udf_next_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
        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;
@@ -1905,10 +1905,10 @@ int8_t udf_current_aext(struct inode *inode, lb_addr *bloc, int *extoffset,
 }
 
 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;
 
@@ -1927,11 +1927,11 @@ udf_insert_aext(struct inode *inode, lb_addr bloc, int extoffset,
        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;
@@ -1968,7 +1968,7 @@ int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset,
                        oextoffset = nextoffset - adsize;
                }
        }
-       memset(&eloc, 0x00, sizeof(lb_addr));
+       memset(&eloc, 0x00, sizeof(kernel_lb_addr));
        elen = 0;
 
        if (nbh != obh)
@@ -2019,8 +2019,8 @@ int8_t udf_delete_aext(struct inode *inode, lb_addr nbloc, int nextoffset,
        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;
@@ -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)
 {
-       lb_addr eloc, bloc;
+       kernel_lb_addr eloc, bloc;
        uint32_t offset, extoffset, elen;
        struct buffer_head *bh = NULL;
        int ret;
index 174d7a3eca63e6380fa19945f0d8be1c56280f2a..fd321f9ace83a1c7d06ce346f1adf6bded6331d3 100644 (file)
@@ -273,7 +273,7 @@ error_out:
 }
 
 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);
@@ -293,8 +293,8 @@ void udf_update_tag(char *data, int length)
        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)
@@ -305,9 +305,9 @@ void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum,
        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);
 }
index 0c5615ae4f05b20b5c88e5b0754241bf5e09435d..a0e9b733b841aeda30106850fbf65aee338821e2 100644 (file)
@@ -160,7 +160,7 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
        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;
 
@@ -314,7 +314,7 @@ udf_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
        /* 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)
                {
@@ -360,7 +360,7 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
        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;
 
@@ -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.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)
@@ -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.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)
@@ -746,7 +746,7 @@ static int udf_mkdir(struct inode * dir, struct dentry * dentry, int mode)
        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);
@@ -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.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);
@@ -788,7 +788,7 @@ static int empty_dir(struct inode *dir)
        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;
 
@@ -861,7 +861,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
        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();
@@ -906,7 +906,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
        struct udf_fileident_bh fibh;
        struct fileIdentDesc *fi;
        struct fileIdentDesc cfi;
-       lb_addr tloc;
+       kernel_lb_addr tloc;
 
        retval = -ENOENT;
        lock_kernel();
@@ -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)
        {
                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,
@@ -1085,7 +1085,7 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char *
                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;
@@ -1142,7 +1142,7 @@ static int udf_link(struct dentry * old_dentry, struct inode * dir,
                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;
@@ -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 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)))
@@ -1231,7 +1231,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
                }
                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;
@@ -1277,9 +1277,9 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
 
        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);
index 037d0b7e36ad7bced37f58b58451d71ed4acf8c3..e82aae6526977cfe4c4a2459602d6f641a674abd 100644 (file)
@@ -67,7 +67,7 @@
 
 struct UDFIdentSuffix
 {
-       uint16_t        UDFRevision;
+       __le16          UDFRevision;
        uint8_t         OSClass;
        uint8_t         OSIdentifier;
        uint8_t         reserved[4];
@@ -90,11 +90,11 @@ struct appIdentSuffix
 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));
 
@@ -117,8 +117,8 @@ struct udfPartitionMap2
        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) */
@@ -128,8 +128,8 @@ struct virtualPartitionMap
        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));
 
@@ -140,13 +140,13 @@ struct sparablePartitionMap
        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) */
@@ -156,13 +156,13 @@ struct metadataPartitionMap
        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));
@@ -170,9 +170,9 @@ struct metadataPartitionMap
 /* 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
@@ -180,18 +180,18 @@ struct virtualAllocationTable15
 /* 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
@@ -199,17 +199,17 @@ struct virtualAllocationTable20
 /* 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));
@@ -222,7 +222,7 @@ struct sparingTable
 /* 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));
 
@@ -235,14 +235,14 @@ struct allocDescImpUse
 /* 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];
@@ -252,7 +252,7 @@ struct DVDCopyrightImpUse
 /* FreeAppEASpace (UDF 2.50 3.3.4.6.1) */
 struct freeAppEASpace
 {
-       uint16_t        headerChecksum;
+       __le16          headerChecksum;
        uint8_t         freeEASpace[0];
 } __attribute__ ((packed));
 
index 92e8cbf02d126e0929a511abb8c40725617e11ad..4d36f264be0d00f05be048a5a4c0d94cd1e35737 100644 (file)
@@ -84,7 +84,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, uint16_t
                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);
 
index 7b5484a5ba1fd387021ab802f27ddd7e86990f71..1865c5a446d2f621c5336e3d5720302934aaccd6 100644 (file)
@@ -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_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 *);
@@ -769,7 +769,7 @@ udf_find_anchor(struct super_block *sb)
 }
 
 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;
@@ -792,7 +792,7 @@ udf_find_fileset(struct super_block *sb, lb_addr *fileset, lb_addr *root)
 
        if (!bh) /* Search backwards through the partitions */
        {
-               lb_addr newfileset;
+               kernel_lb_addr newfileset;
 
                return 1;
                
@@ -874,7 +874,7 @@ udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh)
        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,
@@ -901,7 +901,7 @@ udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh)
 }
 
 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;
 
@@ -948,7 +948,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
                                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);
@@ -974,7 +974,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
                                        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);
@@ -1013,7 +1013,7 @@ udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
 }
 
 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;
@@ -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]);
                        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;
@@ -1110,7 +1110,7 @@ udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, lb_addr *fi
  *
  */
 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;
@@ -1150,7 +1150,7 @@ udf_load_logicalvolint(struct super_block *sb, extent_ad loc)
  *     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];
@@ -1293,7 +1293,7 @@ udf_check_valid(struct super_block *sb, int novrs, int silent)
 }
 
 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;
@@ -1350,7 +1350,7 @@ udf_load_partition(struct super_block *sb, lb_addr *fileset)
                        case UDF_VIRTUAL_MAP15:
                        case UDF_VIRTUAL_MAP20:
                        {
-                               lb_addr ino;
+                               kernel_lb_addr ino;
 
                                if (!UDF_SB_LASTBLOCK(sb))
                                {
@@ -1415,7 +1415,7 @@ static void udf_open_lvid(struct super_block *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;
@@ -1443,7 +1443,7 @@ static void udf_close_lvid(struct super_block *sb)
                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;
@@ -1492,7 +1492,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        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);
@@ -1616,7 +1616,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
 
        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,
@@ -1799,7 +1799,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap)
        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;
@@ -1866,7 +1866,7 @@ udf_count_free_table(struct super_block *sb, struct inode * table)
 {
        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;
 
index b51ea9cf079901f073f52d4f663911cac4bc3cff..7dc8a5572ca1900f5ee94db2c9a3695c88a2f909 100644 (file)
 #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;
 
@@ -68,7 +68,7 @@ static void extent_trunc(struct inode * inode, lb_addr bloc, int extoffset,
 
 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;
@@ -129,7 +129,7 @@ void udf_discard_prealloc(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;
        int8_t etype;
        int first_block = inode->i_size >> inode->i_sb->s_blocksize_bits;
@@ -254,7 +254,7 @@ void udf_truncate_extents(struct inode * inode)
                        }
                        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) &
@@ -272,7 +272,7 @@ void udf_truncate_extents(struct inode * inode)
                                                ~(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);
                        }
index 6767f30be66c59f0b9fcd074d8da7d466ae64e3d..c1eca9d055cfb076f66a474aa316f1d041de29e9 100644 (file)
@@ -68,7 +68,7 @@ struct udf_vds_record
 struct generic_desc
 {
        tag             descTag;
-       uint32_t        volDescSeqNum;
+       __le32          volDescSeqNum;
 };
 
 struct ustr
@@ -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);
 
 /* 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 *);
@@ -101,12 +101,12 @@ extern void udf_delete_inode(struct inode *);
 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);
@@ -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_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);
@@ -145,7 +145,7 @@ extern void udf_discard_prealloc(struct inode *);
 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 *);
 
@@ -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);
 
 /* 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);
@@ -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);
 
 /* 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 */
index 6313daab090e71f65266aafaa20503d2dcd0aea0..17d378879561c7eb6428cc106ba1b2591940423b 100644 (file)
@@ -4,15 +4,15 @@
 #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);
@@ -20,9 +20,9 @@ static inline lb_addr cpu_to_lelb(lb_addr in)
        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);
@@ -45,15 +45,15 @@ static inline short_ad cpu_to_lesa(short_ad in)
        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);
@@ -61,15 +61,15 @@ static inline long_ad cpu_to_lela(long_ad in)
        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));
index 983c98ce129b872dde00c152c0eb51e6fe74e0a0..c2634bda6b5030419d51b71e062b92e28addf8ee 100644 (file)
@@ -85,7 +85,7 @@ extern struct timezone sys_tz;
 #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;
@@ -120,8 +120,8 @@ udf_stamp_to_time(time_t *dest, long *dest_usec, timestamp src)
 }
 
 
-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;
index 186a5a47b50b369933455718f0ec38981cfd50c2..62b15a4214e6608b8b5554ae07de8e3677dd3c0b 100644 (file)
@@ -45,7 +45,7 @@ struct udf_inode_info
 {
        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;