aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:42 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:35 -0500
commitc0b344385fa05f6bea462e707fcba89f9e2776c2 (patch)
tree391376739ffb0b5c9dfcf294c9f746d7ff2daf66
parent5e0f001736651f6f859aeca95f895c829d223cdb (diff)
udf: remove UDF_I_* macros and open code them
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Acked-by: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/udf/balloc.c30
-rw-r--r--fs/udf/dir.c7
-rw-r--r--fs/udf/directory.c6
-rw-r--r--fs/udf/file.c24
-rw-r--r--fs/udf/ialloc.c50
-rw-r--r--fs/udf/inode.c296
-rw-r--r--fs/udf/misc.c38
-rw-r--r--fs/udf/namei.c110
-rw-r--r--fs/udf/partition.c4
-rw-r--r--fs/udf/super.c2
-rw-r--r--fs/udf/symlink.c4
-rw-r--r--fs/udf/truncate.c34
-rw-r--r--fs/udf/udf_i.h16
-rw-r--r--fs/udf/udfdecl.h8
14 files changed, 315 insertions, 314 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index 989259655b40..7b95b3f46211 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -460,7 +460,7 @@ static void udf_table_free_blocks(struct super_block *sb,
460 460
461 epos.offset = oepos.offset = sizeof(struct unallocSpaceEntry); 461 epos.offset = oepos.offset = sizeof(struct unallocSpaceEntry);
462 elen = 0; 462 elen = 0;
463 epos.block = oepos.block = UDF_I_LOCATION(table); 463 epos.block = oepos.block = UDF_I(table)->i_location;
464 epos.bh = oepos.bh = NULL; 464 epos.bh = oepos.bh = NULL;
465 465
466 while (count && 466 while (count &&
@@ -539,9 +539,9 @@ static void udf_table_free_blocks(struct super_block *sb,
539 elen = EXT_RECORDED_ALLOCATED | 539 elen = EXT_RECORDED_ALLOCATED |
540 (count << sb->s_blocksize_bits); 540 (count << sb->s_blocksize_bits);
541 541
542 if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_SHORT) { 542 if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_SHORT) {
543 adsize = sizeof(short_ad); 543 adsize = sizeof(short_ad);
544 } else if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_LONG) { 544 } else if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_LONG) {
545 adsize = sizeof(long_ad); 545 adsize = sizeof(long_ad);
546 } else { 546 } else {
547 brelse(oepos.bh); 547 brelse(oepos.bh);
@@ -573,7 +573,8 @@ static void udf_table_free_blocks(struct super_block *sb,
573 if (epos.offset + adsize > sb->s_blocksize) { 573 if (epos.offset + adsize > sb->s_blocksize) {
574 loffset = epos.offset; 574 loffset = epos.offset;
575 aed->lengthAllocDescs = cpu_to_le32(adsize); 575 aed->lengthAllocDescs = cpu_to_le32(adsize);
576 sptr = UDF_I_DATA(table) + epos.offset - adsize; 576 sptr = UDF_I(table)->i_ext.i_data + epos.offset
577 - adsize;
577 dptr = epos.bh->b_data + 578 dptr = epos.bh->b_data +
578 sizeof(struct allocExtDesc); 579 sizeof(struct allocExtDesc);
579 memcpy(dptr, sptr, adsize); 580 memcpy(dptr, sptr, adsize);
@@ -591,8 +592,9 @@ static void udf_table_free_blocks(struct super_block *sb,
591 aed->lengthAllocDescs) + 592 aed->lengthAllocDescs) +
592 adsize); 593 adsize);
593 } else { 594 } else {
594 sptr = UDF_I_DATA(table) + epos.offset; 595 sptr = UDF_I(table)->i_ext.i_data +
595 UDF_I_LENALLOC(table) += adsize; 596 epos.offset;
597 UDF_I(table)->i_lenAlloc += adsize;
596 mark_inode_dirty(table); 598 mark_inode_dirty(table);
597 } 599 }
598 epos.offset = sizeof(struct allocExtDesc); 600 epos.offset = sizeof(struct allocExtDesc);
@@ -606,7 +608,7 @@ static void udf_table_free_blocks(struct super_block *sb,
606 2, 1, epos.block.logicalBlockNum, 608 2, 1, epos.block.logicalBlockNum,
607 sizeof(tag)); 609 sizeof(tag));
608 610
609 switch (UDF_I_ALLOCTYPE(table)) { 611 switch (UDF_I(table)->i_alloc_type) {
610 case ICBTAG_FLAG_AD_SHORT: 612 case ICBTAG_FLAG_AD_SHORT:
611 sad = (short_ad *)sptr; 613 sad = (short_ad *)sptr;
612 sad->extLength = cpu_to_le32( 614 sad->extLength = cpu_to_le32(
@@ -637,7 +639,7 @@ static void udf_table_free_blocks(struct super_block *sb,
637 udf_write_aext(table, &epos, eloc, elen, 1); 639 udf_write_aext(table, &epos, eloc, elen, 1);
638 640
639 if (!epos.bh) { 641 if (!epos.bh) {
640 UDF_I_LENALLOC(table) += adsize; 642 UDF_I(table)->i_lenAlloc += adsize;
641 mark_inode_dirty(table); 643 mark_inode_dirty(table);
642 } else { 644 } else {
643 aed = (struct allocExtDesc *)epos.bh->b_data; 645 aed = (struct allocExtDesc *)epos.bh->b_data;
@@ -675,16 +677,16 @@ static int udf_table_prealloc_blocks(struct super_block *sb,
675 first_block >= sbi->s_partmaps[partition].s_partition_len) 677 first_block >= sbi->s_partmaps[partition].s_partition_len)
676 return 0; 678 return 0;
677 679
678 if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_SHORT) 680 if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
679 adsize = sizeof(short_ad); 681 adsize = sizeof(short_ad);
680 else if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_LONG) 682 else if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
681 adsize = sizeof(long_ad); 683 adsize = sizeof(long_ad);
682 else 684 else
683 return 0; 685 return 0;
684 686
685 mutex_lock(&sbi->s_alloc_mutex); 687 mutex_lock(&sbi->s_alloc_mutex);
686 epos.offset = sizeof(struct unallocSpaceEntry); 688 epos.offset = sizeof(struct unallocSpaceEntry);
687 epos.block = UDF_I_LOCATION(table); 689 epos.block = UDF_I(table)->i_location;
688 epos.bh = NULL; 690 epos.bh = NULL;
689 eloc.logicalBlockNum = 0xFFFFFFFF; 691 eloc.logicalBlockNum = 0xFFFFFFFF;
690 692
@@ -740,9 +742,9 @@ static int udf_table_new_block(struct super_block *sb,
740 742
741 *err = -ENOSPC; 743 *err = -ENOSPC;
742 744
743 if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_SHORT) 745 if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
744 adsize = sizeof(short_ad); 746 adsize = sizeof(short_ad);
745 else if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_LONG) 747 else if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
746 adsize = sizeof(long_ad); 748 adsize = sizeof(long_ad);
747 else 749 else
748 return newblock; 750 return newblock;
@@ -757,7 +759,7 @@ static int udf_table_new_block(struct super_block *sb,
757 of the current closest match and use that when we are done. 759 of the current closest match and use that when we are done.
758 */ 760 */
759 epos.offset = sizeof(struct unallocSpaceEntry); 761 epos.offset = sizeof(struct unallocSpaceEntry);
760 epos.block = UDF_I_LOCATION(table); 762 epos.block = UDF_I(table)->i_location;
761 epos.bh = goal_epos.bh = NULL; 763 epos.bh = goal_epos.bh = NULL;
762 764
763 while (spread && 765 while (spread &&
diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index 9e3b9f97ddbc..6fd831413c9a 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -125,15 +125,16 @@ do_udf_readdir(struct inode *dir, struct file *filp, filldir_t filldir,
125 nf_pos = (udf_ext0_offset(dir) >> 2); 125 nf_pos = (udf_ext0_offset(dir) >> 2);
126 126
127 fibh.soffset = fibh.eoffset = (nf_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2; 127 fibh.soffset = fibh.eoffset = (nf_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
128 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) { 128 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
129 fibh.sbh = fibh.ebh = NULL; 129 fibh.sbh = fibh.ebh = NULL;
130 } else if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2), 130 } else if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2),
131 &epos, &eloc, &elen, &offset) == (EXT_RECORDED_ALLOCATED >> 30)) { 131 &epos, &eloc, &elen, &offset) == (EXT_RECORDED_ALLOCATED >> 30)) {
132 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 132 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
133 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 133 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
134 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_SHORT) 134 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
135 epos.offset -= sizeof(short_ad); 135 epos.offset -= sizeof(short_ad);
136 else if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_LONG) 136 else if (UDF_I(dir)->i_alloc_type ==
137 ICBTAG_FLAG_AD_LONG)
137 epos.offset -= sizeof(long_ad); 138 epos.offset -= sizeof(long_ad);
138 } else { 139 } else {
139 offset = 0; 140 offset = 0;
diff --git a/fs/udf/directory.c b/fs/udf/directory.c
index 88d8895bd990..949a5930f6d4 100644
--- a/fs/udf/directory.c
+++ b/fs/udf/directory.c
@@ -84,9 +84,9 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos,
84 84
85 fibh->soffset = fibh->eoffset; 85 fibh->soffset = fibh->eoffset;
86 86
87 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) { 87 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
88 fi = udf_get_fileident(UDF_I_DATA(dir) - 88 fi = udf_get_fileident(UDF_I(dir)->i_ext.i_data -
89 (UDF_I_EFE(dir) ? 89 (UDF_I(dir)->i_efe ?
90 sizeof(struct extendedFileEntry) : 90 sizeof(struct extendedFileEntry) :
91 sizeof(struct fileEntry)), 91 sizeof(struct fileEntry)),
92 dir->i_sb->s_blocksize, 92 dir->i_sb->s_blocksize,
diff --git a/fs/udf/file.c b/fs/udf/file.c
index a984a8911167..a1e07a131623 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -50,7 +50,8 @@ static int udf_adinicb_readpage(struct file *file, struct page *page)
50 50
51 kaddr = kmap(page); 51 kaddr = kmap(page);
52 memset(kaddr, 0, PAGE_CACHE_SIZE); 52 memset(kaddr, 0, PAGE_CACHE_SIZE);
53 memcpy(kaddr, UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), inode->i_size); 53 memcpy(kaddr, UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr,
54 inode->i_size);
54 flush_dcache_page(page); 55 flush_dcache_page(page);
55 SetPageUptodate(page); 56 SetPageUptodate(page);
56 kunmap(page); 57 kunmap(page);
@@ -68,7 +69,8 @@ static int udf_adinicb_writepage(struct page *page,
68 BUG_ON(!PageLocked(page)); 69 BUG_ON(!PageLocked(page));
69 70
70 kaddr = kmap(page); 71 kaddr = kmap(page);
71 memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), kaddr, inode->i_size); 72 memcpy(UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr, kaddr,
73 inode->i_size);
72 mark_inode_dirty(inode); 74 mark_inode_dirty(inode);
73 SetPageUptodate(page); 75 SetPageUptodate(page);
74 kunmap(page); 76 kunmap(page);
@@ -87,7 +89,7 @@ static int udf_adinicb_write_end(struct file *file,
87 char *kaddr; 89 char *kaddr;
88 90
89 kaddr = kmap_atomic(page, KM_USER0); 91 kaddr = kmap_atomic(page, KM_USER0);
90 memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode) + offset, 92 memcpy(UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr + offset,
91 kaddr + offset, copied); 93 kaddr + offset, copied);
92 kunmap_atomic(kaddr, KM_USER0); 94 kunmap_atomic(kaddr, KM_USER0);
93 95
@@ -111,7 +113,7 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
111 int err, pos; 113 int err, pos;
112 size_t count = iocb->ki_left; 114 size_t count = iocb->ki_left;
113 115
114 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) { 116 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
115 if (file->f_flags & O_APPEND) 117 if (file->f_flags & O_APPEND)
116 pos = inode->i_size; 118 pos = inode->i_size;
117 else 119 else
@@ -121,15 +123,16 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
121 (udf_file_entry_alloc_offset(inode) + 123 (udf_file_entry_alloc_offset(inode) +
122 pos + count)) { 124 pos + count)) {
123 udf_expand_file_adinicb(inode, pos + count, &err); 125 udf_expand_file_adinicb(inode, pos + count, &err);
124 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) { 126 if (UDF_I(inode)->i_alloc_type ==
127 ICBTAG_FLAG_AD_IN_ICB) {
125 udf_debug("udf_expand_adinicb: err=%d\n", err); 128 udf_debug("udf_expand_adinicb: err=%d\n", err);
126 return err; 129 return err;
127 } 130 }
128 } else { 131 } else {
129 if (pos + count > inode->i_size) 132 if (pos + count > inode->i_size)
130 UDF_I_LENALLOC(inode) = pos + count; 133 UDF_I(inode)->i_lenAlloc = pos + count;
131 else 134 else
132 UDF_I_LENALLOC(inode) = inode->i_size; 135 UDF_I(inode)->i_lenAlloc = inode->i_size;
133 } 136 }
134 } 137 }
135 138
@@ -209,11 +212,12 @@ int udf_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
209 result = put_user(new_block, (long __user *)arg); 212 result = put_user(new_block, (long __user *)arg);
210 return result; 213 return result;
211 case UDF_GETEASIZE: 214 case UDF_GETEASIZE:
212 result = put_user(UDF_I_LENEATTR(inode), (int __user *)arg); 215 result = put_user(UDF_I(inode)->i_lenEAttr, (int __user *)arg);
213 break; 216 break;
214 case UDF_GETEABLOCK: 217 case UDF_GETEABLOCK:
215 result = copy_to_user((char __user *)arg, UDF_I_DATA(inode), 218 result = copy_to_user((char __user *)arg,
216 UDF_I_LENEATTR(inode)) ? -EFAULT : 0; 219 UDF_I(inode)->i_ext.i_data,
220 UDF_I(inode)->i_lenEAttr) ? -EFAULT : 0;
217 break; 221 break;
218 } 222 }
219 223
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c
index 7697b489a292..5ed8cda1c53e 100644
--- a/fs/udf/ialloc.c
+++ b/fs/udf/ialloc.c
@@ -57,7 +57,7 @@ void udf_free_inode(struct inode *inode)
57 } 57 }
58 mutex_unlock(&sbi->s_alloc_mutex); 58 mutex_unlock(&sbi->s_alloc_mutex);
59 59
60 udf_free_blocks(sb, NULL, UDF_I_LOCATION(inode), 0, 1); 60 udf_free_blocks(sb, NULL, UDF_I(inode)->i_location, 0, 1);
61} 61}
62 62
63struct inode *udf_new_inode(struct inode *dir, int mode, int *err) 63struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
@@ -66,7 +66,7 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
66 struct udf_sb_info *sbi = UDF_SB(sb); 66 struct udf_sb_info *sbi = UDF_SB(sb);
67 struct inode *inode; 67 struct inode *inode;
68 int block; 68 int block;
69 uint32_t start = UDF_I_LOCATION(dir).logicalBlockNum; 69 uint32_t start = UDF_I(dir)->i_location.logicalBlockNum;
70 70
71 inode = new_inode(sb); 71 inode = new_inode(sb);
72 72
@@ -76,14 +76,14 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
76 } 76 }
77 *err = -ENOSPC; 77 *err = -ENOSPC;
78 78
79 UDF_I_UNIQUE(inode) = 0; 79 UDF_I(inode)->i_unique = 0;
80 UDF_I_LENEXTENTS(inode) = 0; 80 UDF_I(inode)->i_lenExtents = 0;
81 UDF_I_NEXT_ALLOC_BLOCK(inode) = 0; 81 UDF_I(inode)->i_next_alloc_block = 0;
82 UDF_I_NEXT_ALLOC_GOAL(inode) = 0; 82 UDF_I(inode)->i_next_alloc_goal = 0;
83 UDF_I_STRAT4096(inode) = 0; 83 UDF_I(inode)->i_strat4096 = 0;
84 84
85 block = udf_new_block(dir->i_sb, NULL, 85 block = udf_new_block(dir->i_sb, NULL,
86 UDF_I_LOCATION(dir).partitionReferenceNum, 86 UDF_I(dir)->i_location.partitionReferenceNum,
87 start, err); 87 start, err);
88 if (*err) { 88 if (*err) {
89 iput(inode); 89 iput(inode);
@@ -107,7 +107,7 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
107 else 107 else
108 lvidiu->numFiles = 108 lvidiu->numFiles =
109 cpu_to_le32(le32_to_cpu(lvidiu->numFiles) + 1); 109 cpu_to_le32(le32_to_cpu(lvidiu->numFiles) + 1);
110 UDF_I_UNIQUE(inode) = uniqueID = le64_to_cpu(lvhd->uniqueID); 110 UDF_I(inode)->i_unique = uniqueID = le64_to_cpu(lvhd->uniqueID);
111 if (!(++uniqueID & 0x00000000FFFFFFFFUL)) 111 if (!(++uniqueID & 0x00000000FFFFFFFFUL))
112 uniqueID += 16; 112 uniqueID += 16;
113 lvhd->uniqueID = cpu_to_le64(uniqueID); 113 lvhd->uniqueID = cpu_to_le64(uniqueID);
@@ -123,41 +123,41 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err)
123 inode->i_gid = current->fsgid; 123 inode->i_gid = current->fsgid;
124 } 124 }
125 125
126 UDF_I_LOCATION(inode).logicalBlockNum = block; 126 UDF_I(inode)->i_location.logicalBlockNum = block;
127 UDF_I_LOCATION(inode).partitionReferenceNum = 127 UDF_I(inode)->i_location.partitionReferenceNum =
128 UDF_I_LOCATION(dir).partitionReferenceNum; 128 UDF_I(dir)->i_location.partitionReferenceNum;
129 inode->i_ino = udf_get_lb_pblock(sb, UDF_I_LOCATION(inode), 0); 129 inode->i_ino = udf_get_lb_pblock(sb, UDF_I(inode)->i_location, 0);
130 inode->i_blocks = 0; 130 inode->i_blocks = 0;
131 UDF_I_LENEATTR(inode) = 0; 131 UDF_I(inode)->i_lenEAttr = 0;
132 UDF_I_LENALLOC(inode) = 0; 132 UDF_I(inode)->i_lenAlloc = 0;
133 UDF_I_USE(inode) = 0; 133 UDF_I(inode)->i_use = 0;
134 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) { 134 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) {
135 UDF_I_EFE(inode) = 1; 135 UDF_I(inode)->i_efe = 1;
136 if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev) 136 if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev)
137 sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE; 137 sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE;
138 UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - 138 UDF_I(inode)->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize -
139 sizeof(struct extendedFileEntry), 139 sizeof(struct extendedFileEntry),
140 GFP_KERNEL); 140 GFP_KERNEL);
141 } else { 141 } else {
142 UDF_I_EFE(inode) = 0; 142 UDF_I(inode)->i_efe = 0;
143 UDF_I_DATA(inode) = kzalloc(inode->i_sb->s_blocksize - 143 UDF_I(inode)->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize -
144 sizeof(struct fileEntry), 144 sizeof(struct fileEntry),
145 GFP_KERNEL); 145 GFP_KERNEL);
146 } 146 }
147 if (!UDF_I_DATA(inode)) { 147 if (!UDF_I(inode)->i_ext.i_data) {
148 iput(inode); 148 iput(inode);
149 *err = -ENOMEM; 149 *err = -ENOMEM;
150 mutex_unlock(&sbi->s_alloc_mutex); 150 mutex_unlock(&sbi->s_alloc_mutex);
151 return NULL; 151 return NULL;
152 } 152 }
153 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB)) 153 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB))
154 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_IN_ICB; 154 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
155 else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) 155 else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD))
156 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_SHORT; 156 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_SHORT;
157 else 157 else
158 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_LONG; 158 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_LONG;
159 inode->i_mtime = inode->i_atime = inode->i_ctime = 159 inode->i_mtime = inode->i_atime = inode->i_ctime =
160 UDF_I_CRTIME(inode) = current_fs_time(inode->i_sb); 160 UDF_I(inode)->i_crtime = current_fs_time(inode->i_sb);
161 insert_inode_hash(inode); 161 insert_inode_hash(inode);
162 mark_inode_dirty(inode); 162 mark_inode_dirty(inode);
163 mutex_unlock(&sbi->s_alloc_mutex); 163 mutex_unlock(&sbi->s_alloc_mutex);
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 487bdb7dc835..f746b9f1c03c 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -120,8 +120,8 @@ void udf_clear_inode(struct inode *inode)
120 unlock_kernel(); 120 unlock_kernel();
121 write_inode_now(inode, 1); 121 write_inode_now(inode, 1);
122 } 122 }
123 kfree(UDF_I_DATA(inode)); 123 kfree(UDF_I(inode)->i_ext.i_data);
124 UDF_I_DATA(inode) = NULL; 124 UDF_I(inode)->i_ext.i_data = NULL;
125} 125}
126 126
127static int udf_writepage(struct page *page, struct writeback_control *wbc) 127static int udf_writepage(struct page *page, struct writeback_control *wbc)
@@ -169,11 +169,11 @@ void udf_expand_file_adinicb(struct inode *inode, int newsize, int *err)
169 /* from now on we have normal address_space methods */ 169 /* from now on we have normal address_space methods */
170 inode->i_data.a_ops = &udf_aops; 170 inode->i_data.a_ops = &udf_aops;
171 171
172 if (!UDF_I_LENALLOC(inode)) { 172 if (!UDF_I(inode)->i_lenAlloc) {
173 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) 173 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD))
174 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_SHORT; 174 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_SHORT;
175 else 175 else
176 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_LONG; 176 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_LONG;
177 mark_inode_dirty(inode); 177 mark_inode_dirty(inode);
178 return; 178 return;
179 } 179 }
@@ -183,21 +183,21 @@ void udf_expand_file_adinicb(struct inode *inode, int newsize, int *err)
183 183
184 if (!PageUptodate(page)) { 184 if (!PageUptodate(page)) {
185 kaddr = kmap(page); 185 kaddr = kmap(page);
186 memset(kaddr + UDF_I_LENALLOC(inode), 0x00, 186 memset(kaddr + UDF_I(inode)->i_lenAlloc, 0x00,
187 PAGE_CACHE_SIZE - UDF_I_LENALLOC(inode)); 187 PAGE_CACHE_SIZE - UDF_I(inode)->i_lenAlloc);
188 memcpy(kaddr, UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), 188 memcpy(kaddr, UDF_I(inode)->i_ext.i_data +
189 UDF_I_LENALLOC(inode)); 189 UDF_I(inode)->i_lenEAttr, UDF_I(inode)->i_lenAlloc);
190 flush_dcache_page(page); 190 flush_dcache_page(page);
191 SetPageUptodate(page); 191 SetPageUptodate(page);
192 kunmap(page); 192 kunmap(page);
193 } 193 }
194 memset(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), 0x00, 194 memset(UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr, 0x00,
195 UDF_I_LENALLOC(inode)); 195 UDF_I(inode)->i_lenAlloc);
196 UDF_I_LENALLOC(inode) = 0; 196 UDF_I(inode)->i_lenAlloc = 0;
197 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) 197 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD))
198 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_SHORT; 198 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_SHORT;
199 else 199 else
200 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_LONG; 200 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_LONG;
201 201
202 inode->i_data.a_ops->writepage(page, &udf_wbc); 202 inode->i_data.a_ops->writepage(page, &udf_wbc);
203 page_cache_release(page); 203 page_cache_release(page);
@@ -226,20 +226,20 @@ struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block,
226 alloctype = ICBTAG_FLAG_AD_LONG; 226 alloctype = ICBTAG_FLAG_AD_LONG;
227 227
228 if (!inode->i_size) { 228 if (!inode->i_size) {
229 UDF_I_ALLOCTYPE(inode) = alloctype; 229 UDF_I(inode)->i_alloc_type = alloctype;
230 mark_inode_dirty(inode); 230 mark_inode_dirty(inode);
231 return NULL; 231 return NULL;
232 } 232 }
233 233
234 /* alloc block, and copy data to it */ 234 /* alloc block, and copy data to it */
235 *block = udf_new_block(inode->i_sb, inode, 235 *block = udf_new_block(inode->i_sb, inode,
236 UDF_I_LOCATION(inode).partitionReferenceNum, 236 UDF_I(inode)->i_location.partitionReferenceNum,
237 UDF_I_LOCATION(inode).logicalBlockNum, err); 237 UDF_I(inode)->i_location.logicalBlockNum, err);
238 if (!(*block)) 238 if (!(*block))
239 return NULL; 239 return NULL;
240 newblock = udf_get_pblock(inode->i_sb, *block, 240 newblock = udf_get_pblock(inode->i_sb, *block,
241 UDF_I_LOCATION(inode).partitionReferenceNum, 241 UDF_I(inode)->i_location.partitionReferenceNum,
242 0); 242 0);
243 if (!newblock) 243 if (!newblock)
244 return NULL; 244 return NULL;
245 dbh = udf_tgetblk(inode->i_sb, newblock); 245 dbh = udf_tgetblk(inode->i_sb, newblock);
@@ -257,14 +257,14 @@ struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block,
257 dfibh.soffset = dfibh.eoffset = 0; 257 dfibh.soffset = dfibh.eoffset = 0;
258 dfibh.sbh = dfibh.ebh = dbh; 258 dfibh.sbh = dfibh.ebh = dbh;
259 while ((f_pos < size)) { 259 while ((f_pos < size)) {
260 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_IN_ICB; 260 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
261 sfi = udf_fileident_read(inode, &f_pos, &sfibh, &cfi, NULL, 261 sfi = udf_fileident_read(inode, &f_pos, &sfibh, &cfi, NULL,
262 NULL, NULL, NULL); 262 NULL, NULL, NULL);
263 if (!sfi) { 263 if (!sfi) {
264 brelse(dbh); 264 brelse(dbh);
265 return NULL; 265 return NULL;
266 } 266 }
267 UDF_I_ALLOCTYPE(inode) = alloctype; 267 UDF_I(inode)->i_alloc_type = alloctype;
268 sfi->descTag.tagLocation = cpu_to_le32(*block); 268 sfi->descTag.tagLocation = cpu_to_le32(*block);
269 dfibh.soffset = dfibh.eoffset; 269 dfibh.soffset = dfibh.eoffset;
270 dfibh.eoffset += (sfibh.eoffset - sfibh.soffset); 270 dfibh.eoffset += (sfibh.eoffset - sfibh.soffset);
@@ -272,23 +272,23 @@ struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block,
272 if (udf_write_fi(inode, sfi, dfi, &dfibh, sfi->impUse, 272 if (udf_write_fi(inode, sfi, dfi, &dfibh, sfi->impUse,
273 sfi->fileIdent + 273 sfi->fileIdent +
274 le16_to_cpu(sfi->lengthOfImpUse))) { 274 le16_to_cpu(sfi->lengthOfImpUse))) {
275 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_IN_ICB; 275 UDF_I(inode)->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
276 brelse(dbh); 276 brelse(dbh);
277 return NULL; 277 return NULL;
278 } 278 }
279 } 279 }
280 mark_buffer_dirty_inode(dbh, inode); 280 mark_buffer_dirty_inode(dbh, inode);
281 281
282 memset(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), 0, 282 memset(UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr, 0,
283 UDF_I_LENALLOC(inode)); 283 UDF_I(inode)->i_lenAlloc);
284 UDF_I_LENALLOC(inode) = 0; 284 UDF_I(inode)->i_lenAlloc = 0;
285 eloc.logicalBlockNum = *block; 285 eloc.logicalBlockNum = *block;
286 eloc.partitionReferenceNum = 286 eloc.partitionReferenceNum =
287 UDF_I_LOCATION(inode).partitionReferenceNum; 287 UDF_I(inode)->i_location.partitionReferenceNum;
288 elen = inode->i_size; 288 elen = inode->i_size;
289 UDF_I_LENEXTENTS(inode) = elen; 289 UDF_I(inode)->i_lenExtents = elen;
290 epos.bh = NULL; 290 epos.bh = NULL;
291 epos.block = UDF_I_LOCATION(inode); 291 epos.block = UDF_I(inode)->i_location;
292 epos.offset = udf_file_entry_alloc_offset(inode); 292 epos.offset = udf_file_entry_alloc_offset(inode);
293 udf_add_aext(inode, &epos, eloc, elen, 0); 293 udf_add_aext(inode, &epos, eloc, elen, 0);
294 /* UniqueID stuff */ 294 /* UniqueID stuff */
@@ -321,9 +321,9 @@ static int udf_get_block(struct inode *inode, sector_t block,
321 if (block < 0) 321 if (block < 0)
322 goto abort_negative; 322 goto abort_negative;
323 323
324 if (block == UDF_I_NEXT_ALLOC_BLOCK(inode) + 1) { 324 if (block == UDF_I(inode)->i_next_alloc_block + 1) {
325 UDF_I_NEXT_ALLOC_BLOCK(inode)++; 325 UDF_I(inode)->i_next_alloc_block++;
326 UDF_I_NEXT_ALLOC_GOAL(inode)++; 326 UDF_I(inode)->i_next_alloc_goal++;
327 } 327 }
328 328
329 err = 0; 329 err = 0;
@@ -392,8 +392,8 @@ int udf_extend_file(struct inode *inode, struct extent_position *last_pos,
392 (last_ext->extLength & UDF_EXTENT_FLAG_MASK) | 392 (last_ext->extLength & UDF_EXTENT_FLAG_MASK) |
393 (((last_ext->extLength & UDF_EXTENT_LENGTH_MASK) + 393 (((last_ext->extLength & UDF_EXTENT_LENGTH_MASK) +
394 sb->s_blocksize - 1) & ~(sb->s_blocksize - 1)); 394 sb->s_blocksize - 1) & ~(sb->s_blocksize - 1));
395 UDF_I_LENEXTENTS(inode) = 395 UDF_I(inode)->i_lenExtents =
396 (UDF_I_LENEXTENTS(inode) + sb->s_blocksize - 1) & 396 (UDF_I(inode)->i_lenExtents + sb->s_blocksize - 1) &
397 ~(sb->s_blocksize - 1); 397 ~(sb->s_blocksize - 1);
398 } 398 }
399 399
@@ -470,9 +470,9 @@ out:
470 } 470 }
471 471
472 /* last_pos should point to the last written extent... */ 472 /* last_pos should point to the last written extent... */
473 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 473 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
474 last_pos->offset -= sizeof(short_ad); 474 last_pos->offset -= sizeof(short_ad);
475 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 475 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
476 last_pos->offset -= sizeof(long_ad); 476 last_pos->offset -= sizeof(long_ad);
477 else 477 else
478 return -1; 478 return -1;
@@ -495,11 +495,11 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
495 uint32_t newblocknum, newblock; 495 uint32_t newblocknum, newblock;
496 sector_t offset = 0; 496 sector_t offset = 0;
497 int8_t etype; 497 int8_t etype;
498 int goal = 0, pgoal = UDF_I_LOCATION(inode).logicalBlockNum; 498 int goal = 0, pgoal = UDF_I(inode)->i_location.logicalBlockNum;
499 int lastblock = 0; 499 int lastblock = 0;
500 500
501 prev_epos.offset = udf_file_entry_alloc_offset(inode); 501 prev_epos.offset = udf_file_entry_alloc_offset(inode);
502 prev_epos.block = UDF_I_LOCATION(inode); 502 prev_epos.block = UDF_I(inode)->i_location;
503 prev_epos.bh = NULL; 503 prev_epos.bh = NULL;
504 cur_epos = next_epos = prev_epos; 504 cur_epos = next_epos = prev_epos;
505 b_off = (loff_t)block << inode->i_sb->s_blocksize_bits; 505 b_off = (loff_t)block << inode->i_sb->s_blocksize_bits;
@@ -649,23 +649,24 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
649 if ((laarr[c].extLength >> 30) == (EXT_NOT_RECORDED_ALLOCATED >> 30)) 649 if ((laarr[c].extLength >> 30) == (EXT_NOT_RECORDED_ALLOCATED >> 30))
650 newblocknum = laarr[c].extLocation.logicalBlockNum + offset; 650 newblocknum = laarr[c].extLocation.logicalBlockNum + offset;
651 else { /* otherwise, allocate a new block */ 651 else { /* otherwise, allocate a new block */
652 if (UDF_I_NEXT_ALLOC_BLOCK(inode) == block) 652 if (UDF_I(inode)->i_next_alloc_block == block)
653 goal = UDF_I_NEXT_ALLOC_GOAL(inode); 653 goal = UDF_I(inode)->i_next_alloc_goal;
654 654
655 if (!goal) { 655 if (!goal) {
656 if (!(goal = pgoal)) /* XXX: what was intended here? */ 656 if (!(goal = pgoal)) /* XXX: what was intended here? */
657 goal = UDF_I_LOCATION(inode).logicalBlockNum+1; 657 goal = UDF_I(inode)->
658 i_location.logicalBlockNum + 1;
658 } 659 }
659 660
660 newblocknum = udf_new_block(inode->i_sb, inode, 661 newblocknum = udf_new_block(inode->i_sb, inode,
661 UDF_I_LOCATION(inode).partitionReferenceNum, 662 UDF_I(inode)->i_location.partitionReferenceNum,
662 goal, err); 663 goal, err);
663 if (!newblocknum) { 664 if (!newblocknum) {
664 brelse(prev_epos.bh); 665 brelse(prev_epos.bh);
665 *err = -ENOSPC; 666 *err = -ENOSPC;
666 return NULL; 667 return NULL;
667 } 668 }
668 UDF_I_LENEXTENTS(inode) += inode->i_sb->s_blocksize; 669 UDF_I(inode)->i_lenExtents += inode->i_sb->s_blocksize;
669 } 670 }
670 671
671 /* if the extent the requsted block is located in contains multiple 672 /* if the extent the requsted block is located in contains multiple
@@ -690,14 +691,14 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
690 brelse(prev_epos.bh); 691 brelse(prev_epos.bh);
691 692
692 newblock = udf_get_pblock(inode->i_sb, newblocknum, 693 newblock = udf_get_pblock(inode->i_sb, newblocknum,
693 UDF_I_LOCATION(inode).partitionReferenceNum, 0); 694 UDF_I(inode)->i_location.partitionReferenceNum, 0);
694 if (!newblock) 695 if (!newblock)
695 return NULL; 696 return NULL;
696 *phys = newblock; 697 *phys = newblock;
697 *err = 0; 698 *err = 0;
698 *new = 1; 699 *new = 1;
699 UDF_I_NEXT_ALLOC_BLOCK(inode) = block; 700 UDF_I(inode)->i_next_alloc_block = block;
700 UDF_I_NEXT_ALLOC_GOAL(inode) = newblocknum; 701 UDF_I(inode)->i_next_alloc_goal = newblocknum;
701 inode->i_ctime = current_fs_time(inode->i_sb); 702 inode->i_ctime = current_fs_time(inode->i_sb);
702 703
703 if (IS_SYNC(inode)) 704 if (IS_SYNC(inode))
@@ -756,7 +757,7 @@ static void udf_split_extents(struct inode *inode, int *c, int offset,
756 laarr[curr].extLocation.logicalBlockNum = newblocknum; 757 laarr[curr].extLocation.logicalBlockNum = newblocknum;
757 if (etype == (EXT_NOT_RECORDED_NOT_ALLOCATED >> 30)) 758 if (etype == (EXT_NOT_RECORDED_NOT_ALLOCATED >> 30))
758 laarr[curr].extLocation.partitionReferenceNum = 759 laarr[curr].extLocation.partitionReferenceNum =
759 UDF_I_LOCATION(inode).partitionReferenceNum; 760 UDF_I(inode)->i_location.partitionReferenceNum;
760 laarr[curr].extLength = EXT_RECORDED_ALLOCATED | 761 laarr[curr].extLength = EXT_RECORDED_ALLOCATED |
761 blocksize; 762 blocksize;
762 curr++; 763 curr++;
@@ -863,7 +864,7 @@ static void udf_prealloc_extents(struct inode *inode, int c, int lastblock,
863 (*endnum)--; 864 (*endnum)--;
864 } 865 }
865 } 866 }
866 UDF_I_LENEXTENTS(inode) += 867 UDF_I(inode)->i_lenExtents +=
867 numalloc << inode->i_sb->s_blocksize_bits; 868 numalloc << inode->i_sb->s_blocksize_bits;
868 } 869 }
869 } 870 }
@@ -1034,23 +1035,25 @@ void udf_truncate(struct inode *inode)
1034 return; 1035 return;
1035 1036
1036 lock_kernel(); 1037 lock_kernel();
1037 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) { 1038 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
1038 if (inode->i_sb->s_blocksize < 1039 if (inode->i_sb->s_blocksize <
1039 (udf_file_entry_alloc_offset(inode) + 1040 (udf_file_entry_alloc_offset(inode) +
1040 inode->i_size)) { 1041 inode->i_size)) {
1041 udf_expand_file_adinicb(inode, inode->i_size, &err); 1042 udf_expand_file_adinicb(inode, inode->i_size, &err);
1042 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) { 1043 if (UDF_I(inode)->i_alloc_type ==
1043 inode->i_size = UDF_I_LENALLOC(inode); 1044 ICBTAG_FLAG_AD_IN_ICB) {
1045 inode->i_size = UDF_I(inode)->i_lenAlloc;
1044 unlock_kernel(); 1046 unlock_kernel();
1045 return; 1047 return;
1046 } else 1048 } else
1047 udf_truncate_extents(inode); 1049 udf_truncate_extents(inode);
1048 } else { 1050 } else {
1049 offset = inode->i_size & (inode->i_sb->s_blocksize - 1); 1051 offset = inode->i_size & (inode->i_sb->s_blocksize - 1);
1050 memset(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode) + 1052 memset(UDF_I(inode)->i_ext.i_data +
1051 offset, 0x00, inode->i_sb->s_blocksize - 1053 UDF_I(inode)->i_lenEAttr + offset,
1054 0x00, inode->i_sb->s_blocksize -
1052 offset - udf_file_entry_alloc_offset(inode)); 1055 offset - udf_file_entry_alloc_offset(inode));
1053 UDF_I_LENALLOC(inode) = inode->i_size; 1056 UDF_I(inode)->i_lenAlloc = inode->i_size;
1054 } 1057 }
1055 } else { 1058 } else {
1056 block_truncate_page(inode->i_mapping, inode->i_size, 1059 block_truncate_page(inode->i_mapping, inode->i_size,
@@ -1084,7 +1087,7 @@ static void __udf_read_inode(struct inode *inode)
1084 * i_nlink = 1 1087 * i_nlink = 1
1085 * i_op = NULL; 1088 * i_op = NULL;
1086 */ 1089 */
1087 bh = udf_read_ptagged(inode->i_sb, UDF_I_LOCATION(inode), 0, &ident); 1090 bh = udf_read_ptagged(inode->i_sb, UDF_I(inode)->i_location, 0, &ident);
1088 if (!bh) { 1091 if (!bh) {
1089 printk(KERN_ERR "udf: udf_read_inode(ino %ld) failed !bh\n", 1092 printk(KERN_ERR "udf: udf_read_inode(ino %ld) failed !bh\n",
1090 inode->i_ino); 1093 inode->i_ino);
@@ -1107,7 +1110,7 @@ static void __udf_read_inode(struct inode *inode)
1107 struct buffer_head *ibh = NULL, *nbh = NULL; 1110 struct buffer_head *ibh = NULL, *nbh = NULL;
1108 struct indirectEntry *ie; 1111 struct indirectEntry *ie;
1109 1112
1110 ibh = udf_read_ptagged(inode->i_sb, UDF_I_LOCATION(inode), 1, 1113 ibh = udf_read_ptagged(inode->i_sb, UDF_I(inode)->i_location, 1,
1111 &ident); 1114 &ident);
1112 if (ident == TAG_IDENT_IE) { 1115 if (ident == TAG_IDENT_IE) {
1113 if (ibh) { 1116 if (ibh) {
@@ -1121,7 +1124,7 @@ static void __udf_read_inode(struct inode *inode)
1121 &ident))) { 1124 &ident))) {
1122 if (ident == TAG_IDENT_FE || 1125 if (ident == TAG_IDENT_FE ||
1123 ident == TAG_IDENT_EFE) { 1126 ident == TAG_IDENT_EFE) {
1124 memcpy(&UDF_I_LOCATION(inode), 1127 memcpy(&UDF_I(inode)->i_location,
1125 &loc, 1128 &loc,
1126 sizeof(kernel_lb_addr)); 1129 sizeof(kernel_lb_addr));
1127 brelse(bh); 1130 brelse(bh);
@@ -1165,44 +1168,45 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1165 efe = (struct extendedFileEntry *)bh->b_data; 1168 efe = (struct extendedFileEntry *)bh->b_data;
1166 1169
1167 if (fe->icbTag.strategyType == cpu_to_le16(4)) 1170 if (fe->icbTag.strategyType == cpu_to_le16(4))
1168 UDF_I_STRAT4096(inode) = 0; 1171 UDF_I(inode)->i_strat4096 = 0;
1169 else /* if (fe->icbTag.strategyType == cpu_to_le16(4096)) */ 1172 else /* if (fe->icbTag.strategyType == cpu_to_le16(4096)) */
1170 UDF_I_STRAT4096(inode) = 1; 1173 UDF_I(inode)->i_strat4096 = 1;
1171 1174
1172 UDF_I_ALLOCTYPE(inode) = le16_to_cpu(fe->icbTag.flags) & 1175 UDF_I(inode)->i_alloc_type = le16_to_cpu(fe->icbTag.flags) &
1173 ICBTAG_FLAG_AD_MASK; 1176 ICBTAG_FLAG_AD_MASK;
1174 UDF_I_UNIQUE(inode) = 0; 1177 UDF_I(inode)->i_unique = 0;
1175 UDF_I_LENEATTR(inode) = 0; 1178 UDF_I(inode)->i_lenEAttr = 0;
1176 UDF_I_LENEXTENTS(inode) = 0; 1179 UDF_I(inode)->i_lenExtents = 0;
1177 UDF_I_LENALLOC(inode) = 0; 1180 UDF_I(inode)->i_lenAlloc = 0;
1178 UDF_I_NEXT_ALLOC_BLOCK(inode) = 0; 1181 UDF_I(inode)->i_next_alloc_block = 0;
1179 UDF_I_NEXT_ALLOC_GOAL(inode) = 0; 1182 UDF_I(inode)->i_next_alloc_goal = 0;
1180 if (fe->descTag.tagIdent == cpu_to_le16(TAG_IDENT_EFE)) { 1183 if (fe->descTag.tagIdent == cpu_to_le16(TAG_IDENT_EFE)) {
1181 UDF_I_EFE(inode) = 1; 1184 UDF_I(inode)->i_efe = 1;
1182 UDF_I_USE(inode) = 0; 1185 UDF_I(inode)->i_use = 0;
1183 if (udf_alloc_i_data(inode, inode->i_sb->s_blocksize - 1186 if (udf_alloc_i_data(inode, inode->i_sb->s_blocksize -
1184 sizeof(struct extendedFileEntry))) { 1187 sizeof(struct extendedFileEntry))) {
1185 make_bad_inode(inode); 1188 make_bad_inode(inode);
1186 return; 1189 return;
1187 } 1190 }
1188 memcpy(UDF_I_DATA(inode), 1191 memcpy(UDF_I(inode)->i_ext.i_data,
1189 bh->b_data + sizeof(struct extendedFileEntry), 1192 bh->b_data + sizeof(struct extendedFileEntry),
1190 inode->i_sb->s_blocksize - 1193 inode->i_sb->s_blocksize -
1191 sizeof(struct extendedFileEntry)); 1194 sizeof(struct extendedFileEntry));
1192 } else if (fe->descTag.tagIdent == cpu_to_le16(TAG_IDENT_FE)) { 1195 } else if (fe->descTag.tagIdent == cpu_to_le16(TAG_IDENT_FE)) {
1193 UDF_I_EFE(inode) = 0; 1196 UDF_I(inode)->i_efe = 0;
1194 UDF_I_USE(inode) = 0; 1197 UDF_I(inode)->i_use = 0;
1195 if (udf_alloc_i_data(inode, inode->i_sb->s_blocksize - 1198 if (udf_alloc_i_data(inode, inode->i_sb->s_blocksize -
1196 sizeof(struct fileEntry))) { 1199 sizeof(struct fileEntry))) {
1197 make_bad_inode(inode); 1200 make_bad_inode(inode);
1198 return; 1201 return;
1199 } 1202 }
1200 memcpy(UDF_I_DATA(inode), bh->b_data + sizeof(struct fileEntry), 1203 memcpy(UDF_I(inode)->i_ext.i_data,
1204 bh->b_data + sizeof(struct fileEntry),
1201 inode->i_sb->s_blocksize - sizeof(struct fileEntry)); 1205 inode->i_sb->s_blocksize - sizeof(struct fileEntry));
1202 } else if (fe->descTag.tagIdent == cpu_to_le16(TAG_IDENT_USE)) { 1206 } else if (fe->descTag.tagIdent == cpu_to_le16(TAG_IDENT_USE)) {
1203 UDF_I_EFE(inode) = 0; 1207 UDF_I(inode)->i_efe = 0;
1204 UDF_I_USE(inode) = 1; 1208 UDF_I(inode)->i_use = 1;
1205 UDF_I_LENALLOC(inode) = le32_to_cpu( 1209 UDF_I(inode)->i_lenAlloc = le32_to_cpu(
1206 ((struct unallocSpaceEntry *)bh->b_data)-> 1210 ((struct unallocSpaceEntry *)bh->b_data)->
1207 lengthAllocDescs); 1211 lengthAllocDescs);
1208 if (udf_alloc_i_data(inode, inode->i_sb->s_blocksize - 1212 if (udf_alloc_i_data(inode, inode->i_sb->s_blocksize -
@@ -1210,7 +1214,7 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1210 make_bad_inode(inode); 1214 make_bad_inode(inode);
1211 return; 1215 return;
1212 } 1216 }
1213 memcpy(UDF_I_DATA(inode), 1217 memcpy(UDF_I(inode)->i_ext.i_data,
1214 bh->b_data + sizeof(struct unallocSpaceEntry), 1218 bh->b_data + sizeof(struct unallocSpaceEntry),
1215 inode->i_sb->s_blocksize - 1219 inode->i_sb->s_blocksize -
1216 sizeof(struct unallocSpaceEntry)); 1220 sizeof(struct unallocSpaceEntry));
@@ -1234,12 +1238,12 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1234 inode->i_nlink = 1; 1238 inode->i_nlink = 1;
1235 1239
1236 inode->i_size = le64_to_cpu(fe->informationLength); 1240 inode->i_size = le64_to_cpu(fe->informationLength);
1237 UDF_I_LENEXTENTS(inode) = inode->i_size; 1241 UDF_I(inode)->i_lenExtents = inode->i_size;
1238 1242
1239 inode->i_mode = udf_convert_permissions(fe); 1243 inode->i_mode = udf_convert_permissions(fe);
1240 inode->i_mode &= ~UDF_SB(inode->i_sb)->s_umask; 1244 inode->i_mode &= ~UDF_SB(inode->i_sb)->s_umask;
1241 1245
1242 if (UDF_I_EFE(inode) == 0) { 1246 if (UDF_I(inode)->i_efe == 0) {
1243 inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << 1247 inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) <<
1244 (inode->i_sb->s_blocksize_bits - 9); 1248 (inode->i_sb->s_blocksize_bits - 9);
1245 1249
@@ -1267,10 +1271,10 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1267 inode->i_ctime = sbi->s_record_time; 1271 inode->i_ctime = sbi->s_record_time;
1268 } 1272 }
1269 1273
1270 UDF_I_UNIQUE(inode) = le64_to_cpu(fe->uniqueID); 1274 UDF_I(inode)->i_unique = le64_to_cpu(fe->uniqueID);
1271 UDF_I_LENEATTR(inode) = le32_to_cpu(fe->lengthExtendedAttr); 1275 UDF_I(inode)->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr);
1272 UDF_I_LENALLOC(inode) = le32_to_cpu(fe->lengthAllocDescs); 1276 UDF_I(inode)->i_lenAlloc = le32_to_cpu(fe->lengthAllocDescs);
1273 offset = sizeof(struct fileEntry) + UDF_I_LENEATTR(inode); 1277 offset = sizeof(struct fileEntry) + UDF_I(inode)->i_lenEAttr;
1274 } else { 1278 } else {
1275 inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << 1279 inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) <<
1276 (inode->i_sb->s_blocksize_bits - 9); 1280 (inode->i_sb->s_blocksize_bits - 9);
@@ -1293,10 +1297,10 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1293 1297
1294 if (udf_stamp_to_time(&convtime, &convtime_usec, 1298 if (udf_stamp_to_time(&convtime, &convtime_usec,
1295 lets_to_cpu(efe->createTime))) { 1299 lets_to_cpu(efe->createTime))) {
1296 UDF_I_CRTIME(inode).tv_sec = convtime; 1300 UDF_I(inode)->i_crtime.tv_sec = convtime;
1297 UDF_I_CRTIME(inode).tv_nsec = convtime_usec * 1000; 1301 UDF_I(inode)->i_crtime.tv_nsec = convtime_usec * 1000;
1298 } else { 1302 } else {
1299 UDF_I_CRTIME(inode) = sbi->s_record_time; 1303 UDF_I(inode)->i_crtime = sbi->s_record_time;
1300 } 1304 }
1301 1305
1302 if (udf_stamp_to_time(&convtime, &convtime_usec, 1306 if (udf_stamp_to_time(&convtime, &convtime_usec,
@@ -1307,11 +1311,11 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1307 inode->i_ctime = sbi->s_record_time; 1311 inode->i_ctime = sbi->s_record_time;
1308 } 1312 }
1309 1313
1310 UDF_I_UNIQUE(inode) = le64_to_cpu(efe->uniqueID); 1314 UDF_I(inode)->i_unique = le64_to_cpu(efe->uniqueID);
1311 UDF_I_LENEATTR(inode) = le32_to_cpu(efe->lengthExtendedAttr); 1315 UDF_I(inode)->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr);
1312 UDF_I_LENALLOC(inode) = le32_to_cpu(efe->lengthAllocDescs); 1316 UDF_I(inode)->i_lenAlloc = le32_to_cpu(efe->lengthAllocDescs);
1313 offset = sizeof(struct extendedFileEntry) + 1317 offset = sizeof(struct extendedFileEntry) +
1314 UDF_I_LENEATTR(inode); 1318 UDF_I(inode)->i_lenEAttr;
1315 } 1319 }
1316 1320
1317 switch (fe->icbTag.fileType) { 1321 switch (fe->icbTag.fileType) {
@@ -1324,7 +1328,7 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1324 case ICBTAG_FILE_TYPE_REALTIME: 1328 case ICBTAG_FILE_TYPE_REALTIME:
1325 case ICBTAG_FILE_TYPE_REGULAR: 1329 case ICBTAG_FILE_TYPE_REGULAR:
1326 case ICBTAG_FILE_TYPE_UNDEF: 1330 case ICBTAG_FILE_TYPE_UNDEF:
1327 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) 1331 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
1328 inode->i_data.a_ops = &udf_adinicb_aops; 1332 inode->i_data.a_ops = &udf_adinicb_aops;
1329 else 1333 else
1330 inode->i_data.a_ops = &udf_aops; 1334 inode->i_data.a_ops = &udf_aops;
@@ -1371,9 +1375,9 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
1371 1375
1372static int udf_alloc_i_data(struct inode *inode, size_t size) 1376static int udf_alloc_i_data(struct inode *inode, size_t size)
1373{ 1377{
1374 UDF_I_DATA(inode) = kmalloc(size, GFP_KERNEL); 1378 UDF_I(inode)->i_ext.i_data = kmalloc(size, GFP_KERNEL);
1375 1379
1376 if (!UDF_I_DATA(inode)) { 1380 if (!UDF_I(inode)->i_ext.i_data) {
1377 printk(KERN_ERR "udf:udf_alloc_i_data (ino %ld) " 1381 printk(KERN_ERR "udf:udf_alloc_i_data (ino %ld) "
1378 "no free memory\n", inode->i_ino); 1382 "no free memory\n", inode->i_ino);
1379 return -ENOMEM; 1383 return -ENOMEM;
@@ -1447,7 +1451,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1447 1451
1448 bh = udf_tread(inode->i_sb, 1452 bh = udf_tread(inode->i_sb,
1449 udf_get_lb_pblock(inode->i_sb, 1453 udf_get_lb_pblock(inode->i_sb,
1450 UDF_I_LOCATION(inode), 0)); 1454 UDF_I(inode)->i_location, 0));
1451 if (!bh) { 1455 if (!bh) {
1452 udf_debug("bread failure\n"); 1456 udf_debug("bread failure\n");
1453 return -EIO; 1457 return -EIO;
@@ -1462,14 +1466,14 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1462 struct unallocSpaceEntry *use = 1466 struct unallocSpaceEntry *use =
1463 (struct unallocSpaceEntry *)bh->b_data; 1467 (struct unallocSpaceEntry *)bh->b_data;
1464 1468
1465 use->lengthAllocDescs = cpu_to_le32(UDF_I_LENALLOC(inode)); 1469 use->lengthAllocDescs = cpu_to_le32(UDF_I(inode)->i_lenAlloc);
1466 memcpy(bh->b_data + sizeof(struct unallocSpaceEntry), 1470 memcpy(bh->b_data + sizeof(struct unallocSpaceEntry),
1467 UDF_I_DATA(inode), inode->i_sb->s_blocksize - 1471 UDF_I(inode)->i_ext.i_data, inode->i_sb->s_blocksize -
1468 sizeof(struct unallocSpaceEntry)); 1472 sizeof(struct unallocSpaceEntry));
1469 crclen = sizeof(struct unallocSpaceEntry) + 1473 crclen = sizeof(struct unallocSpaceEntry) +
1470 UDF_I_LENALLOC(inode) - sizeof(tag); 1474 UDF_I(inode)->i_lenAlloc - sizeof(tag);
1471 use->descTag.tagLocation = cpu_to_le32( 1475 use->descTag.tagLocation = cpu_to_le32(
1472 UDF_I_LOCATION(inode). 1476 UDF_I(inode)->i_location.
1473 logicalBlockNum); 1477 logicalBlockNum);
1474 use->descTag.descCRCLength = cpu_to_le16(crclen); 1478 use->descTag.descCRCLength = cpu_to_le16(crclen);
1475 use->descTag.descCRC = cpu_to_le16(udf_crc((char *)use + 1479 use->descTag.descCRC = cpu_to_le16(udf_crc((char *)use +
@@ -1534,8 +1538,9 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1534 dsea->minorDeviceIdent = cpu_to_le32(iminor(inode)); 1538 dsea->minorDeviceIdent = cpu_to_le32(iminor(inode));
1535 } 1539 }
1536 1540
1537 if (UDF_I_EFE(inode) == 0) { 1541 if (UDF_I(inode)->i_efe == 0) {
1538 memcpy(bh->b_data + sizeof(struct fileEntry), UDF_I_DATA(inode), 1542 memcpy(bh->b_data + sizeof(struct fileEntry),
1543 UDF_I(inode)->i_ext.i_data,
1539 inode->i_sb->s_blocksize - sizeof(struct fileEntry)); 1544 inode->i_sb->s_blocksize - sizeof(struct fileEntry));
1540 fe->logicalBlocksRecorded = cpu_to_le64( 1545 fe->logicalBlocksRecorded = cpu_to_le64(
1541 (inode->i_blocks + (1 << (blocksize_bits - 9)) - 1) >> 1546 (inode->i_blocks + (1 << (blocksize_bits - 9)) - 1) >>
@@ -1551,14 +1556,14 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1551 strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); 1556 strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER);
1552 fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; 1557 fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
1553 fe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; 1558 fe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
1554 fe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode)); 1559 fe->uniqueID = cpu_to_le64(UDF_I(inode)->i_unique);
1555 fe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(inode)); 1560 fe->lengthExtendedAttr = cpu_to_le32(UDF_I(inode)->i_lenEAttr);
1556 fe->lengthAllocDescs = cpu_to_le32(UDF_I_LENALLOC(inode)); 1561 fe->lengthAllocDescs = cpu_to_le32(UDF_I(inode)->i_lenAlloc);
1557 fe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_FE); 1562 fe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_FE);
1558 crclen = sizeof(struct fileEntry); 1563 crclen = sizeof(struct fileEntry);
1559 } else { 1564 } else {
1560 memcpy(bh->b_data + sizeof(struct extendedFileEntry), 1565 memcpy(bh->b_data + sizeof(struct extendedFileEntry),
1561 UDF_I_DATA(inode), 1566 UDF_I(inode)->i_ext.i_data,
1562 inode->i_sb->s_blocksize - 1567 inode->i_sb->s_blocksize -
1563 sizeof(struct extendedFileEntry)); 1568 sizeof(struct extendedFileEntry));
1564 efe->objectSize = cpu_to_le64(inode->i_size); 1569 efe->objectSize = cpu_to_le64(inode->i_size);
@@ -1566,26 +1571,26 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1566 (inode->i_blocks + (1 << (blocksize_bits - 9)) - 1) >> 1571 (inode->i_blocks + (1 << (blocksize_bits - 9)) - 1) >>
1567 (blocksize_bits - 9)); 1572 (blocksize_bits - 9));
1568 1573
1569 if (UDF_I_CRTIME(inode).tv_sec > inode->i_atime.tv_sec || 1574 if (UDF_I(inode)->i_crtime.tv_sec > inode->i_atime.tv_sec ||
1570 (UDF_I_CRTIME(inode).tv_sec == inode->i_atime.tv_sec && 1575 (UDF_I(inode)->i_crtime.tv_sec == inode->i_atime.tv_sec &&
1571 UDF_I_CRTIME(inode).tv_nsec > inode->i_atime.tv_nsec)) 1576 UDF_I(inode)->i_crtime.tv_nsec > inode->i_atime.tv_nsec))
1572 UDF_I_CRTIME(inode) = inode->i_atime; 1577 UDF_I(inode)->i_crtime = inode->i_atime;
1573 1578
1574 if (UDF_I_CRTIME(inode).tv_sec > inode->i_mtime.tv_sec || 1579 if (UDF_I(inode)->i_crtime.tv_sec > inode->i_mtime.tv_sec ||
1575 (UDF_I_CRTIME(inode).tv_sec == inode->i_mtime.tv_sec && 1580 (UDF_I(inode)->i_crtime.tv_sec == inode->i_mtime.tv_sec &&
1576 UDF_I_CRTIME(inode).tv_nsec > inode->i_mtime.tv_nsec)) 1581 UDF_I(inode)->i_crtime.tv_nsec > inode->i_mtime.tv_nsec))
1577 UDF_I_CRTIME(inode) = inode->i_mtime; 1582 UDF_I(inode)->i_crtime = inode->i_mtime;
1578 1583
1579 if (UDF_I_CRTIME(inode).tv_sec > inode->i_ctime.tv_sec || 1584 if (UDF_I(inode)->i_crtime.tv_sec > inode->i_ctime.tv_sec ||
1580 (UDF_I_CRTIME(inode).tv_sec == inode->i_ctime.tv_sec && 1585 (UDF_I(inode)->i_crtime.tv_sec == inode->i_ctime.tv_sec &&
1581 UDF_I_CRTIME(inode).tv_nsec > inode->i_ctime.tv_nsec)) 1586 UDF_I(inode)->i_crtime.tv_nsec > inode->i_ctime.tv_nsec))
1582 UDF_I_CRTIME(inode) = inode->i_ctime; 1587 UDF_I(inode)->i_crtime = inode->i_ctime;
1583 1588
1584 if (udf_time_to_stamp(&cpu_time, inode->i_atime)) 1589 if (udf_time_to_stamp(&cpu_time, inode->i_atime))
1585 efe->accessTime = cpu_to_lets(cpu_time); 1590 efe->accessTime = cpu_to_lets(cpu_time);
1586 if (udf_time_to_stamp(&cpu_time, inode->i_mtime)) 1591 if (udf_time_to_stamp(&cpu_time, inode->i_mtime))
1587 efe->modificationTime = cpu_to_lets(cpu_time); 1592 efe->modificationTime = cpu_to_lets(cpu_time);
1588 if (udf_time_to_stamp(&cpu_time, UDF_I_CRTIME(inode))) 1593 if (udf_time_to_stamp(&cpu_time, UDF_I(inode)->i_crtime))
1589 efe->createTime = cpu_to_lets(cpu_time); 1594 efe->createTime = cpu_to_lets(cpu_time);
1590 if (udf_time_to_stamp(&cpu_time, inode->i_ctime)) 1595 if (udf_time_to_stamp(&cpu_time, inode->i_ctime))
1591 efe->attrTime = cpu_to_lets(cpu_time); 1596 efe->attrTime = cpu_to_lets(cpu_time);
@@ -1594,13 +1599,13 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1594 strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); 1599 strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER);
1595 efe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; 1600 efe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
1596 efe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; 1601 efe->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
1597 efe->uniqueID = cpu_to_le64(UDF_I_UNIQUE(inode)); 1602 efe->uniqueID = cpu_to_le64(UDF_I(inode)->i_unique);
1598 efe->lengthExtendedAttr = cpu_to_le32(UDF_I_LENEATTR(inode)); 1603 efe->lengthExtendedAttr = cpu_to_le32(UDF_I(inode)->i_lenEAttr);
1599 efe->lengthAllocDescs = cpu_to_le32(UDF_I_LENALLOC(inode)); 1604 efe->lengthAllocDescs = cpu_to_le32(UDF_I(inode)->i_lenAlloc);
1600 efe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EFE); 1605 efe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EFE);
1601 crclen = sizeof(struct extendedFileEntry); 1606 crclen = sizeof(struct extendedFileEntry);
1602 } 1607 }
1603 if (UDF_I_STRAT4096(inode)) { 1608 if (UDF_I(inode)->i_strat4096) {
1604 fe->icbTag.strategyType = cpu_to_le16(4096); 1609 fe->icbTag.strategyType = cpu_to_le16(4096);
1605 fe->icbTag.strategyParameter = cpu_to_le16(1); 1610 fe->icbTag.strategyParameter = cpu_to_le16(1);
1606 fe->icbTag.numEntries = cpu_to_le16(2); 1611 fe->icbTag.numEntries = cpu_to_le16(2);
@@ -1624,7 +1629,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1624 else if (S_ISSOCK(inode->i_mode)) 1629 else if (S_ISSOCK(inode->i_mode))
1625 fe->icbTag.fileType = ICBTAG_FILE_TYPE_SOCKET; 1630 fe->icbTag.fileType = ICBTAG_FILE_TYPE_SOCKET;
1626 1631
1627 icbflags = UDF_I_ALLOCTYPE(inode) | 1632 icbflags = UDF_I(inode)->i_alloc_type |
1628 ((inode->i_mode & S_ISUID) ? ICBTAG_FLAG_SETUID : 0) | 1633 ((inode->i_mode & S_ISUID) ? ICBTAG_FLAG_SETUID : 0) |
1629 ((inode->i_mode & S_ISGID) ? ICBTAG_FLAG_SETGID : 0) | 1634 ((inode->i_mode & S_ISGID) ? ICBTAG_FLAG_SETGID : 0) |
1630 ((inode->i_mode & S_ISVTX) ? ICBTAG_FLAG_STICKY : 0) | 1635 ((inode->i_mode & S_ISVTX) ? ICBTAG_FLAG_STICKY : 0) |
@@ -1639,8 +1644,9 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1639 fe->descTag.descVersion = cpu_to_le16(2); 1644 fe->descTag.descVersion = cpu_to_le16(2);
1640 fe->descTag.tagSerialNum = cpu_to_le16(sbi->s_serial_number); 1645 fe->descTag.tagSerialNum = cpu_to_le16(sbi->s_serial_number);
1641 fe->descTag.tagLocation = cpu_to_le32( 1646 fe->descTag.tagLocation = cpu_to_le32(
1642 UDF_I_LOCATION(inode).logicalBlockNum); 1647 UDF_I(inode)->i_location.logicalBlockNum);
1643 crclen += UDF_I_LENEATTR(inode) + UDF_I_LENALLOC(inode) - sizeof(tag); 1648 crclen += UDF_I(inode)->i_lenEAttr + UDF_I(inode)->i_lenAlloc -
1649 sizeof(tag);
1644 fe->descTag.descCRCLength = cpu_to_le16(crclen); 1650 fe->descTag.descCRCLength = cpu_to_le16(crclen);
1645 fe->descTag.descCRC = cpu_to_le16(udf_crc((char *)fe + sizeof(tag), 1651 fe->descTag.descCRC = cpu_to_le16(udf_crc((char *)fe + sizeof(tag),
1646 crclen, 0)); 1652 crclen, 0));
@@ -1671,7 +1677,7 @@ struct inode *udf_iget(struct super_block *sb, kernel_lb_addr ino)
1671 return NULL; 1677 return NULL;
1672 1678
1673 if (inode->i_state & I_NEW) { 1679 if (inode->i_state & I_NEW) {
1674 memcpy(&UDF_I_LOCATION(inode), &ino, sizeof(kernel_lb_addr)); 1680 memcpy(&UDF_I(inode)->i_location, &ino, sizeof(kernel_lb_addr));
1675 __udf_read_inode(inode); 1681 __udf_read_inode(inode);
1676 unlock_new_inode(inode); 1682 unlock_new_inode(inode);
1677 } 1683 }
@@ -1705,15 +1711,15 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1705 uint8_t *ptr; 1711 uint8_t *ptr;
1706 1712
1707 if (!epos->bh) 1713 if (!epos->bh)
1708 ptr = UDF_I_DATA(inode) + epos->offset - 1714 ptr = UDF_I(inode)->i_ext.i_data + epos->offset -
1709 udf_file_entry_alloc_offset(inode) + 1715 udf_file_entry_alloc_offset(inode) +
1710 UDF_I_LENEATTR(inode); 1716 UDF_I(inode)->i_lenEAttr;
1711 else 1717 else
1712 ptr = epos->bh->b_data + epos->offset; 1718 ptr = epos->bh->b_data + epos->offset;
1713 1719
1714 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 1720 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
1715 adsize = sizeof(short_ad); 1721 adsize = sizeof(short_ad);
1716 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 1722 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
1717 adsize = sizeof(long_ad); 1723 adsize = sizeof(long_ad);
1718 else 1724 else
1719 return -1; 1725 return -1;
@@ -1763,7 +1769,7 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1763 cpu_to_le32(le32_to_cpu( 1769 cpu_to_le32(le32_to_cpu(
1764 aed->lengthAllocDescs) + adsize); 1770 aed->lengthAllocDescs) + adsize);
1765 } else { 1771 } else {
1766 UDF_I_LENALLOC(inode) += adsize; 1772 UDF_I(inode)->i_lenAlloc += adsize;
1767 mark_inode_dirty(inode); 1773 mark_inode_dirty(inode);
1768 } 1774 }
1769 } 1775 }
@@ -1773,7 +1779,7 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1773 else 1779 else
1774 udf_new_tag(nbh->b_data, TAG_IDENT_AED, 2, 1, 1780 udf_new_tag(nbh->b_data, TAG_IDENT_AED, 2, 1,
1775 epos->block.logicalBlockNum, sizeof(tag)); 1781 epos->block.logicalBlockNum, sizeof(tag));
1776 switch (UDF_I_ALLOCTYPE(inode)) { 1782 switch (UDF_I(inode)->i_alloc_type) {
1777 case ICBTAG_FLAG_AD_SHORT: 1783 case ICBTAG_FLAG_AD_SHORT:
1778 sad = (short_ad *)sptr; 1784 sad = (short_ad *)sptr;
1779 sad->extLength = cpu_to_le32(EXT_NEXT_EXTENT_ALLOCDECS | 1785 sad->extLength = cpu_to_le32(EXT_NEXT_EXTENT_ALLOCDECS |
@@ -1807,7 +1813,7 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1807 etype = udf_write_aext(inode, epos, eloc, elen, inc); 1813 etype = udf_write_aext(inode, epos, eloc, elen, inc);
1808 1814
1809 if (!epos->bh) { 1815 if (!epos->bh) {
1810 UDF_I_LENALLOC(inode) += adsize; 1816 UDF_I(inode)->i_lenAlloc += adsize;
1811 mark_inode_dirty(inode); 1817 mark_inode_dirty(inode);
1812 } else { 1818 } else {
1813 aed = (struct allocExtDesc *)epos->bh->b_data; 1819 aed = (struct allocExtDesc *)epos->bh->b_data;
@@ -1836,13 +1842,13 @@ int8_t udf_write_aext(struct inode *inode, struct extent_position *epos,
1836 long_ad *lad; 1842 long_ad *lad;
1837 1843
1838 if (!epos->bh) 1844 if (!epos->bh)
1839 ptr = UDF_I_DATA(inode) + epos->offset - 1845 ptr = UDF_I(inode)->i_ext.i_data + epos->offset -
1840 udf_file_entry_alloc_offset(inode) + 1846 udf_file_entry_alloc_offset(inode) +
1841 UDF_I_LENEATTR(inode); 1847 UDF_I(inode)->i_lenEAttr;
1842 else 1848 else
1843 ptr = epos->bh->b_data + epos->offset; 1849 ptr = epos->bh->b_data + epos->offset;
1844 1850
1845 switch (UDF_I_ALLOCTYPE(inode)) { 1851 switch (UDF_I(inode)->i_alloc_type) {
1846 case ICBTAG_FLAG_AD_SHORT: 1852 case ICBTAG_FLAG_AD_SHORT:
1847 sad = (short_ad *)ptr; 1853 sad = (short_ad *)ptr;
1848 sad->extLength = cpu_to_le32(elen); 1854 sad->extLength = cpu_to_le32(elen);
@@ -1914,11 +1920,11 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
1914 if (!epos->bh) { 1920 if (!epos->bh) {
1915 if (!epos->offset) 1921 if (!epos->offset)
1916 epos->offset = udf_file_entry_alloc_offset(inode); 1922 epos->offset = udf_file_entry_alloc_offset(inode);
1917 ptr = UDF_I_DATA(inode) + epos->offset - 1923 ptr = UDF_I(inode)->i_ext.i_data + epos->offset -
1918 udf_file_entry_alloc_offset(inode) + 1924 udf_file_entry_alloc_offset(inode) +
1919 UDF_I_LENEATTR(inode); 1925 UDF_I(inode)->i_lenEAttr;
1920 alen = udf_file_entry_alloc_offset(inode) + 1926 alen = udf_file_entry_alloc_offset(inode) +
1921 UDF_I_LENALLOC(inode); 1927 UDF_I(inode)->i_lenAlloc;
1922 } else { 1928 } else {
1923 if (!epos->offset) 1929 if (!epos->offset)
1924 epos->offset = sizeof(struct allocExtDesc); 1930 epos->offset = sizeof(struct allocExtDesc);
@@ -1928,7 +1934,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
1928 lengthAllocDescs); 1934 lengthAllocDescs);
1929 } 1935 }
1930 1936
1931 switch (UDF_I_ALLOCTYPE(inode)) { 1937 switch (UDF_I(inode)->i_alloc_type) {
1932 case ICBTAG_FLAG_AD_SHORT: 1938 case ICBTAG_FLAG_AD_SHORT:
1933 sad = udf_get_fileshortad(ptr, alen, &epos->offset, inc); 1939 sad = udf_get_fileshortad(ptr, alen, &epos->offset, inc);
1934 if (!sad) 1940 if (!sad)
@@ -1936,7 +1942,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
1936 etype = le32_to_cpu(sad->extLength) >> 30; 1942 etype = le32_to_cpu(sad->extLength) >> 30;
1937 eloc->logicalBlockNum = le32_to_cpu(sad->extPosition); 1943 eloc->logicalBlockNum = le32_to_cpu(sad->extPosition);
1938 eloc->partitionReferenceNum = 1944 eloc->partitionReferenceNum =
1939 UDF_I_LOCATION(inode).partitionReferenceNum; 1945 UDF_I(inode)->i_location.partitionReferenceNum;
1940 *elen = le32_to_cpu(sad->extLength) & UDF_EXTENT_LENGTH_MASK; 1946 *elen = le32_to_cpu(sad->extLength) & UDF_EXTENT_LENGTH_MASK;
1941 break; 1947 break;
1942 case ICBTAG_FLAG_AD_LONG: 1948 case ICBTAG_FLAG_AD_LONG:
@@ -1949,7 +1955,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos,
1949 break; 1955 break;
1950 default: 1956 default:
1951 udf_debug("alloc_type = %d unsupported\n", 1957 udf_debug("alloc_type = %d unsupported\n",
1952 UDF_I_ALLOCTYPE(inode)); 1958 UDF_I(inode)->i_alloc_type);
1953 return -1; 1959 return -1;
1954 } 1960 }
1955 1961
@@ -1990,9 +1996,9 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
1990 get_bh(epos.bh); 1996 get_bh(epos.bh);
1991 } 1997 }
1992 1998
1993 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 1999 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
1994 adsize = sizeof(short_ad); 2000 adsize = sizeof(short_ad);
1995 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 2001 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
1996 adsize = sizeof(long_ad); 2002 adsize = sizeof(long_ad);
1997 else 2003 else
1998 adsize = 0; 2004 adsize = 0;
@@ -2019,7 +2025,7 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
2019 udf_write_aext(inode, &oepos, eloc, elen, 1); 2025 udf_write_aext(inode, &oepos, eloc, elen, 1);
2020 udf_write_aext(inode, &oepos, eloc, elen, 1); 2026 udf_write_aext(inode, &oepos, eloc, elen, 1);
2021 if (!oepos.bh) { 2027 if (!oepos.bh) {
2022 UDF_I_LENALLOC(inode) -= (adsize * 2); 2028 UDF_I(inode)->i_lenAlloc -= (adsize * 2);
2023 mark_inode_dirty(inode); 2029 mark_inode_dirty(inode);
2024 } else { 2030 } else {
2025 aed = (struct allocExtDesc *)oepos.bh->b_data; 2031 aed = (struct allocExtDesc *)oepos.bh->b_data;
@@ -2038,7 +2044,7 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
2038 } else { 2044 } else {
2039 udf_write_aext(inode, &oepos, eloc, elen, 1); 2045 udf_write_aext(inode, &oepos, eloc, elen, 1);
2040 if (!oepos.bh) { 2046 if (!oepos.bh) {
2041 UDF_I_LENALLOC(inode) -= adsize; 2047 UDF_I(inode)->i_lenAlloc -= adsize;
2042 mark_inode_dirty(inode); 2048 mark_inode_dirty(inode);
2043 } else { 2049 } else {
2044 aed = (struct allocExtDesc *)oepos.bh->b_data; 2050 aed = (struct allocExtDesc *)oepos.bh->b_data;
@@ -2077,7 +2083,7 @@ int8_t inode_bmap(struct inode *inode, sector_t block,
2077 } 2083 }
2078 2084
2079 pos->offset = 0; 2085 pos->offset = 0;
2080 pos->block = UDF_I_LOCATION(inode); 2086 pos->block = UDF_I(inode)->i_location;
2081 pos->bh = NULL; 2087 pos->bh = NULL;
2082 *elen = 0; 2088 *elen = 0;
2083 2089
@@ -2085,7 +2091,7 @@ int8_t inode_bmap(struct inode *inode, sector_t block,
2085 etype = udf_next_aext(inode, pos, eloc, elen, 1); 2091 etype = udf_next_aext(inode, pos, eloc, elen, 1);
2086 if (etype == -1) { 2092 if (etype == -1) {
2087 *offset = (bcount - lbcount) >> blocksize_bits; 2093 *offset = (bcount - lbcount) >> blocksize_bits;
2088 UDF_I_LENEXTENTS(inode) = lbcount; 2094 UDF_I(inode)->i_lenExtents = lbcount;
2089 return -1; 2095 return -1;
2090 } 2096 }
2091 lbcount += *elen; 2097 lbcount += *elen;
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index a3a513faddb0..2af44702633b 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -52,16 +52,16 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
52 int offset; 52 int offset;
53 uint16_t crclen; 53 uint16_t crclen;
54 54
55 ea = UDF_I_DATA(inode); 55 ea = UDF_I(inode)->i_ext.i_data;
56 if (UDF_I_LENEATTR(inode)) { 56 if (UDF_I(inode)->i_lenEAttr) {
57 ad = UDF_I_DATA(inode) + UDF_I_LENEATTR(inode); 57 ad = UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr;
58 } else { 58 } else {
59 ad = ea; 59 ad = ea;
60 size += sizeof(struct extendedAttrHeaderDesc); 60 size += sizeof(struct extendedAttrHeaderDesc);
61 } 61 }
62 62
63 offset = inode->i_sb->s_blocksize - udf_file_entry_alloc_offset(inode) - 63 offset = inode->i_sb->s_blocksize - udf_file_entry_alloc_offset(inode) -
64 UDF_I_LENALLOC(inode); 64 UDF_I(inode)->i_lenAlloc;
65 65
66 /* TODO - Check for FreeEASpace */ 66 /* TODO - Check for FreeEASpace */
67 67
@@ -69,21 +69,21 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
69 struct extendedAttrHeaderDesc *eahd; 69 struct extendedAttrHeaderDesc *eahd;
70 eahd = (struct extendedAttrHeaderDesc *)ea; 70 eahd = (struct extendedAttrHeaderDesc *)ea;
71 71
72 if (UDF_I_LENALLOC(inode)) 72 if (UDF_I(inode)->i_lenAlloc)
73 memmove(&ad[size], ad, UDF_I_LENALLOC(inode)); 73 memmove(&ad[size], ad, UDF_I(inode)->i_lenAlloc);
74 74
75 if (UDF_I_LENEATTR(inode)) { 75 if (UDF_I(inode)->i_lenEAttr) {
76 /* check checksum/crc */ 76 /* check checksum/crc */
77 if (eahd->descTag.tagIdent != 77 if (eahd->descTag.tagIdent !=
78 cpu_to_le16(TAG_IDENT_EAHD) || 78 cpu_to_le16(TAG_IDENT_EAHD) ||
79 le32_to_cpu(eahd->descTag.tagLocation) != 79 le32_to_cpu(eahd->descTag.tagLocation) !=
80 UDF_I_LOCATION(inode).logicalBlockNum) 80 UDF_I(inode)->i_location.logicalBlockNum)
81 return NULL; 81 return NULL;
82 } else { 82 } else {
83 struct udf_sb_info *sbi = UDF_SB(inode->i_sb); 83 struct udf_sb_info *sbi = UDF_SB(inode->i_sb);
84 84
85 size -= sizeof(struct extendedAttrHeaderDesc); 85 size -= sizeof(struct extendedAttrHeaderDesc);
86 UDF_I_LENEATTR(inode) += 86 UDF_I(inode)->i_lenEAttr +=
87 sizeof(struct extendedAttrHeaderDesc); 87 sizeof(struct extendedAttrHeaderDesc);
88 eahd->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EAHD); 88 eahd->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EAHD);
89 if (sbi->s_udfrev >= 0x0200) 89 if (sbi->s_udfrev >= 0x0200)
@@ -93,15 +93,15 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
93 eahd->descTag.tagSerialNum = 93 eahd->descTag.tagSerialNum =
94 cpu_to_le16(sbi->s_serial_number); 94 cpu_to_le16(sbi->s_serial_number);
95 eahd->descTag.tagLocation = cpu_to_le32( 95 eahd->descTag.tagLocation = cpu_to_le32(
96 UDF_I_LOCATION(inode).logicalBlockNum); 96 UDF_I(inode)->i_location.logicalBlockNum);
97 eahd->impAttrLocation = cpu_to_le32(0xFFFFFFFF); 97 eahd->impAttrLocation = cpu_to_le32(0xFFFFFFFF);
98 eahd->appAttrLocation = cpu_to_le32(0xFFFFFFFF); 98 eahd->appAttrLocation = cpu_to_le32(0xFFFFFFFF);
99 } 99 }
100 100
101 offset = UDF_I_LENEATTR(inode); 101 offset = UDF_I(inode)->i_lenEAttr;
102 if (type < 2048) { 102 if (type < 2048) {
103 if (le32_to_cpu(eahd->appAttrLocation) < 103 if (le32_to_cpu(eahd->appAttrLocation) <
104 UDF_I_LENEATTR(inode)) { 104 UDF_I(inode)->i_lenEAttr) {
105 uint32_t aal = 105 uint32_t aal =
106 le32_to_cpu(eahd->appAttrLocation); 106 le32_to_cpu(eahd->appAttrLocation);
107 memmove(&ea[offset - aal + size], 107 memmove(&ea[offset - aal + size],
@@ -111,7 +111,7 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
111 cpu_to_le32(aal + size); 111 cpu_to_le32(aal + size);
112 } 112 }
113 if (le32_to_cpu(eahd->impAttrLocation) < 113 if (le32_to_cpu(eahd->impAttrLocation) <
114 UDF_I_LENEATTR(inode)) { 114 UDF_I(inode)->i_lenEAttr) {
115 uint32_t ial = 115 uint32_t ial =
116 le32_to_cpu(eahd->impAttrLocation); 116 le32_to_cpu(eahd->impAttrLocation);
117 memmove(&ea[offset - ial + size], 117 memmove(&ea[offset - ial + size],
@@ -122,7 +122,7 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
122 } 122 }
123 } else if (type < 65536) { 123 } else if (type < 65536) {
124 if (le32_to_cpu(eahd->appAttrLocation) < 124 if (le32_to_cpu(eahd->appAttrLocation) <
125 UDF_I_LENEATTR(inode)) { 125 UDF_I(inode)->i_lenEAttr) {
126 uint32_t aal = 126 uint32_t aal =
127 le32_to_cpu(eahd->appAttrLocation); 127 le32_to_cpu(eahd->appAttrLocation);
128 memmove(&ea[offset - aal + size], 128 memmove(&ea[offset - aal + size],
@@ -138,7 +138,7 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
138 eahd->descTag.descCRC = cpu_to_le16(udf_crc((char *)eahd + 138 eahd->descTag.descCRC = cpu_to_le16(udf_crc((char *)eahd +
139 sizeof(tag), crclen, 0)); 139 sizeof(tag), crclen, 0));
140 eahd->descTag.tagChecksum = udf_tag_checksum(&eahd->descTag); 140 eahd->descTag.tagChecksum = udf_tag_checksum(&eahd->descTag);
141 UDF_I_LENEATTR(inode) += size; 141 UDF_I(inode)->i_lenEAttr += size;
142 return (struct genericFormat *)&ea[offset]; 142 return (struct genericFormat *)&ea[offset];
143 } 143 }
144 if (loc & 0x02) 144 if (loc & 0x02)
@@ -154,9 +154,9 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
154 uint8_t *ea = NULL; 154 uint8_t *ea = NULL;
155 uint32_t offset; 155 uint32_t offset;
156 156
157 ea = UDF_I_DATA(inode); 157 ea = UDF_I(inode)->i_ext.i_data;
158 158
159 if (UDF_I_LENEATTR(inode)) { 159 if (UDF_I(inode)->i_lenEAttr) {
160 struct extendedAttrHeaderDesc *eahd; 160 struct extendedAttrHeaderDesc *eahd;
161 eahd = (struct extendedAttrHeaderDesc *)ea; 161 eahd = (struct extendedAttrHeaderDesc *)ea;
162 162
@@ -164,7 +164,7 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
164 if (eahd->descTag.tagIdent != 164 if (eahd->descTag.tagIdent !=
165 cpu_to_le16(TAG_IDENT_EAHD) || 165 cpu_to_le16(TAG_IDENT_EAHD) ||
166 le32_to_cpu(eahd->descTag.tagLocation) != 166 le32_to_cpu(eahd->descTag.tagLocation) !=
167 UDF_I_LOCATION(inode).logicalBlockNum) 167 UDF_I(inode)->i_location.logicalBlockNum)
168 return NULL; 168 return NULL;
169 169
170 if (type < 2048) 170 if (type < 2048)
@@ -174,7 +174,7 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
174 else 174 else
175 offset = le32_to_cpu(eahd->appAttrLocation); 175 offset = le32_to_cpu(eahd->appAttrLocation);
176 176
177 while (offset < UDF_I_LENEATTR(inode)) { 177 while (offset < UDF_I(inode)->i_lenEAttr) {
178 gaf = (struct genericFormat *)&ea[offset]; 178 gaf = (struct genericFormat *)&ea[offset];
179 if (le32_to_cpu(gaf->attrType) == type && 179 if (le32_to_cpu(gaf->attrType) == type &&
180 gaf->attrSubtype == subtype) 180 gaf->attrSubtype == subtype)
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 9b5cfc5f725c..23e530659fa5 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -54,7 +54,7 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi,
54 sizeof(struct fileIdentDesc); 54 sizeof(struct fileIdentDesc);
55 int adinicb = 0; 55 int adinicb = 0;
56 56
57 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) 57 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
58 adinicb = 1; 58 adinicb = 1;
59 59
60 offset = fibh->soffset + sizeof(struct fileIdentDesc); 60 offset = fibh->soffset + sizeof(struct fileIdentDesc);
@@ -164,16 +164,17 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
164 164
165 fibh->soffset = fibh->eoffset = 165 fibh->soffset = fibh->eoffset =
166 (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2; 166 (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
167 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 167 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
168 fibh->sbh = fibh->ebh = NULL; 168 fibh->sbh = fibh->ebh = NULL;
169 else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), 169 else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2),
170 &epos, &eloc, &elen, &offset) == 170 &epos, &eloc, &elen, &offset) ==
171 (EXT_RECORDED_ALLOCATED >> 30)) { 171 (EXT_RECORDED_ALLOCATED >> 30)) {
172 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 172 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
173 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 173 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
174 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_SHORT) 174 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
175 epos.offset -= sizeof(short_ad); 175 epos.offset -= sizeof(short_ad);
176 else if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_LONG) 176 else if (UDF_I(dir)->i_alloc_type ==
177 ICBTAG_FLAG_AD_LONG)
177 epos.offset -= sizeof(long_ad); 178 epos.offset -= sizeof(long_ad);
178 } else 179 } else
179 offset = 0; 180 offset = 0;
@@ -372,16 +373,17 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
372 373
373 fibh->soffset = fibh->eoffset = 374 fibh->soffset = fibh->eoffset =
374 (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2; 375 (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
375 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 376 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
376 fibh->sbh = fibh->ebh = NULL; 377 fibh->sbh = fibh->ebh = NULL;
377 else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), 378 else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2),
378 &epos, &eloc, &elen, &offset) == 379 &epos, &eloc, &elen, &offset) ==
379 (EXT_RECORDED_ALLOCATED >> 30)) { 380 (EXT_RECORDED_ALLOCATED >> 30)) {
380 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 381 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
381 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 382 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
382 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_SHORT) 383 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
383 epos.offset -= sizeof(short_ad); 384 epos.offset -= sizeof(short_ad);
384 else if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_LONG) 385 else if (UDF_I(dir)->i_alloc_type ==
386 ICBTAG_FLAG_AD_LONG)
385 epos.offset -= sizeof(long_ad); 387 epos.offset -= sizeof(long_ad);
386 } else 388 } else
387 offset = 0; 389 offset = 0;
@@ -393,10 +395,10 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
393 return NULL; 395 return NULL;
394 } 396 }
395 397
396 block = UDF_I_LOCATION(dir).logicalBlockNum; 398 block = UDF_I(dir)->i_location.logicalBlockNum;
397 399
398 } else { 400 } else {
399 block = udf_get_lb_pblock(dir->i_sb, UDF_I_LOCATION(dir), 0); 401 block = udf_get_lb_pblock(dir->i_sb, UDF_I(dir)->i_location, 0);
400 fibh->sbh = fibh->ebh = NULL; 402 fibh->sbh = fibh->ebh = NULL;
401 fibh->soffset = fibh->eoffset = sb->s_blocksize; 403 fibh->soffset = fibh->eoffset = sb->s_blocksize;
402 goto add; 404 goto add;
@@ -475,7 +477,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
475add: 477add:
476 f_pos += nfidlen; 478 f_pos += nfidlen;
477 479
478 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB && 480 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB &&
479 sb->s_blocksize - fibh->eoffset < nfidlen) { 481 sb->s_blocksize - fibh->eoffset < nfidlen) {
480 brelse(epos.bh); 482 brelse(epos.bh);
481 epos.bh = NULL; 483 epos.bh = NULL;
@@ -489,15 +491,15 @@ add:
489 udf_expand_dir_adinicb(dir, &block, err); 491 udf_expand_dir_adinicb(dir, &block, err);
490 if (!fibh->sbh) 492 if (!fibh->sbh)
491 return NULL; 493 return NULL;
492 epos.block = UDF_I_LOCATION(dir); 494 epos.block = UDF_I(dir)->i_location;
493 eloc.logicalBlockNum = block; 495 eloc.logicalBlockNum = block;
494 eloc.partitionReferenceNum = 496 eloc.partitionReferenceNum =
495 UDF_I_LOCATION(dir).partitionReferenceNum; 497 UDF_I(dir)->i_location.partitionReferenceNum;
496 elen = dir->i_sb->s_blocksize; 498 elen = dir->i_sb->s_blocksize;
497 epos.offset = udf_file_entry_alloc_offset(dir); 499 epos.offset = udf_file_entry_alloc_offset(dir);
498 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_SHORT) 500 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
499 epos.offset += sizeof(short_ad); 501 epos.offset += sizeof(short_ad);
500 else if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_LONG) 502 else if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
501 epos.offset += sizeof(long_ad); 503 epos.offset += sizeof(long_ad);
502 } 504 }
503 505
@@ -509,12 +511,13 @@ add:
509 fibh->sbh = fibh->ebh; 511 fibh->sbh = fibh->ebh;
510 } 512 }
511 513
512 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) { 514 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
513 block = UDF_I_LOCATION(dir).logicalBlockNum; 515 block = UDF_I(dir)->i_location.logicalBlockNum;
514 fi = (struct fileIdentDesc *) 516 fi = (struct fileIdentDesc *)
515 (UDF_I_DATA(dir) + fibh->soffset - 517 (UDF_I(dir)->i_ext.i_data +
518 fibh->soffset -
516 udf_ext0_offset(dir) + 519 udf_ext0_offset(dir) +
517 UDF_I_LENEATTR(dir)); 520 UDF_I(dir)->i_lenEAttr);
518 } else { 521 } else {
519 block = eloc.logicalBlockNum + 522 block = eloc.logicalBlockNum +
520 ((elen - 1) >> 523 ((elen - 1) >>
@@ -572,8 +575,8 @@ add:
572 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, name)) { 575 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, name)) {
573 brelse(epos.bh); 576 brelse(epos.bh);
574 dir->i_size += nfidlen; 577 dir->i_size += nfidlen;
575 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 578 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
576 UDF_I_LENALLOC(dir) += nfidlen; 579 UDF_I(dir)->i_lenAlloc += nfidlen;
577 mark_inode_dirty(dir); 580 mark_inode_dirty(dir);
578 return fi; 581 return fi;
579 } else { 582 } else {
@@ -613,7 +616,7 @@ static int udf_create(struct inode *dir, struct dentry *dentry, int mode,
613 return err; 616 return err;
614 } 617 }
615 618
616 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) 619 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
617 inode->i_data.a_ops = &udf_adinicb_aops; 620 inode->i_data.a_ops = &udf_adinicb_aops;
618 else 621 else
619 inode->i_data.a_ops = &udf_aops; 622 inode->i_data.a_ops = &udf_aops;
@@ -631,11 +634,11 @@ static int udf_create(struct inode *dir, struct dentry *dentry, int mode,
631 return err; 634 return err;
632 } 635 }
633 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); 636 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
634 cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); 637 cfi.icb.extLocation = cpu_to_lelb(UDF_I(inode)->i_location);
635 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = 638 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
636 cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL); 639 cpu_to_le32(UDF_I(inode)->i_unique & 0x00000000FFFFFFFFUL);
637 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); 640 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
638 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 641 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
639 mark_inode_dirty(dir); 642 mark_inode_dirty(dir);
640 if (fibh.sbh != fibh.ebh) 643 if (fibh.sbh != fibh.ebh)
641 brelse(fibh.ebh); 644 brelse(fibh.ebh);
@@ -674,11 +677,11 @@ static int udf_mknod(struct inode *dir, struct dentry *dentry, int mode,
674 return err; 677 return err;
675 } 678 }
676 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); 679 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
677 cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); 680 cfi.icb.extLocation = cpu_to_lelb(UDF_I(inode)->i_location);
678 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = 681 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
679 cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL); 682 cpu_to_le32(UDF_I(inode)->i_unique & 0x00000000FFFFFFFFUL);
680 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); 683 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
681 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 684 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
682 mark_inode_dirty(dir); 685 mark_inode_dirty(dir);
683 mark_inode_dirty(inode); 686 mark_inode_dirty(inode);
684 687
@@ -721,9 +724,9 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, int mode)
721 } 724 }
722 inode->i_nlink = 2; 725 inode->i_nlink = 2;
723 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); 726 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
724 cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(dir)); 727 cfi.icb.extLocation = cpu_to_lelb(UDF_I(dir)->i_location);
725 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = 728 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
726 cpu_to_le32(UDF_I_UNIQUE(dir) & 0x00000000FFFFFFFFUL); 729 cpu_to_le32(UDF_I(dir)->i_unique & 0x00000000FFFFFFFFUL);
727 cfi.fileCharacteristics = 730 cfi.fileCharacteristics =
728 FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT; 731 FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT;
729 udf_write_fi(inode, &cfi, fi, &fibh, NULL, NULL); 732 udf_write_fi(inode, &cfi, fi, &fibh, NULL, NULL);
@@ -741,9 +744,9 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, int mode)
741 goto out; 744 goto out;
742 } 745 }
743 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); 746 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
744 cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); 747 cfi.icb.extLocation = cpu_to_lelb(UDF_I(inode)->i_location);
745 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = 748 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =
746 cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL); 749 cpu_to_le32(UDF_I(inode)->i_unique & 0x00000000FFFFFFFFUL);
747 cfi.fileCharacteristics |= FID_FILE_CHAR_DIRECTORY; 750 cfi.fileCharacteristics |= FID_FILE_CHAR_DIRECTORY;
748 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); 751 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
749 inc_nlink(dir); 752 inc_nlink(dir);
@@ -776,16 +779,17 @@ static int empty_dir(struct inode *dir)
776 fibh.soffset = fibh.eoffset = 779 fibh.soffset = fibh.eoffset =
777 (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2; 780 (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
778 781
779 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 782 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
780 fibh.sbh = fibh.ebh = NULL; 783 fibh.sbh = fibh.ebh = NULL;
781 else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), 784 else if (inode_bmap(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2),
782 &epos, &eloc, &elen, &offset) == 785 &epos, &eloc, &elen, &offset) ==
783 (EXT_RECORDED_ALLOCATED >> 30)) { 786 (EXT_RECORDED_ALLOCATED >> 30)) {
784 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 787 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
785 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 788 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
786 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_SHORT) 789 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
787 epos.offset -= sizeof(short_ad); 790 epos.offset -= sizeof(short_ad);
788 else if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_LONG) 791 else if (UDF_I(dir)->i_alloc_type ==
792 ICBTAG_FLAG_AD_LONG)
789 epos.offset -= sizeof(long_ad); 793 epos.offset -= sizeof(long_ad);
790 } else 794 } else
791 offset = 0; 795 offset = 0;
@@ -945,28 +949,28 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
945 inode->i_data.a_ops = &udf_symlink_aops; 949 inode->i_data.a_ops = &udf_symlink_aops;
946 inode->i_op = &page_symlink_inode_operations; 950 inode->i_op = &page_symlink_inode_operations;
947 951
948 if (UDF_I_ALLOCTYPE(inode) != ICBTAG_FLAG_AD_IN_ICB) { 952 if (UDF_I(inode)->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
949 kernel_lb_addr eloc; 953 kernel_lb_addr eloc;
950 uint32_t elen; 954 uint32_t elen;
951 955
952 block = udf_new_block(inode->i_sb, inode, 956 block = udf_new_block(inode->i_sb, inode,
953 UDF_I_LOCATION(inode).partitionReferenceNum, 957 UDF_I(inode)->i_location.partitionReferenceNum,
954 UDF_I_LOCATION(inode).logicalBlockNum, &err); 958 UDF_I(inode)->i_location.logicalBlockNum, &err);
955 if (!block) 959 if (!block)
956 goto out_no_entry; 960 goto out_no_entry;
957 epos.block = UDF_I_LOCATION(inode); 961 epos.block = UDF_I(inode)->i_location;
958 epos.offset = udf_file_entry_alloc_offset(inode); 962 epos.offset = udf_file_entry_alloc_offset(inode);
959 epos.bh = NULL; 963 epos.bh = NULL;
960 eloc.logicalBlockNum = block; 964 eloc.logicalBlockNum = block;
961 eloc.partitionReferenceNum = 965 eloc.partitionReferenceNum =
962 UDF_I_LOCATION(inode).partitionReferenceNum; 966 UDF_I(inode)->i_location.partitionReferenceNum;
963 elen = inode->i_sb->s_blocksize; 967 elen = inode->i_sb->s_blocksize;
964 UDF_I_LENEXTENTS(inode) = elen; 968 UDF_I(inode)->i_lenExtents = elen;
965 udf_add_aext(inode, &epos, eloc, elen, 0); 969 udf_add_aext(inode, &epos, eloc, elen, 0);
966 brelse(epos.bh); 970 brelse(epos.bh);
967 971
968 block = udf_get_pblock(inode->i_sb, block, 972 block = udf_get_pblock(inode->i_sb, block,
969 UDF_I_LOCATION(inode).partitionReferenceNum, 973 UDF_I(inode)->i_location.partitionReferenceNum,
970 0); 974 0);
971 epos.bh = udf_tread(inode->i_sb, block); 975 epos.bh = udf_tread(inode->i_sb, block);
972 lock_buffer(epos.bh); 976 lock_buffer(epos.bh);
@@ -976,7 +980,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
976 mark_buffer_dirty_inode(epos.bh, inode); 980 mark_buffer_dirty_inode(epos.bh, inode);
977 ea = epos.bh->b_data + udf_ext0_offset(inode); 981 ea = epos.bh->b_data + udf_ext0_offset(inode);
978 } else { 982 } else {
979 ea = UDF_I_DATA(inode) + UDF_I_LENEATTR(inode); 983 ea = UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr;
980 } 984 }
981 985
982 eoffset = inode->i_sb->s_blocksize - udf_ext0_offset(inode); 986 eoffset = inode->i_sb->s_blocksize - udf_ext0_offset(inode);
@@ -1045,15 +1049,15 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
1045 1049
1046 brelse(epos.bh); 1050 brelse(epos.bh);
1047 inode->i_size = elen; 1051 inode->i_size = elen;
1048 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) 1052 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
1049 UDF_I_LENALLOC(inode) = inode->i_size; 1053 UDF_I(inode)->i_lenAlloc = inode->i_size;
1050 mark_inode_dirty(inode); 1054 mark_inode_dirty(inode);
1051 1055
1052 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); 1056 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
1053 if (!fi) 1057 if (!fi)
1054 goto out_no_entry; 1058 goto out_no_entry;
1055 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); 1059 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
1056 cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); 1060 cfi.icb.extLocation = cpu_to_lelb(UDF_I(inode)->i_location);
1057 bh = UDF_SB(inode->i_sb)->s_lvid_bh; 1061 bh = UDF_SB(inode->i_sb)->s_lvid_bh;
1058 if (bh) { 1062 if (bh) {
1059 struct logicalVolIntegrityDesc *lvid = 1063 struct logicalVolIntegrityDesc *lvid =
@@ -1071,7 +1075,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
1071 mark_buffer_dirty(bh); 1075 mark_buffer_dirty(bh);
1072 } 1076 }
1073 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); 1077 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
1074 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 1078 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
1075 mark_inode_dirty(dir); 1079 mark_inode_dirty(dir);
1076 if (fibh.sbh != fibh.ebh) 1080 if (fibh.sbh != fibh.ebh)
1077 brelse(fibh.ebh); 1081 brelse(fibh.ebh);
@@ -1110,7 +1114,7 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir,
1110 return err; 1114 return err;
1111 } 1115 }
1112 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize); 1116 cfi.icb.extLength = cpu_to_le32(inode->i_sb->s_blocksize);
1113 cfi.icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(inode)); 1117 cfi.icb.extLocation = cpu_to_lelb(UDF_I(inode)->i_location);
1114 bh = UDF_SB(inode->i_sb)->s_lvid_bh; 1118 bh = UDF_SB(inode->i_sb)->s_lvid_bh;
1115 if (bh) { 1119 if (bh) {
1116 struct logicalVolIntegrityDesc *lvid = 1120 struct logicalVolIntegrityDesc *lvid =
@@ -1128,7 +1132,7 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir,
1128 mark_buffer_dirty(bh); 1132 mark_buffer_dirty(bh);
1129 } 1133 }
1130 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); 1134 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
1131 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 1135 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
1132 mark_inode_dirty(dir); 1136 mark_inode_dirty(dir);
1133 1137
1134 if (fibh.sbh != fibh.ebh) 1138 if (fibh.sbh != fibh.ebh)
@@ -1189,10 +1193,10 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
1189 goto end_rename; 1193 goto end_rename;
1190 } 1194 }
1191 retval = -EIO; 1195 retval = -EIO;
1192 if (UDF_I_ALLOCTYPE(old_inode) == ICBTAG_FLAG_AD_IN_ICB) { 1196 if (UDF_I(old_inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
1193 dir_fi = udf_get_fileident( 1197 dir_fi = udf_get_fileident(
1194 UDF_I_DATA(old_inode) - 1198 UDF_I(old_inode)->i_ext.i_data -
1195 (UDF_I_EFE(old_inode) ? 1199 (UDF_I(old_inode)->i_efe ?
1196 sizeof(struct extendedFileEntry) : 1200 sizeof(struct extendedFileEntry) :
1197 sizeof(struct fileEntry)), 1201 sizeof(struct fileEntry)),
1198 old_inode->i_sb->s_blocksize, &offset); 1202 old_inode->i_sb->s_blocksize, &offset);
@@ -1250,11 +1254,11 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,
1250 mark_inode_dirty(old_dir); 1254 mark_inode_dirty(old_dir);
1251 1255
1252 if (dir_fi) { 1256 if (dir_fi) {
1253 dir_fi->icb.extLocation = cpu_to_lelb(UDF_I_LOCATION(new_dir)); 1257 dir_fi->icb.extLocation = cpu_to_lelb(UDF_I(new_dir)->i_location);
1254 udf_update_tag((char *)dir_fi, 1258 udf_update_tag((char *)dir_fi,
1255 (sizeof(struct fileIdentDesc) + 1259 (sizeof(struct fileIdentDesc) +
1256 le16_to_cpu(dir_fi->lengthOfImpUse) + 3) & ~3); 1260 le16_to_cpu(dir_fi->lengthOfImpUse) + 3) & ~3);
1257 if (UDF_I_ALLOCTYPE(old_inode) == ICBTAG_FLAG_AD_IN_ICB) 1261 if (UDF_I(old_inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
1258 mark_inode_dirty(old_inode); 1262 mark_inode_dirty(old_inode);
1259 else 1263 else
1260 mark_buffer_dirty_inode(dir_bh, old_inode); 1264 mark_buffer_dirty_inode(dir_bh, old_inode);
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index 027c879969f1..cfe213fd3113 100644
--- a/fs/udf/partition.c
+++ b/fs/udf/partition.c
@@ -88,14 +88,14 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block,
88 88
89 brelse(bh); 89 brelse(bh);
90 90
91 if (UDF_I_LOCATION(sbi->s_vat_inode).partitionReferenceNum == 91 if (UDF_I(sbi->s_vat_inode)->i_location.partitionReferenceNum ==
92 partition) { 92 partition) {
93 udf_debug("recursive call to udf_get_pblock!\n"); 93 udf_debug("recursive call to udf_get_pblock!\n");
94 return 0xFFFFFFFF; 94 return 0xFFFFFFFF;
95 } 95 }
96 96
97 return udf_get_pblock(sb, loc, 97 return udf_get_pblock(sb, loc,
98 UDF_I_LOCATION(sbi->s_vat_inode). 98 UDF_I(sbi->s_vat_inode)->i_location.
99 partitionReferenceNum, 99 partitionReferenceNum,
100 offset); 100 offset);
101} 101}
diff --git a/fs/udf/super.c b/fs/udf/super.c
index b10295865e5a..52d2c32b6c7b 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -2046,7 +2046,7 @@ static unsigned int udf_count_free_table(struct super_block *sb,
2046 2046
2047 lock_kernel(); 2047 lock_kernel();
2048 2048
2049 epos.block = UDF_I_LOCATION(table); 2049 epos.block = UDF_I(table)->i_location;
2050 epos.offset = sizeof(struct unallocSpaceEntry); 2050 epos.offset = sizeof(struct unallocSpaceEntry);
2051 epos.bh = NULL; 2051 epos.bh = NULL;
2052 2052
diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c
index dcf06ef84f0f..d55989c871d4 100644
--- a/fs/udf/symlink.c
+++ b/fs/udf/symlink.c
@@ -81,8 +81,8 @@ static int udf_symlink_filler(struct file *file, struct page *page)
81 char *p = kmap(page); 81 char *p = kmap(page);
82 82
83 lock_kernel(); 83 lock_kernel();
84 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) { 84 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
85 symlink = UDF_I_DATA(inode) + UDF_I_LENEATTR(inode); 85 symlink = UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr;
86 } else { 86 } else {
87 bh = sb_bread(inode->i_sb, udf_block_map(inode, 0)); 87 bh = sb_bread(inode->i_sb, udf_block_map(inode, 0));
88 88
diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
index 5c1bf921f400..8eb1d24ce5ce 100644
--- a/fs/udf/truncate.c
+++ b/fs/udf/truncate.c
@@ -75,16 +75,16 @@ void udf_truncate_tail_extent(struct inode *inode)
75 int8_t etype = -1, netype; 75 int8_t etype = -1, netype;
76 int adsize; 76 int adsize;
77 77
78 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB || 78 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
79 inode->i_size == UDF_I_LENEXTENTS(inode)) 79 inode->i_size == UDF_I(inode)->i_lenExtents)
80 return; 80 return;
81 /* Are we going to delete the file anyway? */ 81 /* Are we going to delete the file anyway? */
82 if (inode->i_nlink == 0) 82 if (inode->i_nlink == 0)
83 return; 83 return;
84 84
85 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 85 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
86 adsize = sizeof(short_ad); 86 adsize = sizeof(short_ad);
87 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 87 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
88 adsize = sizeof(long_ad); 88 adsize = sizeof(long_ad);
89 else 89 else
90 BUG(); 90 BUG();
@@ -117,7 +117,7 @@ void udf_truncate_tail_extent(struct inode *inode)
117 } 117 }
118 /* This inode entry is in-memory only and thus we don't have to mark 118 /* This inode entry is in-memory only and thus we don't have to mark
119 * the inode dirty */ 119 * the inode dirty */
120 UDF_I_LENEXTENTS(inode) = inode->i_size; 120 UDF_I(inode)->i_lenExtents = inode->i_size;
121 brelse(epos.bh); 121 brelse(epos.bh);
122} 122}
123 123
@@ -130,18 +130,18 @@ void udf_discard_prealloc(struct inode *inode)
130 int8_t etype = -1, netype; 130 int8_t etype = -1, netype;
131 int adsize; 131 int adsize;
132 132
133 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB || 133 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
134 inode->i_size == UDF_I_LENEXTENTS(inode)) 134 inode->i_size == UDF_I(inode)->i_lenExtents)
135 return; 135 return;
136 136
137 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 137 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
138 adsize = sizeof(short_ad); 138 adsize = sizeof(short_ad);
139 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 139 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
140 adsize = sizeof(long_ad); 140 adsize = sizeof(long_ad);
141 else 141 else
142 adsize = 0; 142 adsize = 0;
143 143
144 epos.block = UDF_I_LOCATION(inode); 144 epos.block = UDF_I(inode)->i_location;
145 145
146 /* Find the last extent in the file */ 146 /* Find the last extent in the file */
147 while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) { 147 while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) {
@@ -153,7 +153,7 @@ void udf_discard_prealloc(struct inode *inode)
153 lbcount -= elen; 153 lbcount -= elen;
154 extent_trunc(inode, &epos, eloc, etype, elen, 0); 154 extent_trunc(inode, &epos, eloc, etype, elen, 0);
155 if (!epos.bh) { 155 if (!epos.bh) {
156 UDF_I_LENALLOC(inode) = 156 UDF_I(inode)->i_lenAlloc =
157 epos.offset - 157 epos.offset -
158 udf_file_entry_alloc_offset(inode); 158 udf_file_entry_alloc_offset(inode);
159 mark_inode_dirty(inode); 159 mark_inode_dirty(inode);
@@ -174,7 +174,7 @@ void udf_discard_prealloc(struct inode *inode)
174 } 174 }
175 /* This inode entry is in-memory only and thus we don't have to mark 175 /* This inode entry is in-memory only and thus we don't have to mark
176 * the inode dirty */ 176 * the inode dirty */
177 UDF_I_LENEXTENTS(inode) = lbcount; 177 UDF_I(inode)->i_lenExtents = lbcount;
178 brelse(epos.bh); 178 brelse(epos.bh);
179} 179}
180 180
@@ -190,9 +190,9 @@ void udf_truncate_extents(struct inode *inode)
190 loff_t byte_offset; 190 loff_t byte_offset;
191 int adsize; 191 int adsize;
192 192
193 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 193 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
194 adsize = sizeof(short_ad); 194 adsize = sizeof(short_ad);
195 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 195 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
196 adsize = sizeof(long_ad); 196 adsize = sizeof(long_ad);
197 else 197 else
198 BUG(); 198 BUG();
@@ -227,7 +227,7 @@ void udf_truncate_extents(struct inode *inode)
227 0, indirect_ext_len); 227 0, indirect_ext_len);
228 } else { 228 } else {
229 if (!epos.bh) { 229 if (!epos.bh) {
230 UDF_I_LENALLOC(inode) = 230 UDF_I(inode)->i_lenAlloc =
231 lenalloc; 231 lenalloc;
232 mark_inode_dirty(inode); 232 mark_inode_dirty(inode);
233 } else { 233 } else {
@@ -275,7 +275,7 @@ void udf_truncate_extents(struct inode *inode)
275 indirect_ext_len); 275 indirect_ext_len);
276 } else { 276 } else {
277 if (!epos.bh) { 277 if (!epos.bh) {
278 UDF_I_LENALLOC(inode) = lenalloc; 278 UDF_I(inode)->i_lenAlloc = lenalloc;
279 mark_inode_dirty(inode); 279 mark_inode_dirty(inode);
280 } else { 280 } else {
281 struct allocExtDesc *aed = 281 struct allocExtDesc *aed =
@@ -325,7 +325,7 @@ void udf_truncate_extents(struct inode *inode)
325 (sb->s_blocksize - 1)) != 0)); 325 (sb->s_blocksize - 1)) != 0));
326 } 326 }
327 } 327 }
328 UDF_I_LENEXTENTS(inode) = inode->i_size; 328 UDF_I(inode)->i_lenExtents = inode->i_size;
329 329
330 brelse(epos.bh); 330 brelse(epos.bh);
331} 331}
diff --git a/fs/udf/udf_i.h b/fs/udf/udf_i.h
index d7dbe6f3ba0c..ccc52f16bf7d 100644
--- a/fs/udf/udf_i.h
+++ b/fs/udf/udf_i.h
@@ -7,20 +7,4 @@ static inline struct udf_inode_info *UDF_I(struct inode *inode)
7 return list_entry(inode, struct udf_inode_info, vfs_inode); 7 return list_entry(inode, struct udf_inode_info, vfs_inode);
8} 8}
9 9
10#define UDF_I_LOCATION(X) ( UDF_I(X)->i_location )
11#define UDF_I_LENEATTR(X) ( UDF_I(X)->i_lenEAttr )
12#define UDF_I_LENALLOC(X) ( UDF_I(X)->i_lenAlloc )
13#define UDF_I_LENEXTENTS(X) ( UDF_I(X)->i_lenExtents )
14#define UDF_I_UNIQUE(X) ( UDF_I(X)->i_unique )
15#define UDF_I_ALLOCTYPE(X) ( UDF_I(X)->i_alloc_type )
16#define UDF_I_EFE(X) ( UDF_I(X)->i_efe )
17#define UDF_I_USE(X) ( UDF_I(X)->i_use )
18#define UDF_I_STRAT4096(X) ( UDF_I(X)->i_strat4096 )
19#define UDF_I_NEXT_ALLOC_BLOCK(X) ( UDF_I(X)->i_next_alloc_block )
20#define UDF_I_NEXT_ALLOC_GOAL(X) ( UDF_I(X)->i_next_alloc_goal )
21#define UDF_I_CRTIME(X) ( UDF_I(X)->i_crtime )
22#define UDF_I_SAD(X) ( UDF_I(X)->i_ext.i_sad )
23#define UDF_I_LAD(X) ( UDF_I(X)->i_ext.i_lad )
24#define UDF_I_DATA(X) ( UDF_I(X)->i_ext.i_data )
25
26#endif /* !defined(_LINUX_UDF_I_H) */ 10#endif /* !defined(_LINUX_UDF_I_H) */
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index bed0a0251389..d9b8e281b95b 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -24,14 +24,14 @@
24#define UDF_PATH_LEN 1023 24#define UDF_PATH_LEN 1023
25 25
26#define udf_file_entry_alloc_offset(inode)\ 26#define udf_file_entry_alloc_offset(inode)\
27 (UDF_I_USE(inode) ?\ 27 (UDF_I(inode)->i_use ?\
28 sizeof(struct unallocSpaceEntry) :\ 28 sizeof(struct unallocSpaceEntry) :\
29 ((UDF_I_EFE(inode) ?\ 29 ((UDF_I(inode)->i_efe ?\
30 sizeof(struct extendedFileEntry) :\ 30 sizeof(struct extendedFileEntry) :\
31 sizeof(struct fileEntry)) + UDF_I_LENEATTR(inode))) 31 sizeof(struct fileEntry)) + UDF_I(inode)->i_lenEAttr))
32 32
33#define udf_ext0_offset(inode)\ 33#define udf_ext0_offset(inode)\
34 (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB ?\ 34 (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ?\
35 udf_file_entry_alloc_offset(inode) : 0) 35 udf_file_entry_alloc_offset(inode) : 0)
36 36
37#define udf_get_lb_pblock(sb,loc,offset) udf_get_pblock((sb), (loc).logicalBlockNum, (loc).partitionReferenceNum, (offset)) 37#define udf_get_lb_pblock(sb,loc,offset) udf_get_pblock((sb), (loc).logicalBlockNum, (loc).partitionReferenceNum, (offset))