Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

udf: use __packed instead of __attribute__ ((packed))

defined in linux/compiler-gcc.h

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Fabian Frederick and committed by
Jan Kara
75f27138 ad4d0532

+66 -66
+49 -49
fs/udf/ecma_167.h
··· 41 41 struct charspec { 42 42 uint8_t charSetType; 43 43 uint8_t charSetInfo[63]; 44 - } __attribute__ ((packed)); 44 + } __packed; 45 45 46 46 /* Character Set Type (ECMA 167r3 1/7.2.1.1) */ 47 47 #define CHARSPEC_TYPE_CS0 0x00 /* (1/7.2.2) */ ··· 68 68 uint8_t centiseconds; 69 69 uint8_t hundredsOfMicroseconds; 70 70 uint8_t microseconds; 71 - } __attribute__ ((packed)); 71 + } __packed; 72 72 73 73 /* Type and Time Zone (ECMA 167r3 1/7.3.1) */ 74 74 #define TIMESTAMP_TYPE_MASK 0xF000 ··· 82 82 uint8_t flags; 83 83 uint8_t ident[23]; 84 84 uint8_t identSuffix[8]; 85 - } __attribute__ ((packed)); 85 + } __packed; 86 86 87 87 /* Flags (ECMA 167r3 1/7.4.1) */ 88 88 #define ENTITYID_FLAGS_DIRTY 0x00 ··· 95 95 uint8_t stdIdent[VSD_STD_ID_LEN]; 96 96 uint8_t structVersion; 97 97 uint8_t structData[2041]; 98 - } __attribute__ ((packed)); 98 + } __packed; 99 99 100 100 /* Standard Identifier (EMCA 167r2 2/9.1.2) */ 101 101 #define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */ ··· 114 114 uint8_t stdIdent[VSD_STD_ID_LEN]; 115 115 uint8_t structVersion; 116 116 uint8_t structData[2041]; 117 - } __attribute__ ((packed)); 117 + } __packed; 118 118 119 119 /* Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */ 120 120 struct terminatingExtendedAreaDesc { ··· 122 122 uint8_t stdIdent[VSD_STD_ID_LEN]; 123 123 uint8_t structVersion; 124 124 uint8_t structData[2041]; 125 - } __attribute__ ((packed)); 125 + } __packed; 126 126 127 127 /* Boot Descriptor (ECMA 167r3 2/9.4) */ 128 128 struct bootDesc { ··· 140 140 __le16 flags; 141 141 uint8_t reserved2[32]; 142 142 uint8_t bootUse[1906]; 143 - } __attribute__ ((packed)); 143 + } __packed; 144 144 145 145 /* Flags (ECMA 167r3 2/9.4.12) */ 146 146 #define BOOT_FLAGS_ERASE 0x01 ··· 149 149 struct extent_ad { 150 150 __le32 extLength; 151 151 __le32 extLocation; 152 - } __attribute__ ((packed)); 152 + } __packed; 153 153 154 154 struct kernel_extent_ad { 155 155 uint32_t extLength; ··· 166 166 __le16 descCRC; 167 167 __le16 descCRCLength; 168 168 __le32 tagLocation; 169 - } __attribute__ ((packed)); 169 + } __packed; 170 170 171 171 /* Tag Identifier (ECMA 167r3 3/7.2.1) */ 172 172 #define TAG_IDENT_PVD 0x0001 ··· 186 186 uint8_t structVersion; 187 187 uint8_t reserved; 188 188 uint8_t structData[2040]; 189 - } __attribute__ ((packed)); 189 + } __packed; 190 190 191 191 /* Primary Volume Descriptor (ECMA 167r3 3/10.1) */ 192 192 struct primaryVolDesc { ··· 212 212 __le32 predecessorVolDescSeqLocation; 213 213 __le16 flags; 214 214 uint8_t reserved[22]; 215 - } __attribute__ ((packed)); 215 + } __packed; 216 216 217 217 /* Flags (ECMA 167r3 3/10.1.21) */ 218 218 #define PVD_FLAGS_VSID_COMMON 0x0001 ··· 223 223 struct extent_ad mainVolDescSeqExt; 224 224 struct extent_ad reserveVolDescSeqExt; 225 225 uint8_t reserved[480]; 226 - } __attribute__ ((packed)); 226 + } __packed; 227 227 228 228 /* Volume Descriptor Pointer (ECMA 167r3 3/10.3) */ 229 229 struct volDescPtr { ··· 231 231 __le32 volDescSeqNum; 232 232 struct extent_ad nextVolDescSeqExt; 233 233 uint8_t reserved[484]; 234 - } __attribute__ ((packed)); 234 + } __packed; 235 235 236 236 /* Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */ 237 237 struct impUseVolDesc { ··· 239 239 __le32 volDescSeqNum; 240 240 struct regid impIdent; 241 241 uint8_t impUse[460]; 242 - } __attribute__ ((packed)); 242 + } __packed; 243 243 244 244 /* Partition Descriptor (ECMA 167r3 3/10.5) */ 245 245 struct partitionDesc { ··· 255 255 struct regid impIdent; 256 256 uint8_t impUse[128]; 257 257 uint8_t reserved[156]; 258 - } __attribute__ ((packed)); 258 + } __packed; 259 259 260 260 /* Partition Flags (ECMA 167r3 3/10.5.3) */ 261 261 #define PD_PARTITION_FLAGS_ALLOC 0x0001 ··· 291 291 uint8_t impUse[128]; 292 292 struct extent_ad integritySeqExt; 293 293 uint8_t partitionMaps[0]; 294 - } __attribute__ ((packed)); 294 + } __packed; 295 295 296 296 /* Generic Partition Map (ECMA 167r3 3/10.7.1) */ 297 297 struct genericPartitionMap { 298 298 uint8_t partitionMapType; 299 299 uint8_t partitionMapLength; 300 300 uint8_t partitionMapping[0]; 301 - } __attribute__ ((packed)); 301 + } __packed; 302 302 303 303 /* Partition Map Type (ECMA 167r3 3/10.7.1.1) */ 304 304 #define GP_PARTITION_MAP_TYPE_UNDEF 0x00 ··· 311 311 uint8_t partitionMapLength; 312 312 __le16 volSeqNum; 313 313 __le16 partitionNum; 314 - } __attribute__ ((packed)); 314 + } __packed; 315 315 316 316 /* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */ 317 317 struct genericPartitionMap2 { 318 318 uint8_t partitionMapType; 319 319 uint8_t partitionMapLength; 320 320 uint8_t partitionIdent[62]; 321 - } __attribute__ ((packed)); 321 + } __packed; 322 322 323 323 /* Unallocated Space Descriptor (ECMA 167r3 3/10.8) */ 324 324 struct unallocSpaceDesc { ··· 326 326 __le32 volDescSeqNum; 327 327 __le32 numAllocDescs; 328 328 struct extent_ad allocDescs[0]; 329 - } __attribute__ ((packed)); 329 + } __packed; 330 330 331 331 /* Terminating Descriptor (ECMA 167r3 3/10.9) */ 332 332 struct terminatingDesc { 333 333 struct tag descTag; 334 334 uint8_t reserved[496]; 335 - } __attribute__ ((packed)); 335 + } __packed; 336 336 337 337 /* Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */ 338 338 struct logicalVolIntegrityDesc { ··· 346 346 __le32 freeSpaceTable[0]; 347 347 __le32 sizeTable[0]; 348 348 uint8_t impUse[0]; 349 - } __attribute__ ((packed)); 349 + } __packed; 350 350 351 351 /* Integrity Type (ECMA 167r3 3/10.10.3) */ 352 352 #define LVID_INTEGRITY_TYPE_OPEN 0x00000000 ··· 356 356 struct lb_addr { 357 357 __le32 logicalBlockNum; 358 358 __le16 partitionReferenceNum; 359 - } __attribute__ ((packed)); 359 + } __packed; 360 360 361 361 /* ... and its in-core analog */ 362 362 struct kernel_lb_addr { ··· 368 368 struct short_ad { 369 369 __le32 extLength; 370 370 __le32 extPosition; 371 - } __attribute__ ((packed)); 371 + } __packed; 372 372 373 373 /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */ 374 374 struct long_ad { 375 375 __le32 extLength; 376 376 struct lb_addr extLocation; 377 377 uint8_t impUse[6]; 378 - } __attribute__ ((packed)); 378 + } __packed; 379 379 380 380 struct kernel_long_ad { 381 381 uint32_t extLength; ··· 389 389 __le32 recordedLength; 390 390 __le32 informationLength; 391 391 struct lb_addr extLocation; 392 - } __attribute__ ((packed)); 392 + } __packed; 393 393 394 394 struct kernel_ext_ad { 395 395 uint32_t extLength; ··· 434 434 struct long_ad nextExt; 435 435 struct long_ad streamDirectoryICB; 436 436 uint8_t reserved[32]; 437 - } __attribute__ ((packed)); 437 + } __packed; 438 438 439 439 /* Partition Header Descriptor (ECMA 167r3 4/14.3) */ 440 440 struct partitionHeaderDesc { ··· 444 444 struct short_ad freedSpaceTable; 445 445 struct short_ad freedSpaceBitmap; 446 446 uint8_t reserved[88]; 447 - } __attribute__ ((packed)); 447 + } __packed; 448 448 449 449 /* File Identifier Descriptor (ECMA 167r3 4/14.4) */ 450 450 struct fileIdentDesc { ··· 457 457 uint8_t impUse[0]; 458 458 uint8_t fileIdent[0]; 459 459 uint8_t padding[0]; 460 - } __attribute__ ((packed)); 460 + } __packed; 461 461 462 462 /* File Characteristics (ECMA 167r3 4/14.4.3) */ 463 463 #define FID_FILE_CHAR_HIDDEN 0x01 ··· 471 471 struct tag descTag; 472 472 __le32 previousAllocExtLocation; 473 473 __le32 lengthAllocDescs; 474 - } __attribute__ ((packed)); 474 + } __packed; 475 475 476 476 /* ICB Tag (ECMA 167r3 4/14.6) */ 477 477 struct icbtag { ··· 483 483 uint8_t fileType; 484 484 struct lb_addr parentICBLocation; 485 485 __le16 flags; 486 - } __attribute__ ((packed)); 486 + } __packed; 487 487 488 488 /* Strategy Type (ECMA 167r3 4/14.6.2) */ 489 489 #define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000 ··· 531 531 struct tag descTag; 532 532 struct icbtag icbTag; 533 533 struct long_ad indirectICB; 534 - } __attribute__ ((packed)); 534 + } __packed; 535 535 536 536 /* Terminal Entry (ECMA 167r3 4/14.8) */ 537 537 struct terminalEntry { 538 538 struct tag descTag; 539 539 struct icbtag icbTag; 540 - } __attribute__ ((packed)); 540 + } __packed; 541 541 542 542 /* File Entry (ECMA 167r3 4/14.9) */ 543 543 struct fileEntry { ··· 563 563 __le32 lengthAllocDescs; 564 564 uint8_t extendedAttr[0]; 565 565 uint8_t allocDescs[0]; 566 - } __attribute__ ((packed)); 566 + } __packed; 567 567 568 568 /* Permissions (ECMA 167r3 4/14.9.5) */ 569 569 #define FE_PERM_O_EXEC 0x00000001U ··· 607 607 struct tag descTag; 608 608 __le32 impAttrLocation; 609 609 __le32 appAttrLocation; 610 - } __attribute__ ((packed)); 610 + } __packed; 611 611 612 612 /* Generic Format (ECMA 167r3 4/14.10.2) */ 613 613 struct genericFormat { ··· 616 616 uint8_t reserved[3]; 617 617 __le32 attrLength; 618 618 uint8_t attrData[0]; 619 - } __attribute__ ((packed)); 619 + } __packed; 620 620 621 621 /* Character Set Information (ECMA 167r3 4/14.10.3) */ 622 622 struct charSetInfo { ··· 627 627 __le32 escapeSeqLength; 628 628 uint8_t charSetType; 629 629 uint8_t escapeSeq[0]; 630 - } __attribute__ ((packed)); 630 + } __packed; 631 631 632 632 /* Alternate Permissions (ECMA 167r3 4/14.10.4) */ 633 633 struct altPerms { ··· 638 638 __le16 ownerIdent; 639 639 __le16 groupIdent; 640 640 __le16 permission; 641 - } __attribute__ ((packed)); 641 + } __packed; 642 642 643 643 /* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */ 644 644 struct fileTimesExtAttr { ··· 649 649 __le32 dataLength; 650 650 __le32 fileTimeExistence; 651 651 uint8_t fileTimes; 652 - } __attribute__ ((packed)); 652 + } __packed; 653 653 654 654 /* FileTimeExistence (ECMA 167r3 4/14.10.5.6) */ 655 655 #define FTE_CREATION 0x00000001 ··· 666 666 __le32 dataLength; 667 667 __le32 infoTimeExistence; 668 668 uint8_t infoTimes[0]; 669 - } __attribute__ ((packed)); 669 + } __packed; 670 670 671 671 /* Device Specification (ECMA 167r3 4/14.10.7) */ 672 672 struct deviceSpec { ··· 678 678 __le32 majorDeviceIdent; 679 679 __le32 minorDeviceIdent; 680 680 uint8_t impUse[0]; 681 - } __attribute__ ((packed)); 681 + } __packed; 682 682 683 683 /* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */ 684 684 struct impUseExtAttr { ··· 689 689 __le32 impUseLength; 690 690 struct regid impIdent; 691 691 uint8_t impUse[0]; 692 - } __attribute__ ((packed)); 692 + } __packed; 693 693 694 694 /* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */ 695 695 struct appUseExtAttr { ··· 700 700 __le32 appUseLength; 701 701 struct regid appIdent; 702 702 uint8_t appUse[0]; 703 - } __attribute__ ((packed)); 703 + } __packed; 704 704 705 705 #define EXTATTR_CHAR_SET 1 706 706 #define EXTATTR_ALT_PERMS 3 ··· 716 716 struct icbtag icbTag; 717 717 __le32 lengthAllocDescs; 718 718 uint8_t allocDescs[0]; 719 - } __attribute__ ((packed)); 719 + } __packed; 720 720 721 721 /* Space Bitmap Descriptor (ECMA 167r3 4/14.12) */ 722 722 struct spaceBitmapDesc { ··· 724 724 __le32 numOfBits; 725 725 __le32 numOfBytes; 726 726 uint8_t bitmap[0]; 727 - } __attribute__ ((packed)); 727 + } __packed; 728 728 729 729 /* Partition Integrity Entry (ECMA 167r3 4/14.13) */ 730 730 struct partitionIntegrityEntry { ··· 735 735 uint8_t reserved[175]; 736 736 struct regid impIdent; 737 737 uint8_t impUse[256]; 738 - } __attribute__ ((packed)); 738 + } __packed; 739 739 740 740 /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */ 741 741 ··· 753 753 struct logicalVolHeaderDesc { 754 754 __le64 uniqueID; 755 755 uint8_t reserved[24]; 756 - } __attribute__ ((packed)); 756 + } __packed; 757 757 758 758 /* Path Component (ECMA 167r3 4/14.16.1) */ 759 759 struct pathComponent { ··· 761 761 uint8_t lengthComponentIdent; 762 762 __le16 componentFileVersionNum; 763 763 dstring componentIdent[0]; 764 - } __attribute__ ((packed)); 764 + } __packed; 765 765 766 766 /* File Entry (ECMA 167r3 4/14.17) */ 767 767 struct extendedFileEntry { ··· 791 791 __le32 lengthAllocDescs; 792 792 uint8_t extendedAttr[0]; 793 793 uint8_t allocDescs[0]; 794 - } __attribute__ ((packed)); 794 + } __packed; 795 795 796 796 #endif /* _ECMA_167_H */
+17 -17
fs/udf/osta_udf.h
··· 70 70 uint8_t OSClass; 71 71 uint8_t OSIdentifier; 72 72 uint8_t reserved[4]; 73 - } __attribute__ ((packed)); 73 + } __packed; 74 74 75 75 struct impIdentSuffix { 76 76 uint8_t OSClass; 77 77 uint8_t OSIdentifier; 78 78 uint8_t reserved[6]; 79 - } __attribute__ ((packed)); 79 + } __packed; 80 80 81 81 struct appIdentSuffix { 82 82 uint8_t impUse[8]; 83 - } __attribute__ ((packed)); 83 + } __packed; 84 84 85 85 /* Logical Volume Integrity Descriptor (UDF 2.50 2.2.6) */ 86 86 /* Implementation Use (UDF 2.50 2.2.6.4) */ ··· 92 92 __le16 minUDFWriteRev; 93 93 __le16 maxUDFWriteRev; 94 94 uint8_t impUse[0]; 95 - } __attribute__ ((packed)); 95 + } __packed; 96 96 97 97 /* Implementation Use Volume Descriptor (UDF 2.50 2.2.7) */ 98 98 /* Implementation Use (UDF 2.50 2.2.7.2) */ ··· 104 104 dstring LVInfo3[36]; 105 105 struct regid impIdent; 106 106 uint8_t impUse[128]; 107 - } __attribute__ ((packed)); 107 + } __packed; 108 108 109 109 struct udfPartitionMap2 { 110 110 uint8_t partitionMapType; ··· 113 113 struct regid partIdent; 114 114 __le16 volSeqNum; 115 115 __le16 partitionNum; 116 - } __attribute__ ((packed)); 116 + } __packed; 117 117 118 118 /* Virtual Partition Map (UDF 2.50 2.2.8) */ 119 119 struct virtualPartitionMap { ··· 124 124 __le16 volSeqNum; 125 125 __le16 partitionNum; 126 126 uint8_t reserved2[24]; 127 - } __attribute__ ((packed)); 127 + } __packed; 128 128 129 129 /* Sparable Partition Map (UDF 2.50 2.2.9) */ 130 130 struct sparablePartitionMap { ··· 139 139 uint8_t reserved2[1]; 140 140 __le32 sizeSparingTable; 141 141 __le32 locSparingTable[4]; 142 - } __attribute__ ((packed)); 142 + } __packed; 143 143 144 144 /* Metadata Partition Map (UDF 2.4.0 2.2.10) */ 145 145 struct metadataPartitionMap { ··· 156 156 __le16 alignUnitSize; 157 157 uint8_t flags; 158 158 uint8_t reserved2[5]; 159 - } __attribute__ ((packed)); 159 + } __packed; 160 160 161 161 /* Virtual Allocation Table (UDF 1.5 2.2.10) */ 162 162 struct virtualAllocationTable15 { 163 163 __le32 VirtualSector[0]; 164 164 struct regid vatIdent; 165 165 __le32 previousVATICBLoc; 166 - } __attribute__ ((packed)); 166 + } __packed; 167 167 168 168 #define ICBTAG_FILE_TYPE_VAT15 0x00U 169 169 ··· 181 181 __le16 reserved; 182 182 uint8_t impUse[0]; 183 183 __le32 vatEntry[0]; 184 - } __attribute__ ((packed)); 184 + } __packed; 185 185 186 186 #define ICBTAG_FILE_TYPE_VAT20 0xF8U 187 187 ··· 189 189 struct sparingEntry { 190 190 __le32 origLocation; 191 191 __le32 mappedLocation; 192 - } __attribute__ ((packed)); 192 + } __packed; 193 193 194 194 struct sparingTable { 195 195 struct tag descTag; ··· 199 199 __le32 sequenceNum; 200 200 struct sparingEntry 201 201 mapEntry[0]; 202 - } __attribute__ ((packed)); 202 + } __packed; 203 203 204 204 /* Metadata File (and Metadata Mirror File) (UDF 2.50 2.2.13.1) */ 205 205 #define ICBTAG_FILE_TYPE_MAIN 0xFA ··· 210 210 struct allocDescImpUse { 211 211 __le16 flags; 212 212 uint8_t impUse[4]; 213 - } __attribute__ ((packed)); 213 + } __packed; 214 214 215 215 #define AD_IU_EXT_ERASED 0x0001 216 216 ··· 222 222 struct freeEaSpace { 223 223 __le16 headerChecksum; 224 224 uint8_t freeEASpace[0]; 225 - } __attribute__ ((packed)); 225 + } __packed; 226 226 227 227 /* DVD Copyright Management Information (UDF 2.50 3.3.4.5.1.2) */ 228 228 struct DVDCopyrightImpUse { ··· 230 230 uint8_t CGMSInfo; 231 231 uint8_t dataType; 232 232 uint8_t protectionSystemInfo[4]; 233 - } __attribute__ ((packed)); 233 + } __packed; 234 234 235 235 /* Application Use Extended Attribute (UDF 2.50 3.3.4.6) */ 236 236 /* FreeAppEASpace (UDF 2.50 3.3.4.6.1) */ 237 237 struct freeAppEASpace { 238 238 __le16 headerChecksum; 239 239 uint8_t freeEASpace[0]; 240 - } __attribute__ ((packed)); 240 + } __packed; 241 241 242 242 /* UDF Defined System Stream (UDF 2.50 3.3.7) */ 243 243 #define UDF_ID_UNIQUE_ID "*UDF Unique ID Mapping Data"