aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2008-10-15 06:28:03 -0400
committerJan Kara <jack@suse.cz>2009-04-02 06:29:47 -0400
commit5ca4e4be841e389d7d17833fef7be2359f290163 (patch)
tree9c059a3b7599260d096fae395d640e79bdc46f30 /fs/udf/inode.c
parent833bb3046b6cb320e775ea2160ddca87d53260d5 (diff)
Remove struct typedefs from fs/udf/ecma_167.h et al.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r--fs/udf/inode.c140
1 files changed, 70 insertions, 70 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 30ebde490f7f..d086479a7d0e 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -55,15 +55,15 @@ static int udf_alloc_i_data(struct inode *inode, size_t size);
55static struct buffer_head *inode_getblk(struct inode *, sector_t, int *, 55static struct buffer_head *inode_getblk(struct inode *, sector_t, int *,
56 sector_t *, int *); 56 sector_t *, int *);
57static int8_t udf_insert_aext(struct inode *, struct extent_position, 57static int8_t udf_insert_aext(struct inode *, struct extent_position,
58 kernel_lb_addr, uint32_t); 58 struct kernel_lb_addr, uint32_t);
59static void udf_split_extents(struct inode *, int *, int, int, 59static void udf_split_extents(struct inode *, int *, int, int,
60 kernel_long_ad[EXTENT_MERGE_SIZE], int *); 60 struct kernel_long_ad[EXTENT_MERGE_SIZE], int *);
61static void udf_prealloc_extents(struct inode *, int, int, 61static void udf_prealloc_extents(struct inode *, int, int,
62 kernel_long_ad[EXTENT_MERGE_SIZE], int *); 62 struct kernel_long_ad[EXTENT_MERGE_SIZE], int *);
63static void udf_merge_extents(struct inode *, 63static void udf_merge_extents(struct inode *,
64 kernel_long_ad[EXTENT_MERGE_SIZE], int *); 64 struct kernel_long_ad[EXTENT_MERGE_SIZE], int *);
65static void udf_update_extents(struct inode *, 65static void udf_update_extents(struct inode *,
66 kernel_long_ad[EXTENT_MERGE_SIZE], int, int, 66 struct kernel_long_ad[EXTENT_MERGE_SIZE], int, int,
67 struct extent_position *); 67 struct extent_position *);
68static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int); 68static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int);
69 69
@@ -200,7 +200,7 @@ struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block,
200{ 200{
201 int newblock; 201 int newblock;
202 struct buffer_head *dbh = NULL; 202 struct buffer_head *dbh = NULL;
203 kernel_lb_addr eloc; 203 struct kernel_lb_addr eloc;
204 uint32_t elen; 204 uint32_t elen;
205 uint8_t alloctype; 205 uint8_t alloctype;
206 struct extent_position epos; 206 struct extent_position epos;
@@ -359,12 +359,12 @@ static struct buffer_head *udf_getblk(struct inode *inode, long block,
359 359
360/* Extend the file by 'blocks' blocks, return the number of extents added */ 360/* Extend the file by 'blocks' blocks, return the number of extents added */
361int udf_extend_file(struct inode *inode, struct extent_position *last_pos, 361int udf_extend_file(struct inode *inode, struct extent_position *last_pos,
362 kernel_long_ad *last_ext, sector_t blocks) 362 struct kernel_long_ad *last_ext, sector_t blocks)
363{ 363{
364 sector_t add; 364 sector_t add;
365 int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK); 365 int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
366 struct super_block *sb = inode->i_sb; 366 struct super_block *sb = inode->i_sb;
367 kernel_lb_addr prealloc_loc = {}; 367 struct kernel_lb_addr prealloc_loc = {};
368 int prealloc_len = 0; 368 int prealloc_len = 0;
369 struct udf_inode_info *iinfo; 369 struct udf_inode_info *iinfo;
370 370
@@ -459,9 +459,9 @@ out:
459 459
460 /* last_pos should point to the last written extent... */ 460 /* last_pos should point to the last written extent... */
461 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 461 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
462 last_pos->offset -= sizeof(short_ad); 462 last_pos->offset -= sizeof(struct short_ad);
463 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) 463 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
464 last_pos->offset -= sizeof(long_ad); 464 last_pos->offset -= sizeof(struct long_ad);
465 else 465 else
466 return -1; 466 return -1;
467 467
@@ -473,11 +473,11 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
473{ 473{
474 static sector_t last_block; 474 static sector_t last_block;
475 struct buffer_head *result = NULL; 475 struct buffer_head *result = NULL;
476 kernel_long_ad laarr[EXTENT_MERGE_SIZE]; 476 struct kernel_long_ad laarr[EXTENT_MERGE_SIZE];
477 struct extent_position prev_epos, cur_epos, next_epos; 477 struct extent_position prev_epos, cur_epos, next_epos;
478 int count = 0, startnum = 0, endnum = 0; 478 int count = 0, startnum = 0, endnum = 0;
479 uint32_t elen = 0, tmpelen; 479 uint32_t elen = 0, tmpelen;
480 kernel_lb_addr eloc, tmpeloc; 480 struct kernel_lb_addr eloc, tmpeloc;
481 int c = 1; 481 int c = 1;
482 loff_t lbcount = 0, b_off = 0; 482 loff_t lbcount = 0, b_off = 0;
483 uint32_t newblocknum, newblock; 483 uint32_t newblocknum, newblock;
@@ -572,7 +572,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
572 } else { 572 } else {
573 /* Create a fake extent when there's not one */ 573 /* Create a fake extent when there's not one */
574 memset(&laarr[0].extLocation, 0x00, 574 memset(&laarr[0].extLocation, 0x00,
575 sizeof(kernel_lb_addr)); 575 sizeof(struct kernel_lb_addr));
576 laarr[0].extLength = EXT_NOT_RECORDED_NOT_ALLOCATED; 576 laarr[0].extLength = EXT_NOT_RECORDED_NOT_ALLOCATED;
577 /* Will udf_extend_file() create real extent from 577 /* Will udf_extend_file() create real extent from
578 a fake one? */ 578 a fake one? */
@@ -602,7 +602,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
602 laarr[c].extLength = EXT_NOT_RECORDED_NOT_ALLOCATED | 602 laarr[c].extLength = EXT_NOT_RECORDED_NOT_ALLOCATED |
603 inode->i_sb->s_blocksize; 603 inode->i_sb->s_blocksize;
604 memset(&laarr[c].extLocation, 0x00, 604 memset(&laarr[c].extLocation, 0x00,
605 sizeof(kernel_lb_addr)); 605 sizeof(struct kernel_lb_addr));
606 count++; 606 count++;
607 endnum++; 607 endnum++;
608 } 608 }
@@ -699,7 +699,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
699 699
700static void udf_split_extents(struct inode *inode, int *c, int offset, 700static void udf_split_extents(struct inode *inode, int *c, int offset,
701 int newblocknum, 701 int newblocknum,
702 kernel_long_ad laarr[EXTENT_MERGE_SIZE], 702 struct kernel_long_ad laarr[EXTENT_MERGE_SIZE],
703 int *endnum) 703 int *endnum)
704{ 704{
705 unsigned long blocksize = inode->i_sb->s_blocksize; 705 unsigned long blocksize = inode->i_sb->s_blocksize;
@@ -763,7 +763,7 @@ static void udf_split_extents(struct inode *inode, int *c, int offset,
763} 763}
764 764
765static void udf_prealloc_extents(struct inode *inode, int c, int lastblock, 765static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
766 kernel_long_ad laarr[EXTENT_MERGE_SIZE], 766 struct kernel_long_ad laarr[EXTENT_MERGE_SIZE],
767 int *endnum) 767 int *endnum)
768{ 768{
769 int start, length = 0, currlength = 0, i; 769 int start, length = 0, currlength = 0, i;
@@ -817,7 +817,7 @@ static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
817 inode->i_sb->s_blocksize_bits); 817 inode->i_sb->s_blocksize_bits);
818 else { 818 else {
819 memmove(&laarr[c + 2], &laarr[c + 1], 819 memmove(&laarr[c + 2], &laarr[c + 1],
820 sizeof(long_ad) * (*endnum - (c + 1))); 820 sizeof(struct long_ad) * (*endnum - (c + 1)));
821 (*endnum)++; 821 (*endnum)++;
822 laarr[c + 1].extLocation.logicalBlockNum = next; 822 laarr[c + 1].extLocation.logicalBlockNum = next;
823 laarr[c + 1].extLocation.partitionReferenceNum = 823 laarr[c + 1].extLocation.partitionReferenceNum =
@@ -846,7 +846,7 @@ static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
846 if (*endnum > (i + 1)) 846 if (*endnum > (i + 1))
847 memmove(&laarr[i], 847 memmove(&laarr[i],
848 &laarr[i + 1], 848 &laarr[i + 1],
849 sizeof(long_ad) * 849 sizeof(struct long_ad) *
850 (*endnum - (i + 1))); 850 (*endnum - (i + 1)));
851 i--; 851 i--;
852 (*endnum)--; 852 (*endnum)--;
@@ -859,7 +859,7 @@ static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
859} 859}
860 860
861static void udf_merge_extents(struct inode *inode, 861static void udf_merge_extents(struct inode *inode,
862 kernel_long_ad laarr[EXTENT_MERGE_SIZE], 862 struct kernel_long_ad laarr[EXTENT_MERGE_SIZE],
863 int *endnum) 863 int *endnum)
864{ 864{
865 int i; 865 int i;
@@ -867,8 +867,8 @@ static void udf_merge_extents(struct inode *inode,
867 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; 867 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits;
868 868
869 for (i = 0; i < (*endnum - 1); i++) { 869 for (i = 0; i < (*endnum - 1); i++) {
870 kernel_long_ad *li /*l[i]*/ = &laarr[i]; 870 struct kernel_long_ad *li /*l[i]*/ = &laarr[i];
871 kernel_long_ad *lip1 /*l[i plus 1]*/ = &laarr[i + 1]; 871 struct kernel_long_ad *lip1 /*l[i plus 1]*/ = &laarr[i + 1];
872 872
873 if (((li->extLength >> 30) == (lip1->extLength >> 30)) && 873 if (((li->extLength >> 30) == (lip1->extLength >> 30)) &&
874 (((li->extLength >> 30) == 874 (((li->extLength >> 30) ==
@@ -902,7 +902,7 @@ static void udf_merge_extents(struct inode *inode,
902 blocksize - 1) & ~(blocksize - 1)); 902 blocksize - 1) & ~(blocksize - 1));
903 if (*endnum > (i + 2)) 903 if (*endnum > (i + 2))
904 memmove(&laarr[i + 1], &laarr[i + 2], 904 memmove(&laarr[i + 1], &laarr[i + 2],
905 sizeof(long_ad) * 905 sizeof(struct long_ad) *
906 (*endnum - (i + 2))); 906 (*endnum - (i + 2)));
907 i--; 907 i--;
908 (*endnum)--; 908 (*endnum)--;
@@ -937,7 +937,7 @@ static void udf_merge_extents(struct inode *inode,
937 blocksize - 1) & ~(blocksize - 1)); 937 blocksize - 1) & ~(blocksize - 1));
938 if (*endnum > (i + 2)) 938 if (*endnum > (i + 2))
939 memmove(&laarr[i + 1], &laarr[i + 2], 939 memmove(&laarr[i + 1], &laarr[i + 2],
940 sizeof(long_ad) * 940 sizeof(struct long_ad) *
941 (*endnum - (i + 2))); 941 (*endnum - (i + 2)));
942 i--; 942 i--;
943 (*endnum)--; 943 (*endnum)--;
@@ -959,12 +959,12 @@ static void udf_merge_extents(struct inode *inode,
959} 959}
960 960
961static void udf_update_extents(struct inode *inode, 961static void udf_update_extents(struct inode *inode,
962 kernel_long_ad laarr[EXTENT_MERGE_SIZE], 962 struct kernel_long_ad laarr[EXTENT_MERGE_SIZE],
963 int startnum, int endnum, 963 int startnum, int endnum,
964 struct extent_position *epos) 964 struct extent_position *epos)
965{ 965{
966 int start = 0, i; 966 int start = 0, i;
967 kernel_lb_addr tmploc; 967 struct kernel_lb_addr tmploc;
968 uint32_t tmplen; 968 uint32_t tmplen;
969 969
970 if (startnum > endnum) { 970 if (startnum > endnum) {
@@ -1102,7 +1102,7 @@ static void __udf_read_inode(struct inode *inode)
1102 &ident); 1102 &ident);
1103 if (ident == TAG_IDENT_IE && ibh) { 1103 if (ident == TAG_IDENT_IE && ibh) {
1104 struct buffer_head *nbh = NULL; 1104 struct buffer_head *nbh = NULL;
1105 kernel_lb_addr loc; 1105 struct kernel_lb_addr loc;
1106 struct indirectEntry *ie; 1106 struct indirectEntry *ie;
1107 1107
1108 ie = (struct indirectEntry *)ibh->b_data; 1108 ie = (struct indirectEntry *)ibh->b_data;
@@ -1115,7 +1115,7 @@ static void __udf_read_inode(struct inode *inode)
1115 ident == TAG_IDENT_EFE) { 1115 ident == TAG_IDENT_EFE) {
1116 memcpy(&iinfo->i_location, 1116 memcpy(&iinfo->i_location,
1117 &loc, 1117 &loc,
1118 sizeof(kernel_lb_addr)); 1118 sizeof(struct kernel_lb_addr));
1119 brelse(bh); 1119 brelse(bh);
1120 brelse(ibh); 1120 brelse(ibh);
1121 brelse(nbh); 1121 brelse(nbh);
@@ -1416,13 +1416,13 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1416 iinfo->i_ext.i_data, inode->i_sb->s_blocksize - 1416 iinfo->i_ext.i_data, inode->i_sb->s_blocksize -
1417 sizeof(struct unallocSpaceEntry)); 1417 sizeof(struct unallocSpaceEntry));
1418 crclen = sizeof(struct unallocSpaceEntry) + 1418 crclen = sizeof(struct unallocSpaceEntry) +
1419 iinfo->i_lenAlloc - sizeof(tag); 1419 iinfo->i_lenAlloc - sizeof(struct tag);
1420 use->descTag.tagLocation = cpu_to_le32( 1420 use->descTag.tagLocation = cpu_to_le32(
1421 iinfo->i_location. 1421 iinfo->i_location.
1422 logicalBlockNum); 1422 logicalBlockNum);
1423 use->descTag.descCRCLength = cpu_to_le16(crclen); 1423 use->descTag.descCRCLength = cpu_to_le16(crclen);
1424 use->descTag.descCRC = cpu_to_le16(crc_itu_t(0, (char *)use + 1424 use->descTag.descCRC = cpu_to_le16(crc_itu_t(0, (char *)use +
1425 sizeof(tag), 1425 sizeof(struct tag),
1426 crclen)); 1426 crclen));
1427 use->descTag.tagChecksum = udf_tag_checksum(&use->descTag); 1427 use->descTag.tagChecksum = udf_tag_checksum(&use->descTag);
1428 1428
@@ -1459,23 +1459,23 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1459 fe->informationLength = cpu_to_le64(inode->i_size); 1459 fe->informationLength = cpu_to_le64(inode->i_size);
1460 1460
1461 if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) { 1461 if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) {
1462 regid *eid; 1462 struct regid *eid;
1463 struct deviceSpec *dsea = 1463 struct deviceSpec *dsea =
1464 (struct deviceSpec *)udf_get_extendedattr(inode, 12, 1); 1464 (struct deviceSpec *)udf_get_extendedattr(inode, 12, 1);
1465 if (!dsea) { 1465 if (!dsea) {
1466 dsea = (struct deviceSpec *) 1466 dsea = (struct deviceSpec *)
1467 udf_add_extendedattr(inode, 1467 udf_add_extendedattr(inode,
1468 sizeof(struct deviceSpec) + 1468 sizeof(struct deviceSpec) +
1469 sizeof(regid), 12, 0x3); 1469 sizeof(struct regid), 12, 0x3);
1470 dsea->attrType = cpu_to_le32(12); 1470 dsea->attrType = cpu_to_le32(12);
1471 dsea->attrSubtype = 1; 1471 dsea->attrSubtype = 1;
1472 dsea->attrLength = cpu_to_le32( 1472 dsea->attrLength = cpu_to_le32(
1473 sizeof(struct deviceSpec) + 1473 sizeof(struct deviceSpec) +
1474 sizeof(regid)); 1474 sizeof(struct regid));
1475 dsea->impUseLength = cpu_to_le32(sizeof(regid)); 1475 dsea->impUseLength = cpu_to_le32(sizeof(struct regid));
1476 } 1476 }
1477 eid = (regid *)dsea->impUse; 1477 eid = (struct regid *)dsea->impUse;
1478 memset(eid, 0, sizeof(regid)); 1478 memset(eid, 0, sizeof(struct regid));
1479 strcpy(eid->ident, UDF_ID_DEVELOPER); 1479 strcpy(eid->ident, UDF_ID_DEVELOPER);
1480 eid->identSuffix[0] = UDF_OS_CLASS_UNIX; 1480 eid->identSuffix[0] = UDF_OS_CLASS_UNIX;
1481 eid->identSuffix[1] = UDF_OS_ID_LINUX; 1481 eid->identSuffix[1] = UDF_OS_ID_LINUX;
@@ -1494,7 +1494,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1494 udf_time_to_disk_stamp(&fe->accessTime, inode->i_atime); 1494 udf_time_to_disk_stamp(&fe->accessTime, inode->i_atime);
1495 udf_time_to_disk_stamp(&fe->modificationTime, inode->i_mtime); 1495 udf_time_to_disk_stamp(&fe->modificationTime, inode->i_mtime);
1496 udf_time_to_disk_stamp(&fe->attrTime, inode->i_ctime); 1496 udf_time_to_disk_stamp(&fe->attrTime, inode->i_ctime);
1497 memset(&(fe->impIdent), 0, sizeof(regid)); 1497 memset(&(fe->impIdent), 0, sizeof(struct regid));
1498 strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); 1498 strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER);
1499 fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; 1499 fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
1500 fe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; 1500 fe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
@@ -1533,7 +1533,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1533 udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); 1533 udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime);
1534 udf_time_to_disk_stamp(&efe->attrTime, inode->i_ctime); 1534 udf_time_to_disk_stamp(&efe->attrTime, inode->i_ctime);
1535 1535
1536 memset(&(efe->impIdent), 0, sizeof(regid)); 1536 memset(&(efe->impIdent), 0, sizeof(struct regid));
1537 strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); 1537 strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER);
1538 efe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; 1538 efe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
1539 efe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; 1539 efe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
@@ -1584,9 +1584,9 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1584 fe->descTag.tagLocation = cpu_to_le32( 1584 fe->descTag.tagLocation = cpu_to_le32(
1585 iinfo->i_location.logicalBlockNum); 1585 iinfo->i_location.logicalBlockNum);
1586 crclen += iinfo->i_lenEAttr + iinfo->i_lenAlloc - 1586 crclen += iinfo->i_lenEAttr + iinfo->i_lenAlloc -
1587 sizeof(tag); 1587 sizeof(struct tag);
1588 fe->descTag.descCRCLength = cpu_to_le16(crclen); 1588 fe->descTag.descCRCLength = cpu_to_le16(crclen);
1589 fe->descTag.descCRC = cpu_to_le16(crc_itu_t(0, (char *)fe + sizeof(tag), 1589 fe->descTag.descCRC = cpu_to_le16(crc_itu_t(0, (char *)fe + sizeof(struct tag),
1590 crclen)); 1590 crclen));
1591 fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag); 1591 fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag);
1592 1592
@@ -1606,7 +1606,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1606 return err; 1606 return err;
1607} 1607}
1608 1608
1609struct inode *udf_iget(struct super_block *sb, kernel_lb_addr ino) 1609struct inode *udf_iget(struct super_block *sb, struct kernel_lb_addr ino)
1610{ 1610{
1611 unsigned long block = udf_get_lb_pblock(sb, ino, 0); 1611 unsigned long block = udf_get_lb_pblock(sb, ino, 0);
1612 struct inode *inode = iget_locked(sb, block); 1612 struct inode *inode = iget_locked(sb, block);
@@ -1615,7 +1615,7 @@ struct inode *udf_iget(struct super_block *sb, kernel_lb_addr ino)
1615 return NULL; 1615 return NULL;
1616 1616
1617 if (inode->i_state & I_NEW) { 1617 if (inode->i_state & I_NEW) {
1618 memcpy(&UDF_I(inode)->i_location, &ino, sizeof(kernel_lb_addr)); 1618 memcpy(&UDF_I(inode)->i_location, &ino, sizeof(struct kernel_lb_addr));
1619 __udf_read_inode(inode); 1619 __udf_read_inode(inode);
1620 unlock_new_inode(inode); 1620 unlock_new_inode(inode);
1621 } 1621 }
@@ -1639,11 +1639,11 @@ struct inode *udf_iget(struct super_block *sb, kernel_lb_addr ino)
1639} 1639}
1640 1640
1641int8_t udf_add_aext(struct inode *inode, struct extent_position *epos, 1641int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1642 kernel_lb_addr eloc, uint32_t elen, int inc) 1642 struct kernel_lb_addr eloc, uint32_t elen, int inc)
1643{ 1643{
1644 int adsize; 1644 int adsize;
1645 short_ad *sad = NULL; 1645 struct short_ad *sad = NULL;
1646 long_ad *lad = NULL; 1646 struct long_ad *lad = NULL;
1647 struct allocExtDesc *aed; 1647 struct allocExtDesc *aed;
1648 int8_t etype; 1648 int8_t etype;
1649 uint8_t *ptr; 1649 uint8_t *ptr;
@@ -1657,9 +1657,9 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1657 ptr = epos->bh->b_data + epos->offset; 1657 ptr = epos->bh->b_data + epos->offset;
1658 1658
1659 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 1659 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
1660 adsize = sizeof(short_ad); 1660 adsize = sizeof(struct short_ad);
1661 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) 1661 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
1662 adsize = sizeof(long_ad); 1662 adsize = sizeof(struct long_ad);
1663 else 1663 else
1664 return -1; 1664 return -1;
1665 1665
@@ -1667,7 +1667,7 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1667 char *sptr, *dptr; 1667 char *sptr, *dptr;
1668 struct buffer_head *nbh; 1668 struct buffer_head *nbh;
1669 int err, loffset; 1669 int err, loffset;
1670 kernel_lb_addr obloc = epos->block; 1670 struct kernel_lb_addr obloc = epos->block;
1671 1671
1672 epos->block.logicalBlockNum = udf_new_block(inode->i_sb, NULL, 1672 epos->block.logicalBlockNum = udf_new_block(inode->i_sb, NULL,
1673 obloc.partitionReferenceNum, 1673 obloc.partitionReferenceNum,
@@ -1712,20 +1712,20 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1712 } 1712 }
1713 if (UDF_SB(inode->i_sb)->s_udfrev >= 0x0200) 1713 if (UDF_SB(inode->i_sb)->s_udfrev >= 0x0200)
1714 udf_new_tag(nbh->b_data, TAG_IDENT_AED, 3, 1, 1714 udf_new_tag(nbh->b_data, TAG_IDENT_AED, 3, 1,
1715 epos->block.logicalBlockNum, sizeof(tag)); 1715 epos->block.logicalBlockNum, sizeof(struct tag));
1716 else 1716 else
1717 udf_new_tag(nbh->b_data, TAG_IDENT_AED, 2, 1, 1717 udf_new_tag(nbh->b_data, TAG_IDENT_AED, 2, 1,
1718 epos->block.logicalBlockNum, sizeof(tag)); 1718 epos->block.logicalBlockNum, sizeof(struct tag));
1719 switch (iinfo->i_alloc_type) { 1719 switch (iinfo->i_alloc_type) {
1720 case ICBTAG_FLAG_AD_SHORT: 1720 case ICBTAG_FLAG_AD_SHORT:
1721 sad = (short_ad *)sptr; 1721 sad = (struct short_ad *)sptr;
1722 sad->extLength = cpu_to_le32(EXT_NEXT_EXTENT_ALLOCDECS | 1722 sad->extLength = cpu_to_le32(EXT_NEXT_EXTENT_ALLOCDECS |
1723 inode->i_sb->s_blocksize); 1723 inode->i_sb->s_blocksize);
1724 sad->extPosition = 1724 sad->extPosition =
1725 cpu_to_le32(epos->block.logicalBlockNum); 1725 cpu_to_le32(epos->block.logicalBlockNum);
1726 break; 1726 break;
1727 case ICBTAG_FLAG_AD_LONG: 1727 case ICBTAG_FLAG_AD_LONG:
1728 lad = (long_ad *)sptr; 1728 lad = (struct long_ad *)sptr;
1729 lad->extLength = cpu_to_le32(EXT_NEXT_EXTENT_ALLOCDECS | 1729 lad->extLength = cpu_to_le32(EXT_NEXT_EXTENT_ALLOCDECS |
1730 inode->i_sb->s_blocksize); 1730 inode->i_sb->s_blocksize);
1731 lad->extLocation = cpu_to_lelb(epos->block); 1731 lad->extLocation = cpu_to_lelb(epos->block);
@@ -1769,12 +1769,12 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1769} 1769}
1770 1770
1771int8_t udf_write_aext(struct inode *inode, struct extent_position *epos, 1771int8_t udf_write_aext(struct inode *inode, struct extent_position *epos,
1772 kernel_lb_addr eloc, uint32_t elen, int inc) 1772 struct kernel_lb_addr eloc, uint32_t elen, int inc)
1773{ 1773{
1774 int adsize; 1774 int adsize;
1775 uint8_t *ptr; 1775 uint8_t *ptr;
1776 short_ad *sad; 1776 struct short_ad *sad;
1777 long_ad *lad; 1777 struct long_ad *lad;
1778 struct udf_inode_info *iinfo = UDF_I(inode); 1778 struct udf_inode_info *iinfo = UDF_I(inode);
1779 1779
1780 if (!epos->bh) 1780 if (!epos->bh)
@@ -1786,17 +1786,17 @@ int8_t udf_write_aext(struct inode *inode, struct extent_position *epos,
1786 1786
1787 switch (iinfo->i_alloc_type) { 1787 switch (iinfo->i_alloc_type) {
1788 case ICBTAG_FLAG_AD_SHORT: 1788 case ICBTAG_FLAG_AD_SHORT:
1789 sad = (short_ad *)ptr; 1789 sad = (struct short_ad *)ptr;
1790 sad->extLength = cpu_to_le32(elen); 1790 sad->extLength = cpu_to_le32(elen);
1791 sad->extPosition = cpu_to_le32(eloc.logicalBlockNum); 1791 sad->extPosition = cpu_to_le32(eloc.logicalBlockNum);
1792 adsize = sizeof(short_ad); 1792 adsize = sizeof(struct short_ad);
1793 break; 1793 break;
1794 case ICBTAG_FLAG_AD_LONG: 1794 case ICBTAG_FLAG_AD_LONG:
1795 lad = (long_ad *)ptr; 1795 lad = (struct long_ad *)ptr;
1796 lad->extLength = cpu_to_le32(elen); 1796 lad->extLength = cpu_to_le32(elen);
1797 lad->extLocation = cpu_to_lelb(eloc); 1797 lad->extLocation = cpu_to_lelb(eloc);
1798 memset(lad->impUse, 0x00, sizeof(lad->impUse)); 1798 memset(lad->impUse, 0x00, sizeof(lad->impUse));
1799 adsize = sizeof(long_ad); 1799 adsize = sizeof(struct long_ad);
1800 break; 1800 break;
1801 default: 1801 default:
1802 return -1; 1802 return -1;
@@ -1823,7 +1823,7 @@ int8_t udf_write_aext(struct inode *inode, struct extent_position *epos,
1823} 1823}
1824 1824
1825int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, 1825int8_t udf_next_aext(struct inode *inode, struct extent_position *epos,
1826 kernel_lb_addr *eloc, uint32_t *elen, int inc) 1826 struct kernel_lb_addr *eloc, uint32_t *elen, int inc)
1827{ 1827{
1828 int8_t etype; 1828 int8_t etype;
1829 1829
@@ -1845,13 +1845,13 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos,
1845} 1845}
1846 1846
1847int8_t udf_current_aext(struct inode *inode, struct extent_position *epos, 1847int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
1848 kernel_lb_addr *eloc, uint32_t *elen, int inc) 1848 struct kernel_lb_addr *eloc, uint32_t *elen, int inc)
1849{ 1849{
1850 int alen; 1850 int alen;
1851 int8_t etype; 1851 int8_t etype;
1852 uint8_t *ptr; 1852 uint8_t *ptr;
1853 short_ad *sad; 1853 struct short_ad *sad;
1854 long_ad *lad; 1854 struct long_ad *lad;
1855 struct udf_inode_info *iinfo = UDF_I(inode); 1855 struct udf_inode_info *iinfo = UDF_I(inode);
1856 1856
1857 if (!epos->bh) { 1857 if (!epos->bh) {
@@ -1900,9 +1900,9 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
1900} 1900}
1901 1901
1902static int8_t udf_insert_aext(struct inode *inode, struct extent_position epos, 1902static int8_t udf_insert_aext(struct inode *inode, struct extent_position epos,
1903 kernel_lb_addr neloc, uint32_t nelen) 1903 struct kernel_lb_addr neloc, uint32_t nelen)
1904{ 1904{
1905 kernel_lb_addr oeloc; 1905 struct kernel_lb_addr oeloc;
1906 uint32_t oelen; 1906 uint32_t oelen;
1907 int8_t etype; 1907 int8_t etype;
1908 1908
@@ -1921,7 +1921,7 @@ static int8_t udf_insert_aext(struct inode *inode, struct extent_position epos,
1921} 1921}
1922 1922
1923int8_t udf_delete_aext(struct inode *inode, struct extent_position epos, 1923int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
1924 kernel_lb_addr eloc, uint32_t elen) 1924 struct kernel_lb_addr eloc, uint32_t elen)
1925{ 1925{
1926 struct extent_position oepos; 1926 struct extent_position oepos;
1927 int adsize; 1927 int adsize;
@@ -1936,9 +1936,9 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
1936 1936
1937 iinfo = UDF_I(inode); 1937 iinfo = UDF_I(inode);
1938 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 1938 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
1939 adsize = sizeof(short_ad); 1939 adsize = sizeof(struct short_ad);
1940 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) 1940 else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
1941 adsize = sizeof(long_ad); 1941 adsize = sizeof(struct long_ad);
1942 else 1942 else
1943 adsize = 0; 1943 adsize = 0;
1944 1944
@@ -1956,7 +1956,7 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
1956 oepos.offset = epos.offset - adsize; 1956 oepos.offset = epos.offset - adsize;
1957 } 1957 }
1958 } 1958 }
1959 memset(&eloc, 0x00, sizeof(kernel_lb_addr)); 1959 memset(&eloc, 0x00, sizeof(struct kernel_lb_addr));
1960 elen = 0; 1960 elen = 0;
1961 1961
1962 if (epos.bh != oepos.bh) { 1962 if (epos.bh != oepos.bh) {
@@ -2004,7 +2004,7 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
2004} 2004}
2005 2005
2006int8_t inode_bmap(struct inode *inode, sector_t block, 2006int8_t inode_bmap(struct inode *inode, sector_t block,
2007 struct extent_position *pos, kernel_lb_addr *eloc, 2007 struct extent_position *pos, struct kernel_lb_addr *eloc,
2008 uint32_t *elen, sector_t *offset) 2008 uint32_t *elen, sector_t *offset)
2009{ 2009{
2010 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; 2010 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits;
@@ -2036,7 +2036,7 @@ int8_t inode_bmap(struct inode *inode, sector_t block,
2036 2036
2037long udf_block_map(struct inode *inode, sector_t block) 2037long udf_block_map(struct inode *inode, sector_t block)
2038{ 2038{
2039 kernel_lb_addr eloc; 2039 struct kernel_lb_addr eloc;
2040 uint32_t elen; 2040 uint32_t elen;
2041 sector_t offset; 2041 sector_t offset;
2042 struct extent_position epos = {}; 2042 struct extent_position epos = {};