aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:28 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:34 -0500
commit3a71fc5de56338076fe99f24f50bccfebabefe18 (patch)
tree847ffe82e363d730e38b5e8e48554db44eb2449f /fs/udf
parent74bedc4d56211b30686c6f2f574bf6c6a9654887 (diff)
udf: fix coding style of super.c
fix coding style errors found by checkpatch: - assignments in if conditions - braces {} around single statement blocks - no spaces after commas - printks without KERN_* - lines longer than 80 characters before: total: 50 errors, 207 warnings, 1835 lines checked after: total: 0 errors, 164 warnings, 1872 lines checked all 164 warnings left are lines longer than 80 characters; this file has too much indentation with really long expressions to break all those lines now; will fix later Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Ben Fennema <bfennema@falcon.csc.calpoly.edu> 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>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/super.c295
1 files changed, 166 insertions, 129 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 4360c7a05743..57788f1ba2da 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -33,8 +33,8 @@
33 * 10/17/98 added freespace count for "df" 33 * 10/17/98 added freespace count for "df"
34 * 11/11/98 gr added novrs option 34 * 11/11/98 gr added novrs option
35 * 11/26/98 dgb added fileset,anchor mount options 35 * 11/26/98 dgb added fileset,anchor mount options
36 * 12/06/98 blf really hosed things royally. vat/sparing support. sequenced vol descs 36 * 12/06/98 blf really hosed things royally. vat/sparing support. sequenced
37 * rewrote option handling based on isofs 37 * vol descs. rewrote option handling based on isofs
38 * 12/20/98 find the free space bitmap (if it exists) 38 * 12/20/98 find the free space bitmap (if it exists)
39 */ 39 */
40 40
@@ -116,7 +116,7 @@ static struct kmem_cache *udf_inode_cachep;
116static struct inode *udf_alloc_inode(struct super_block *sb) 116static struct inode *udf_alloc_inode(struct super_block *sb)
117{ 117{
118 struct udf_inode_info *ei; 118 struct udf_inode_info *ei;
119 ei = (struct udf_inode_info *)kmem_cache_alloc(udf_inode_cachep, GFP_KERNEL); 119 ei = kmem_cache_alloc(udf_inode_cachep, GFP_KERNEL);
120 if (!ei) 120 if (!ei)
121 return NULL; 121 return NULL;
122 122
@@ -561,47 +561,52 @@ static int udf_vrs(struct super_block *sb, int silent)
561 561
562 /* Look for ISO descriptors */ 562 /* Look for ISO descriptors */
563 vsd = (struct volStructDesc *)(bh->b_data + 563 vsd = (struct volStructDesc *)(bh->b_data +
564 (sector & (sb->s_blocksize - 1))); 564 (sector & (sb->s_blocksize - 1)));
565 565
566 if (vsd->stdIdent[0] == 0) { 566 if (vsd->stdIdent[0] == 0) {
567 brelse(bh); 567 brelse(bh);
568 break; 568 break;
569 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001, VSD_STD_ID_LEN)) { 569 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001,
570 VSD_STD_ID_LEN)) {
570 iso9660 = sector; 571 iso9660 = sector;
571 switch (vsd->structType) { 572 switch (vsd->structType) {
572 case 0: 573 case 0:
573 udf_debug("ISO9660 Boot Record found\n"); 574 udf_debug("ISO9660 Boot Record found\n");
574 break; 575 break;
575 case 1: 576 case 1:
576 udf_debug 577 udf_debug("ISO9660 Primary Volume Descriptor "
577 ("ISO9660 Primary Volume Descriptor found\n"); 578 "found\n");
578 break; 579 break;
579 case 2: 580 case 2:
580 udf_debug 581 udf_debug("ISO9660 Supplementary Volume "
581 ("ISO9660 Supplementary Volume Descriptor found\n"); 582 "Descriptor found\n");
582 break; 583 break;
583 case 3: 584 case 3:
584 udf_debug 585 udf_debug("ISO9660 Volume Partition Descriptor "
585 ("ISO9660 Volume Partition Descriptor found\n"); 586 "found\n");
586 break; 587 break;
587 case 255: 588 case 255:
588 udf_debug 589 udf_debug("ISO9660 Volume Descriptor Set "
589 ("ISO9660 Volume Descriptor Set Terminator found\n"); 590 "Terminator found\n");
590 break; 591 break;
591 default: 592 default:
592 udf_debug("ISO9660 VRS (%u) found\n", 593 udf_debug("ISO9660 VRS (%u) found\n",
593 vsd->structType); 594 vsd->structType);
594 break; 595 break;
595 } 596 }
596 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_BEA01, VSD_STD_ID_LEN)) { 597 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_BEA01,
597 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_TEA01, VSD_STD_ID_LEN)) { 598 VSD_STD_ID_LEN))
599 ; /* nothing */
600 else if (!strncmp(vsd->stdIdent, VSD_STD_ID_TEA01,
601 VSD_STD_ID_LEN)) {
598 brelse(bh); 602 brelse(bh);
599 break; 603 break;
600 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR02, VSD_STD_ID_LEN)) { 604 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR02,
605 VSD_STD_ID_LEN))
601 nsr02 = sector; 606 nsr02 = sector;
602 } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR03, VSD_STD_ID_LEN)) { 607 else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR03,
608 VSD_STD_ID_LEN))
603 nsr03 = sector; 609 nsr03 = sector;
604 }
605 brelse(bh); 610 brelse(bh);
606 } 611 }
607 612
@@ -658,21 +663,26 @@ static void udf_find_anchor(struct super_block *sb)
658 * however, if the disc isn't closed, it could be 512 */ 663 * however, if the disc isn't closed, it could be 512 */
659 664
660 for (i = 0; !lastblock && i < ARRAY_SIZE(last); i++) { 665 for (i = 0; !lastblock && i < ARRAY_SIZE(last); i++) {
661 if (last[i] < 0 || !(bh = sb_bread(sb, last[i]))) { 666 ident = location = 0;
662 ident = location = 0; 667 if (last[i] >= 0) {
663 } else { 668 bh = sb_bread(sb, last[i]);
664 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 669 if (bh) {
665 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 670 tag *t = (tag *)bh->b_data;
666 brelse(bh); 671 ident = le16_to_cpu(t->tagIdent);
672 location = le32_to_cpu(t->tagLocation);
673 brelse(bh);
674 }
667 } 675 }
668 676
669 if (ident == TAG_IDENT_AVDP) { 677 if (ident == TAG_IDENT_AVDP) {
670 if (location == last[i] - UDF_SB_SESSION(sb)) { 678 if (location == last[i] - UDF_SB_SESSION(sb)) {
671 lastblock = UDF_SB_ANCHOR(sb)[0] = last[i] - UDF_SB_SESSION(sb); 679 lastblock = last[i] - UDF_SB_SESSION(sb);
672 UDF_SB_ANCHOR(sb)[1] = last[i] - 256 - UDF_SB_SESSION(sb); 680 UDF_SB_ANCHOR(sb)[0] = lastblock;
681 UDF_SB_ANCHOR(sb)[1] = lastblock - 256;
673 } else if (location == udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb)) { 682 } else if (location == udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb)) {
674 UDF_SET_FLAG(sb, UDF_FLAG_VARCONV); 683 UDF_SET_FLAG(sb, UDF_FLAG_VARCONV);
675 lastblock = UDF_SB_ANCHOR(sb)[0] = udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb); 684 lastblock = udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb);
685 UDF_SB_ANCHOR(sb)[0] = lastblock;
676 UDF_SB_ANCHOR(sb)[1] = lastblock - 256 - UDF_SB_SESSION(sb); 686 UDF_SB_ANCHOR(sb)[1] = lastblock - 256 - UDF_SB_SESSION(sb);
677 } else { 687 } else {
678 udf_debug("Anchor found at block %d, location mismatch %d.\n", 688 udf_debug("Anchor found at block %d, location mismatch %d.\n",
@@ -682,12 +692,15 @@ static void udf_find_anchor(struct super_block *sb)
682 lastblock = last[i]; 692 lastblock = last[i];
683 UDF_SB_ANCHOR(sb)[3] = 512; 693 UDF_SB_ANCHOR(sb)[3] = 512;
684 } else { 694 } else {
685 if (last[i] < 256 || !(bh = sb_bread(sb, last[i] - 256))) { 695 ident = location = 0;
686 ident = location = 0; 696 if (last[i] >= 256) {
687 } else { 697 bh = sb_bread(sb, last[i] - 256);
688 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 698 if (bh) {
689 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 699 tag *t = (tag *)bh->b_data;
690 brelse(bh); 700 ident = le16_to_cpu(t->tagIdent);
701 location = le32_to_cpu(t->tagLocation);
702 brelse(bh);
703 }
691 } 704 }
692 705
693 if (ident == TAG_IDENT_AVDP && 706 if (ident == TAG_IDENT_AVDP &&
@@ -695,13 +708,15 @@ static void udf_find_anchor(struct super_block *sb)
695 lastblock = last[i]; 708 lastblock = last[i];
696 UDF_SB_ANCHOR(sb)[1] = last[i] - 256; 709 UDF_SB_ANCHOR(sb)[1] = last[i] - 256;
697 } else { 710 } else {
698 if (last[i] < 312 + UDF_SB_SESSION(sb) || 711 ident = location = 0;
699 !(bh = sb_bread(sb, last[i] - 312 - UDF_SB_SESSION(sb)))) { 712 if (last[i] >= 312 + UDF_SB_SESSION(sb)) {
700 ident = location = 0; 713 bh = sb_bread(sb, last[i] - 312 - UDF_SB_SESSION(sb));
701 } else { 714 if (bh) {
702 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 715 tag *t = (tag *)bh->b_data;
703 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 716 ident = le16_to_cpu(t->tagIdent);
704 brelse(bh); 717 location = le32_to_cpu(t->tagLocation);
718 brelse(bh);
719 }
705 } 720 }
706 721
707 if (ident == TAG_IDENT_AVDP && 722 if (ident == TAG_IDENT_AVDP &&
@@ -716,10 +731,12 @@ static void udf_find_anchor(struct super_block *sb)
716 } 731 }
717 732
718 if (!lastblock) { 733 if (!lastblock) {
719 /* We havn't found the lastblock. check 312 */ 734 /* We haven't found the lastblock. check 312 */
720 if ((bh = sb_bread(sb, 312 + UDF_SB_SESSION(sb)))) { 735 bh = sb_bread(sb, 312 + UDF_SB_SESSION(sb));
721 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 736 if (bh) {
722 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 737 tag *t = (tag *)bh->b_data;
738 ident = le16_to_cpu(t->tagIdent);
739 location = le32_to_cpu(t->tagLocation);
723 brelse(bh); 740 brelse(bh);
724 741
725 if (ident == TAG_IDENT_AVDP && location == 256) 742 if (ident == TAG_IDENT_AVDP && location == 256)
@@ -729,15 +746,15 @@ static void udf_find_anchor(struct super_block *sb)
729 746
730 for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) { 747 for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
731 if (UDF_SB_ANCHOR(sb)[i]) { 748 if (UDF_SB_ANCHOR(sb)[i]) {
732 if (!(bh = udf_read_tagged(sb, UDF_SB_ANCHOR(sb)[i], 749 bh = udf_read_tagged(sb, UDF_SB_ANCHOR(sb)[i],
733 UDF_SB_ANCHOR(sb)[i], &ident))) { 750 UDF_SB_ANCHOR(sb)[i], &ident);
751 if (!bh)
734 UDF_SB_ANCHOR(sb)[i] = 0; 752 UDF_SB_ANCHOR(sb)[i] = 0;
735 } else { 753 else {
736 brelse(bh); 754 brelse(bh);
737 if ((ident != TAG_IDENT_AVDP) && 755 if ((ident != TAG_IDENT_AVDP) &&
738 (i || (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE))) { 756 (i || (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE)))
739 UDF_SB_ANCHOR(sb)[i] = 0; 757 UDF_SB_ANCHOR(sb)[i] = 0;
740 }
741 } 758 }
742 } 759 }
743 } 760 }
@@ -745,7 +762,9 @@ static void udf_find_anchor(struct super_block *sb)
745 UDF_SB_LASTBLOCK(sb) = lastblock; 762 UDF_SB_LASTBLOCK(sb) = lastblock;
746} 763}
747 764
748static int udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr *root) 765static int udf_find_fileset(struct super_block *sb,
766 kernel_lb_addr *fileset,
767 kernel_lb_addr *root)
749{ 768{
750 struct buffer_head *bh = NULL; 769 struct buffer_head *bh = NULL;
751 long lastblock; 770 long lastblock;
@@ -764,7 +783,8 @@ static int udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, ker
764 783
765 } 784 }
766 785
767 if (!bh) { /* Search backwards through the partitions */ 786 if (!bh) {
787 /* Search backwards through the partitions */
768 kernel_lb_addr newfileset; 788 kernel_lb_addr newfileset;
769 789
770/* --> cvg: FIXME - is it reasonable? */ 790/* --> cvg: FIXME - is it reasonable? */
@@ -775,11 +795,13 @@ static int udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, ker
775 fileset->logicalBlockNum == 0xFFFFFFFF && 795 fileset->logicalBlockNum == 0xFFFFFFFF &&
776 fileset->partitionReferenceNum == 0xFFFF); 796 fileset->partitionReferenceNum == 0xFFFF);
777 newfileset.partitionReferenceNum--) { 797 newfileset.partitionReferenceNum--) {
778 lastblock = UDF_SB_PARTLEN(sb, newfileset.partitionReferenceNum); 798 lastblock = UDF_SB_PARTLEN(sb,
799 newfileset.partitionReferenceNum);
779 newfileset.logicalBlockNum = 0; 800 newfileset.logicalBlockNum = 0;
780 801
781 do { 802 do {
782 bh = udf_read_ptagged(sb, newfileset, 0, &ident); 803 bh = udf_read_ptagged(sb, newfileset, 0,
804 &ident);
783 if (!bh) { 805 if (!bh) {
784 newfileset.logicalBlockNum++; 806 newfileset.logicalBlockNum++;
785 continue; 807 continue;
@@ -840,7 +862,8 @@ static void udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh)
840 lets_to_cpu(pvoldesc->recordingDateAndTime))) { 862 lets_to_cpu(pvoldesc->recordingDateAndTime))) {
841 kernel_timestamp ts; 863 kernel_timestamp ts;
842 ts = lets_to_cpu(pvoldesc->recordingDateAndTime); 864 ts = lets_to_cpu(pvoldesc->recordingDateAndTime);
843 udf_debug("recording time %ld/%ld, %04u/%02u/%02u %02u:%02u (%x)\n", 865 udf_debug("recording time %ld/%ld, %04u/%02u/%02u"
866 " %02u:%02u (%x)\n",
844 recording, recording_usec, 867 recording, recording_usec,
845 ts.year, ts.month, ts.day, ts.hour, 868 ts.year, ts.month, ts.day, ts.hour,
846 ts.minute, ts.typeAndTimezone); 869 ts.minute, ts.typeAndTimezone);
@@ -888,19 +911,21 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
888 udf_debug("Searching map: (%d == %d)\n", 911 udf_debug("Searching map: (%d == %d)\n",
889 UDF_SB_PARTMAPS(sb)[i].s_partition_num, le16_to_cpu(p->partitionNumber)); 912 UDF_SB_PARTMAPS(sb)[i].s_partition_num, le16_to_cpu(p->partitionNumber));
890 if (UDF_SB_PARTMAPS(sb)[i].s_partition_num == le16_to_cpu(p->partitionNumber)) { 913 if (UDF_SB_PARTMAPS(sb)[i].s_partition_num == le16_to_cpu(p->partitionNumber)) {
891 UDF_SB_PARTLEN(sb,i) = le32_to_cpu(p->partitionLength); /* blocks */ 914 UDF_SB_PARTLEN(sb, i) = le32_to_cpu(p->partitionLength); /* blocks */
892 UDF_SB_PARTROOT(sb,i) = le32_to_cpu(p->partitionStartingLocation); 915 UDF_SB_PARTROOT(sb, i) = le32_to_cpu(p->partitionStartingLocation);
893 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_READ_ONLY) 916 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_READ_ONLY)
894 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_READ_ONLY; 917 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_READ_ONLY;
895 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_WRITE_ONCE) 918 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_WRITE_ONCE)
896 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_WRITE_ONCE; 919 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_WRITE_ONCE;
897 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_REWRITABLE) 920 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_REWRITABLE)
898 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_REWRITABLE; 921 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_REWRITABLE;
899 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_OVERWRITABLE) 922 if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_OVERWRITABLE)
900 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_OVERWRITABLE; 923 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_OVERWRITABLE;
901 924
902 if (!strcmp(p->partitionContents.ident, PD_PARTITION_CONTENTS_NSR02) || 925 if (!strcmp(p->partitionContents.ident,
903 !strcmp(p->partitionContents.ident, PD_PARTITION_CONTENTS_NSR03)) { 926 PD_PARTITION_CONTENTS_NSR02) ||
927 !strcmp(p->partitionContents.ident,
928 PD_PARTITION_CONTENTS_NSR03)) {
904 struct partitionHeaderDesc *phd; 929 struct partitionHeaderDesc *phd;
905 930
906 phd = (struct partitionHeaderDesc *)(p->partitionContentsUse); 931 phd = (struct partitionHeaderDesc *)(p->partitionContentsUse);
@@ -916,7 +941,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
916 udf_debug("cannot load unallocSpaceTable (part %d)\n", i); 941 udf_debug("cannot load unallocSpaceTable (part %d)\n", i);
917 return 1; 942 return 1;
918 } 943 }
919 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_UNALLOC_TABLE; 944 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_UNALLOC_TABLE;
920 udf_debug("unallocSpaceTable (part %d) @ %ld\n", 945 udf_debug("unallocSpaceTable (part %d) @ %ld\n",
921 i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table->i_ino); 946 i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table->i_ino);
922 } 947 }
@@ -927,7 +952,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
927 le32_to_cpu(phd->unallocSpaceBitmap.extLength); 952 le32_to_cpu(phd->unallocSpaceBitmap.extLength);
928 UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition = 953 UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition =
929 le32_to_cpu(phd->unallocSpaceBitmap.extPosition); 954 le32_to_cpu(phd->unallocSpaceBitmap.extPosition);
930 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_UNALLOC_BITMAP; 955 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_UNALLOC_BITMAP;
931 udf_debug("unallocSpaceBitmap (part %d) @ %d\n", 956 udf_debug("unallocSpaceBitmap (part %d) @ %d\n",
932 i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition); 957 i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition);
933 } 958 }
@@ -946,7 +971,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
946 udf_debug("cannot load freedSpaceTable (part %d)\n", i); 971 udf_debug("cannot load freedSpaceTable (part %d)\n", i);
947 return 1; 972 return 1;
948 } 973 }
949 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_FREED_TABLE; 974 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_FREED_TABLE;
950 udf_debug("freedSpaceTable (part %d) @ %ld\n", 975 udf_debug("freedSpaceTable (part %d) @ %ld\n",
951 i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table->i_ino); 976 i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table->i_ino);
952 } 977 }
@@ -957,7 +982,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
957 le32_to_cpu(phd->freedSpaceBitmap.extLength); 982 le32_to_cpu(phd->freedSpaceBitmap.extLength);
958 UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition = 983 UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition =
959 le32_to_cpu(phd->freedSpaceBitmap.extPosition); 984 le32_to_cpu(phd->freedSpaceBitmap.extPosition);
960 UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_FREED_BITMAP; 985 UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_FREED_BITMAP;
961 udf_debug("freedSpaceBitmap (part %d) @ %d\n", 986 udf_debug("freedSpaceBitmap (part %d) @ %d\n",
962 i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition); 987 i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition);
963 } 988 }
@@ -970,9 +995,11 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
970 udf_debug("Partition (%d) not found in partition map\n", 995 udf_debug("Partition (%d) not found in partition map\n",
971 le16_to_cpu(p->partitionNumber)); 996 le16_to_cpu(p->partitionNumber));
972 } else { 997 } else {
973 udf_debug("Partition (%d:%d type %x) starts at physical %d, block length %d\n", 998 udf_debug("Partition (%d:%d type %x) starts at physical %d, "
974 le16_to_cpu(p->partitionNumber), i, UDF_SB_PARTTYPE(sb,i), 999 "block length %d\n",
975 UDF_SB_PARTROOT(sb,i), UDF_SB_PARTLEN(sb,i)); 1000 le16_to_cpu(p->partitionNumber), i,
1001 UDF_SB_PARTTYPE(sb, i), UDF_SB_PARTROOT(sb, i),
1002 UDF_SB_PARTLEN(sb, i));
976 } 1003 }
977 return 0; 1004 return 0;
978} 1005}
@@ -994,19 +1021,19 @@ static int udf_load_logicalvol(struct super_block *sb, struct buffer_head *bh,
994 type = ((struct genericPartitionMap *)&(lvd->partitionMaps[offset]))->partitionMapType; 1021 type = ((struct genericPartitionMap *)&(lvd->partitionMaps[offset]))->partitionMapType;
995 if (type == 1) { 1022 if (type == 1) {
996 struct genericPartitionMap1 *gpm1 = (struct genericPartitionMap1 *)&(lvd->partitionMaps[offset]); 1023 struct genericPartitionMap1 *gpm1 = (struct genericPartitionMap1 *)&(lvd->partitionMaps[offset]);
997 UDF_SB_PARTTYPE(sb,i) = UDF_TYPE1_MAP15; 1024 UDF_SB_PARTTYPE(sb, i) = UDF_TYPE1_MAP15;
998 UDF_SB_PARTVSN(sb,i) = le16_to_cpu(gpm1->volSeqNum); 1025 UDF_SB_PARTVSN(sb, i) = le16_to_cpu(gpm1->volSeqNum);
999 UDF_SB_PARTNUM(sb,i) = le16_to_cpu(gpm1->partitionNum); 1026 UDF_SB_PARTNUM(sb, i) = le16_to_cpu(gpm1->partitionNum);
1000 UDF_SB_PARTFUNC(sb,i) = NULL; 1027 UDF_SB_PARTFUNC(sb, i) = NULL;
1001 } else if (type == 2) { 1028 } else if (type == 2) {
1002 struct udfPartitionMap2 *upm2 = (struct udfPartitionMap2 *)&(lvd->partitionMaps[offset]); 1029 struct udfPartitionMap2 *upm2 = (struct udfPartitionMap2 *)&(lvd->partitionMaps[offset]);
1003 if (!strncmp(upm2->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL))) { 1030 if (!strncmp(upm2->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL))) {
1004 if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0150) { 1031 if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0150) {
1005 UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP15; 1032 UDF_SB_PARTTYPE(sb, i) = UDF_VIRTUAL_MAP15;
1006 UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt15; 1033 UDF_SB_PARTFUNC(sb, i) = udf_get_pblock_virt15;
1007 } else if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0200) { 1034 } else if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0200) {
1008 UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP20; 1035 UDF_SB_PARTTYPE(sb, i) = UDF_VIRTUAL_MAP20;
1009 UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt20; 1036 UDF_SB_PARTFUNC(sb, i) = udf_get_pblock_virt20;
1010 } 1037 }
1011 } else if (!strncmp(upm2->partIdent.ident, UDF_ID_SPARABLE, strlen(UDF_ID_SPARABLE))) { 1038 } else if (!strncmp(upm2->partIdent.ident, UDF_ID_SPARABLE, strlen(UDF_ID_SPARABLE))) {
1012 uint32_t loc; 1039 uint32_t loc;
@@ -1014,39 +1041,41 @@ static int udf_load_logicalvol(struct super_block *sb, struct buffer_head *bh,
1014 struct sparingTable *st; 1041 struct sparingTable *st;
1015 struct sparablePartitionMap *spm = (struct sparablePartitionMap *)&(lvd->partitionMaps[offset]); 1042 struct sparablePartitionMap *spm = (struct sparablePartitionMap *)&(lvd->partitionMaps[offset]);
1016 1043
1017 UDF_SB_PARTTYPE(sb,i) = UDF_SPARABLE_MAP15; 1044 UDF_SB_PARTTYPE(sb, i) = UDF_SPARABLE_MAP15;
1018 UDF_SB_TYPESPAR(sb,i).s_packet_len = le16_to_cpu(spm->packetLength); 1045 UDF_SB_TYPESPAR(sb, i).s_packet_len = le16_to_cpu(spm->packetLength);
1019 for (j = 0; j < spm->numSparingTables; j++) { 1046 for (j = 0; j < spm->numSparingTables; j++) {
1020 loc = le32_to_cpu(spm->locSparingTable[j]); 1047 loc = le32_to_cpu(spm->locSparingTable[j]);
1021 UDF_SB_TYPESPAR(sb,i).s_spar_map[j] = 1048 UDF_SB_TYPESPAR(sb, i).s_spar_map[j] =
1022 udf_read_tagged(sb, loc, loc, &ident); 1049 udf_read_tagged(sb, loc, loc, &ident);
1023 if (UDF_SB_TYPESPAR(sb,i).s_spar_map[j] != NULL) { 1050 if (UDF_SB_TYPESPAR(sb, i).s_spar_map[j] != NULL) {
1024 st = (struct sparingTable *)UDF_SB_TYPESPAR(sb,i).s_spar_map[j]->b_data; 1051 st = (struct sparingTable *)UDF_SB_TYPESPAR(sb, i).s_spar_map[j]->b_data;
1025 if (ident != 0 || 1052 if (ident != 0 ||
1026 strncmp(st->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING))) { 1053 strncmp(st->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING))) {
1027 brelse(UDF_SB_TYPESPAR(sb,i).s_spar_map[j]); 1054 brelse(UDF_SB_TYPESPAR(sb, i).s_spar_map[j]);
1028 UDF_SB_TYPESPAR(sb,i).s_spar_map[j] = NULL; 1055 UDF_SB_TYPESPAR(sb, i).s_spar_map[j] = NULL;
1029 } 1056 }
1030 } 1057 }
1031 } 1058 }
1032 UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_spar15; 1059 UDF_SB_PARTFUNC(sb, i) = udf_get_pblock_spar15;
1033 } else { 1060 } else {
1034 udf_debug("Unknown ident: %s\n", upm2->partIdent.ident); 1061 udf_debug("Unknown ident: %s\n",
1062 upm2->partIdent.ident);
1035 continue; 1063 continue;
1036 } 1064 }
1037 UDF_SB_PARTVSN(sb,i) = le16_to_cpu(upm2->volSeqNum); 1065 UDF_SB_PARTVSN(sb, i) = le16_to_cpu(upm2->volSeqNum);
1038 UDF_SB_PARTNUM(sb,i) = le16_to_cpu(upm2->partitionNum); 1066 UDF_SB_PARTNUM(sb, i) = le16_to_cpu(upm2->partitionNum);
1039 } 1067 }
1040 udf_debug("Partition (%d:%d) type %d on volume %d\n", 1068 udf_debug("Partition (%d:%d) type %d on volume %d\n",
1041 i, UDF_SB_PARTNUM(sb,i), type, UDF_SB_PARTVSN(sb,i)); 1069 i, UDF_SB_PARTNUM(sb, i), type,
1070 UDF_SB_PARTVSN(sb, i));
1042 } 1071 }
1043 1072
1044 if (fileset) { 1073 if (fileset) {
1045 long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]); 1074 long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]);
1046 1075
1047 *fileset = lelb_to_cpu(la->extLocation); 1076 *fileset = lelb_to_cpu(la->extLocation);
1048 udf_debug("FileSet found in LogicalVolDesc at block=%d, partition=%d\n", 1077 udf_debug("FileSet found in LogicalVolDesc at block=%d, "
1049 fileset->logicalBlockNum, 1078 "partition=%d\n", fileset->logicalBlockNum,
1050 fileset->partitionReferenceNum); 1079 fileset->partitionReferenceNum);
1051 } 1080 }
1052 if (lvd->integritySeqExt.extLength) 1081 if (lvd->integritySeqExt.extLength)
@@ -1071,7 +1100,8 @@ static void udf_load_logicalvolint(struct super_block *sb, kernel_extent_ad loc)
1071 UDF_SB_LVIDBH(sb) = bh; 1100 UDF_SB_LVIDBH(sb) = bh;
1072 1101
1073 if (UDF_SB_LVID(sb)->nextIntegrityExt.extLength) 1102 if (UDF_SB_LVID(sb)->nextIntegrityExt.extLength)
1074 udf_load_logicalvolint(sb, leea_to_cpu(UDF_SB_LVID(sb)->nextIntegrityExt)); 1103 udf_load_logicalvolint(sb,
1104 leea_to_cpu(UDF_SB_LVID(sb)->nextIntegrityExt));
1075 1105
1076 if (UDF_SB_LVIDBH(sb) != bh) 1106 if (UDF_SB_LVIDBH(sb) != bh)
1077 brelse(bh); 1107 brelse(bh);
@@ -1097,8 +1127,8 @@ static void udf_load_logicalvolint(struct super_block *sb, kernel_extent_ad loc)
1097 * July 1, 1997 - Andrew E. Mileski 1127 * July 1, 1997 - Andrew E. Mileski
1098 * Written, tested, and released. 1128 * Written, tested, and released.
1099 */ 1129 */
1100static int udf_process_sequence(struct super_block *sb, long block, long lastblock, 1130static int udf_process_sequence(struct super_block *sb, long block,
1101 kernel_lb_addr *fileset) 1131 long lastblock, kernel_lb_addr *fileset)
1102{ 1132{
1103 struct buffer_head *bh = NULL; 1133 struct buffer_head *bh = NULL;
1104 struct udf_vds_record vds[VDS_POS_LENGTH]; 1134 struct udf_vds_record vds[VDS_POS_LENGTH];
@@ -1178,7 +1208,8 @@ static int udf_process_sequence(struct super_block *sb, long block, long lastblo
1178 } 1208 }
1179 for (i = 0; i < VDS_POS_LENGTH; i++) { 1209 for (i = 0; i < VDS_POS_LENGTH; i++) {
1180 if (vds[i].block) { 1210 if (vds[i].block) {
1181 bh = udf_read_tagged(sb, vds[i].block, vds[i].block, &ident); 1211 bh = udf_read_tagged(sb, vds[i].block, vds[i].block,
1212 &ident);
1182 1213
1183 if (i == VDS_POS_PRIMARY_VOL_DESC) { 1214 if (i == VDS_POS_PRIMARY_VOL_DESC) {
1184 udf_load_pvoldesc(sb, bh); 1215 udf_load_pvoldesc(sb, bh);
@@ -1190,11 +1221,14 @@ static int udf_process_sequence(struct super_block *sb, long block, long lastblo
1190 brelse(bh); 1221 brelse(bh);
1191 return 1; 1222 return 1;
1192 } 1223 }
1193 for (j = vds[i].block + 1; j < vds[VDS_POS_TERMINATING_DESC].block; j++) { 1224 for (j = vds[i].block + 1;
1225 j < vds[VDS_POS_TERMINATING_DESC].block;
1226 j++) {
1194 bh2 = udf_read_tagged(sb, j, j, &ident); 1227 bh2 = udf_read_tagged(sb, j, j, &ident);
1195 gd = (struct generic_desc *)bh2->b_data; 1228 gd = (struct generic_desc *)bh2->b_data;
1196 if (ident == TAG_IDENT_PD) 1229 if (ident == TAG_IDENT_PD)
1197 if (udf_load_partdesc(sb, bh2)) { 1230 if (udf_load_partdesc(sb,
1231 bh2)) {
1198 brelse(bh); 1232 brelse(bh);
1199 brelse(bh2); 1233 brelse(bh2);
1200 return 1; 1234 return 1;
@@ -1222,14 +1256,16 @@ static int udf_check_valid(struct super_block *sb, int novrs, int silent)
1222 } 1256 }
1223 /* Check that it is NSR02 compliant */ 1257 /* Check that it is NSR02 compliant */
1224 /* Process any "CD-ROM Volume Descriptor Set" (ECMA 167 2/8.3.1) */ 1258 /* Process any "CD-ROM Volume Descriptor Set" (ECMA 167 2/8.3.1) */
1225 else if ((block = udf_vrs(sb, silent)) == -1) { 1259 else {
1226 udf_debug("Failed to read byte 32768. Assuming open disc. " 1260 block = udf_vrs(sb, silent);
1227 "Skipping validity check\n"); 1261 if (block == -1) {
1228 if (!UDF_SB_LASTBLOCK(sb)) 1262 udf_debug("Failed to read byte 32768. Assuming open "
1229 UDF_SB_LASTBLOCK(sb) = udf_get_last_block(sb); 1263 "disc. Skipping validity check\n");
1230 return 0; 1264 if (!UDF_SB_LASTBLOCK(sb))
1231 } else { 1265 UDF_SB_LASTBLOCK(sb) = udf_get_last_block(sb);
1232 return !block; 1266 return 0;
1267 } else
1268 return !block;
1233 } 1269 }
1234} 1270}
1235 1271
@@ -1252,7 +1288,7 @@ static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1252 1288
1253 /* Locate the main sequence */ 1289 /* Locate the main sequence */
1254 main_s = le32_to_cpu(anchor->mainVolDescSeqExt.extLocation); 1290 main_s = le32_to_cpu(anchor->mainVolDescSeqExt.extLocation);
1255 main_e = le32_to_cpu(anchor->mainVolDescSeqExt.extLength ); 1291 main_e = le32_to_cpu(anchor->mainVolDescSeqExt.extLength);
1256 main_e = main_e >> sb->s_blocksize_bits; 1292 main_e = main_e >> sb->s_blocksize_bits;
1257 main_e += main_s; 1293 main_e += main_s;
1258 1294
@@ -1267,9 +1303,8 @@ static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1267 /* Process the main & reserve sequences */ 1303 /* Process the main & reserve sequences */
1268 /* responsible for finding the PartitionDesc(s) */ 1304 /* responsible for finding the PartitionDesc(s) */
1269 if (!(udf_process_sequence(sb, main_s, main_e, fileset) && 1305 if (!(udf_process_sequence(sb, main_s, main_e, fileset) &&
1270 udf_process_sequence(sb, reserve_s, reserve_e, fileset))) { 1306 udf_process_sequence(sb, reserve_s, reserve_e, fileset)))
1271 break; 1307 break;
1272 }
1273 } 1308 }
1274 } 1309 }
1275 1310
@@ -1308,7 +1343,8 @@ static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1308 if (j == UDF_SB_NUMPARTS(sb)) 1343 if (j == UDF_SB_NUMPARTS(sb))
1309 return 1; 1344 return 1;
1310 1345
1311 if (!(UDF_SB_VAT(sb) = udf_iget(sb, ino))) 1346 UDF_SB_VAT(sb) = udf_iget(sb, ino);
1347 if (!UDF_SB_VAT(sb))
1312 return 1; 1348 return 1;
1313 1349
1314 if (UDF_SB_PARTTYPE(sb, i) == UDF_VIRTUAL_MAP15) { 1350 if (UDF_SB_PARTTYPE(sb, i) == UDF_VIRTUAL_MAP15) {
@@ -1481,8 +1517,9 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1481 UDF_SB_ANCHOR(sb)[2] = uopt.anchor; 1517 UDF_SB_ANCHOR(sb)[2] = uopt.anchor;
1482 UDF_SB_ANCHOR(sb)[3] = 256; 1518 UDF_SB_ANCHOR(sb)[3] = 256;
1483 1519
1484 if (udf_check_valid(sb, uopt.novrs, silent)) { /* read volume recognition sequences */ 1520 if (udf_check_valid(sb, uopt.novrs, silent)) {
1485 printk("UDF-fs: No VRS found\n"); 1521 /* read volume recognition sequences */
1522 printk(KERN_WARNING "UDF-fs: No VRS found\n");
1486 goto error_out; 1523 goto error_out;
1487 } 1524 }
1488 1525
@@ -1496,7 +1533,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1496 sb->s_time_gran = 1000; 1533 sb->s_time_gran = 1000;
1497 1534
1498 if (udf_load_partition(sb, &fileset)) { 1535 if (udf_load_partition(sb, &fileset)) {
1499 printk("UDF-fs: No partition found (1)\n"); 1536 printk(KERN_WARNING "UDF-fs: No partition found (1)\n");
1500 goto error_out; 1537 goto error_out;
1501 } 1538 }
1502 1539
@@ -1508,7 +1545,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1508 /* uint16_t maxUDFWriteRev = le16_to_cpu(UDF_SB_LVIDIU(sb)->maxUDFWriteRev); */ 1545 /* uint16_t maxUDFWriteRev = le16_to_cpu(UDF_SB_LVIDIU(sb)->maxUDFWriteRev); */
1509 1546
1510 if (minUDFReadRev > UDF_MAX_READ_VERSION) { 1547 if (minUDFReadRev > UDF_MAX_READ_VERSION) {
1511 printk("UDF-fs: minUDFReadRev=%x (max is %x)\n", 1548 printk(KERN_ERR "UDF-fs: minUDFReadRev=%x (max is %x)\n",
1512 le16_to_cpu(UDF_SB_LVIDIU(sb)->minUDFReadRev), 1549 le16_to_cpu(UDF_SB_LVIDIU(sb)->minUDFReadRev),
1513 UDF_MAX_READ_VERSION); 1550 UDF_MAX_READ_VERSION);
1514 goto error_out; 1551 goto error_out;
@@ -1525,17 +1562,17 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1525 } 1562 }
1526 1563
1527 if (!UDF_SB_NUMPARTS(sb)) { 1564 if (!UDF_SB_NUMPARTS(sb)) {
1528 printk("UDF-fs: No partition found (2)\n"); 1565 printk(KERN_WARNING "UDF-fs: No partition found (2)\n");
1529 goto error_out; 1566 goto error_out;
1530 } 1567 }
1531 1568
1532 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_READ_ONLY) { 1569 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_READ_ONLY) {
1533 printk("UDF-fs: Partition marked readonly; forcing readonly mount\n"); 1570 printk(KERN_NOTICE "UDF-fs: Partition marked readonly; forcing readonly mount\n");
1534 sb->s_flags |= MS_RDONLY; 1571 sb->s_flags |= MS_RDONLY;
1535 } 1572 }
1536 1573
1537 if (udf_find_fileset(sb, &fileset, &rootdir)) { 1574 if (udf_find_fileset(sb, &fileset, &rootdir)) {
1538 printk("UDF-fs: No fileset found\n"); 1575 printk(KERN_WARNING "UDF-fs: No fileset found\n");
1539 goto error_out; 1576 goto error_out;
1540 } 1577 }
1541 1578
@@ -1556,7 +1593,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1556 /* perhaps it's not extensible enough, but for now ... */ 1593 /* perhaps it's not extensible enough, but for now ... */
1557 inode = udf_iget(sb, rootdir); 1594 inode = udf_iget(sb, rootdir);
1558 if (!inode) { 1595 if (!inode) {
1559 printk("UDF-fs: Error in udf_iget, block=%d, partition=%d\n", 1596 printk(KERN_ERR "UDF-fs: Error in udf_iget, block=%d, partition=%d\n",
1560 rootdir.logicalBlockNum, rootdir.partitionReferenceNum); 1597 rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
1561 goto error_out; 1598 goto error_out;
1562 } 1599 }
@@ -1564,7 +1601,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1564 /* Allocate a dentry for the root inode */ 1601 /* Allocate a dentry for the root inode */
1565 sb->s_root = d_alloc_root(inode); 1602 sb->s_root = d_alloc_root(inode);
1566 if (!sb->s_root) { 1603 if (!sb->s_root) {
1567 printk("UDF-fs: Couldn't allocate root dentry\n"); 1604 printk(KERN_ERR "UDF-fs: Couldn't allocate root dentry\n");
1568 iput(inode); 1605 iput(inode);
1569 goto error_out; 1606 goto error_out;
1570 } 1607 }
@@ -1580,9 +1617,9 @@ error_out:
1580 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE) 1617 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE)
1581 iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table); 1618 iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
1582 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP) 1619 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP)
1583 UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_uspace); 1620 UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_uspace);
1584 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP) 1621 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP)
1585 UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_fspace); 1622 UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_fspace);
1586 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) { 1623 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) {
1587 for (i = 0; i < 4; i++) 1624 for (i = 0; i < 4; i++)
1588 brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); 1625 brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
@@ -1614,7 +1651,7 @@ void udf_error(struct super_block *sb, const char *function,
1614 va_start(args, fmt); 1651 va_start(args, fmt);
1615 vsnprintf(error_buf, sizeof(error_buf), fmt, args); 1652 vsnprintf(error_buf, sizeof(error_buf), fmt, args);
1616 va_end(args); 1653 va_end(args);
1617 printk (KERN_CRIT "UDF-fs error (device %s): %s: %s\n", 1654 printk(KERN_CRIT "UDF-fs error (device %s): %s: %s\n",
1618 sb->s_id, function, error_buf); 1655 sb->s_id, function, error_buf);
1619} 1656}
1620 1657
@@ -1655,9 +1692,9 @@ static void udf_put_super(struct super_block *sb)
1655 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE) 1692 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE)
1656 iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table); 1693 iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
1657 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP) 1694 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP)
1658 UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_uspace); 1695 UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_uspace);
1659 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP) 1696 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP)
1660 UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_fspace); 1697 UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_fspace);
1661 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) { 1698 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) {
1662 for (i = 0; i < 4; i++) 1699 for (i = 0; i < 4; i++)
1663 brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); 1700 brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
@@ -1786,9 +1823,9 @@ static unsigned int udf_count_free_table(struct super_block *sb, struct inode *t
1786 epos.offset = sizeof(struct unallocSpaceEntry); 1823 epos.offset = sizeof(struct unallocSpaceEntry);
1787 epos.bh = NULL; 1824 epos.bh = NULL;
1788 1825
1789 while ((etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) { 1826 while ((etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1)
1790 accum += (elen >> table->i_sb->s_blocksize_bits); 1827 accum += (elen >> table->i_sb->s_blocksize_bits);
1791 } 1828
1792 brelse(epos.bh); 1829 brelse(epos.bh);
1793 1830
1794 unlock_kernel(); 1831 unlock_kernel();
@@ -1811,22 +1848,22 @@ static unsigned int udf_count_free(struct super_block *sb)
1811 if (accum) 1848 if (accum)
1812 return accum; 1849 return accum;
1813 1850
1814 if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP) { 1851 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP) {
1815 accum += udf_count_free_bitmap(sb, 1852 accum += udf_count_free_bitmap(sb,
1816 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_bitmap); 1853 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_bitmap);
1817 } 1854 }
1818 if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP) { 1855 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP) {
1819 accum += udf_count_free_bitmap(sb, 1856 accum += udf_count_free_bitmap(sb,
1820 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_bitmap); 1857 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_bitmap);
1821 } 1858 }
1822 if (accum) 1859 if (accum)
1823 return accum; 1860 return accum;
1824 1861
1825 if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_TABLE) { 1862 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_TABLE) {
1826 accum += udf_count_free_table(sb, 1863 accum += udf_count_free_table(sb,
1827 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_table); 1864 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_table);
1828 } 1865 }
1829 if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE) { 1866 if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE) {
1830 accum += udf_count_free_table(sb, 1867 accum += udf_count_free_table(sb,
1831 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table); 1868 UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
1832 } 1869 }