aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r--fs/udf/namei.c110
1 files changed, 57 insertions, 53 deletions
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);