mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
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>
This commit is contained in:
parent
74bedc4d56
commit
3a71fc5de5
295
fs/udf/super.c
295
fs/udf/super.c
@ -33,8 +33,8 @@
|
|||||||
* 10/17/98 added freespace count for "df"
|
* 10/17/98 added freespace count for "df"
|
||||||
* 11/11/98 gr added novrs option
|
* 11/11/98 gr added novrs option
|
||||||
* 11/26/98 dgb added fileset,anchor mount options
|
* 11/26/98 dgb added fileset,anchor mount options
|
||||||
* 12/06/98 blf really hosed things royally. vat/sparing support. sequenced vol descs
|
* 12/06/98 blf really hosed things royally. vat/sparing support. sequenced
|
||||||
* rewrote option handling based on isofs
|
* vol descs. rewrote option handling based on isofs
|
||||||
* 12/20/98 find the free space bitmap (if it exists)
|
* 12/20/98 find the free space bitmap (if it exists)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ static struct kmem_cache *udf_inode_cachep;
|
|||||||
static struct inode *udf_alloc_inode(struct super_block *sb)
|
static struct inode *udf_alloc_inode(struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct udf_inode_info *ei;
|
struct udf_inode_info *ei;
|
||||||
ei = (struct udf_inode_info *)kmem_cache_alloc(udf_inode_cachep, GFP_KERNEL);
|
ei = kmem_cache_alloc(udf_inode_cachep, GFP_KERNEL);
|
||||||
if (!ei)
|
if (!ei)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -561,47 +561,52 @@ static int udf_vrs(struct super_block *sb, int silent)
|
|||||||
|
|
||||||
/* Look for ISO descriptors */
|
/* Look for ISO descriptors */
|
||||||
vsd = (struct volStructDesc *)(bh->b_data +
|
vsd = (struct volStructDesc *)(bh->b_data +
|
||||||
(sector & (sb->s_blocksize - 1)));
|
(sector & (sb->s_blocksize - 1)));
|
||||||
|
|
||||||
if (vsd->stdIdent[0] == 0) {
|
if (vsd->stdIdent[0] == 0) {
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
break;
|
break;
|
||||||
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001, VSD_STD_ID_LEN)) {
|
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001,
|
||||||
|
VSD_STD_ID_LEN)) {
|
||||||
iso9660 = sector;
|
iso9660 = sector;
|
||||||
switch (vsd->structType) {
|
switch (vsd->structType) {
|
||||||
case 0:
|
case 0:
|
||||||
udf_debug("ISO9660 Boot Record found\n");
|
udf_debug("ISO9660 Boot Record found\n");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
udf_debug
|
udf_debug("ISO9660 Primary Volume Descriptor "
|
||||||
("ISO9660 Primary Volume Descriptor found\n");
|
"found\n");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
udf_debug
|
udf_debug("ISO9660 Supplementary Volume "
|
||||||
("ISO9660 Supplementary Volume Descriptor found\n");
|
"Descriptor found\n");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
udf_debug
|
udf_debug("ISO9660 Volume Partition Descriptor "
|
||||||
("ISO9660 Volume Partition Descriptor found\n");
|
"found\n");
|
||||||
break;
|
break;
|
||||||
case 255:
|
case 255:
|
||||||
udf_debug
|
udf_debug("ISO9660 Volume Descriptor Set "
|
||||||
("ISO9660 Volume Descriptor Set Terminator found\n");
|
"Terminator found\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
udf_debug("ISO9660 VRS (%u) found\n",
|
udf_debug("ISO9660 VRS (%u) found\n",
|
||||||
vsd->structType);
|
vsd->structType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_BEA01, VSD_STD_ID_LEN)) {
|
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_BEA01,
|
||||||
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_TEA01, VSD_STD_ID_LEN)) {
|
VSD_STD_ID_LEN))
|
||||||
|
; /* nothing */
|
||||||
|
else if (!strncmp(vsd->stdIdent, VSD_STD_ID_TEA01,
|
||||||
|
VSD_STD_ID_LEN)) {
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
break;
|
break;
|
||||||
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR02, VSD_STD_ID_LEN)) {
|
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR02,
|
||||||
|
VSD_STD_ID_LEN))
|
||||||
nsr02 = sector;
|
nsr02 = sector;
|
||||||
} else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR03, VSD_STD_ID_LEN)) {
|
else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR03,
|
||||||
|
VSD_STD_ID_LEN))
|
||||||
nsr03 = sector;
|
nsr03 = sector;
|
||||||
}
|
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,21 +663,26 @@ static void udf_find_anchor(struct super_block *sb)
|
|||||||
* however, if the disc isn't closed, it could be 512 */
|
* however, if the disc isn't closed, it could be 512 */
|
||||||
|
|
||||||
for (i = 0; !lastblock && i < ARRAY_SIZE(last); i++) {
|
for (i = 0; !lastblock && i < ARRAY_SIZE(last); i++) {
|
||||||
if (last[i] < 0 || !(bh = sb_bread(sb, last[i]))) {
|
ident = location = 0;
|
||||||
ident = location = 0;
|
if (last[i] >= 0) {
|
||||||
} else {
|
bh = sb_bread(sb, last[i]);
|
||||||
ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
|
if (bh) {
|
||||||
location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
|
tag *t = (tag *)bh->b_data;
|
||||||
brelse(bh);
|
ident = le16_to_cpu(t->tagIdent);
|
||||||
|
location = le32_to_cpu(t->tagLocation);
|
||||||
|
brelse(bh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ident == TAG_IDENT_AVDP) {
|
if (ident == TAG_IDENT_AVDP) {
|
||||||
if (location == last[i] - UDF_SB_SESSION(sb)) {
|
if (location == last[i] - UDF_SB_SESSION(sb)) {
|
||||||
lastblock = UDF_SB_ANCHOR(sb)[0] = last[i] - UDF_SB_SESSION(sb);
|
lastblock = last[i] - UDF_SB_SESSION(sb);
|
||||||
UDF_SB_ANCHOR(sb)[1] = last[i] - 256 - UDF_SB_SESSION(sb);
|
UDF_SB_ANCHOR(sb)[0] = lastblock;
|
||||||
|
UDF_SB_ANCHOR(sb)[1] = lastblock - 256;
|
||||||
} else if (location == udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb)) {
|
} else if (location == udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb)) {
|
||||||
UDF_SET_FLAG(sb, UDF_FLAG_VARCONV);
|
UDF_SET_FLAG(sb, UDF_FLAG_VARCONV);
|
||||||
lastblock = UDF_SB_ANCHOR(sb)[0] = udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb);
|
lastblock = udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb);
|
||||||
|
UDF_SB_ANCHOR(sb)[0] = lastblock;
|
||||||
UDF_SB_ANCHOR(sb)[1] = lastblock - 256 - UDF_SB_SESSION(sb);
|
UDF_SB_ANCHOR(sb)[1] = lastblock - 256 - UDF_SB_SESSION(sb);
|
||||||
} else {
|
} else {
|
||||||
udf_debug("Anchor found at block %d, location mismatch %d.\n",
|
udf_debug("Anchor found at block %d, location mismatch %d.\n",
|
||||||
@ -682,12 +692,15 @@ static void udf_find_anchor(struct super_block *sb)
|
|||||||
lastblock = last[i];
|
lastblock = last[i];
|
||||||
UDF_SB_ANCHOR(sb)[3] = 512;
|
UDF_SB_ANCHOR(sb)[3] = 512;
|
||||||
} else {
|
} else {
|
||||||
if (last[i] < 256 || !(bh = sb_bread(sb, last[i] - 256))) {
|
ident = location = 0;
|
||||||
ident = location = 0;
|
if (last[i] >= 256) {
|
||||||
} else {
|
bh = sb_bread(sb, last[i] - 256);
|
||||||
ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
|
if (bh) {
|
||||||
location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
|
tag *t = (tag *)bh->b_data;
|
||||||
brelse(bh);
|
ident = le16_to_cpu(t->tagIdent);
|
||||||
|
location = le32_to_cpu(t->tagLocation);
|
||||||
|
brelse(bh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ident == TAG_IDENT_AVDP &&
|
if (ident == TAG_IDENT_AVDP &&
|
||||||
@ -695,13 +708,15 @@ static void udf_find_anchor(struct super_block *sb)
|
|||||||
lastblock = last[i];
|
lastblock = last[i];
|
||||||
UDF_SB_ANCHOR(sb)[1] = last[i] - 256;
|
UDF_SB_ANCHOR(sb)[1] = last[i] - 256;
|
||||||
} else {
|
} else {
|
||||||
if (last[i] < 312 + UDF_SB_SESSION(sb) ||
|
ident = location = 0;
|
||||||
!(bh = sb_bread(sb, last[i] - 312 - UDF_SB_SESSION(sb)))) {
|
if (last[i] >= 312 + UDF_SB_SESSION(sb)) {
|
||||||
ident = location = 0;
|
bh = sb_bread(sb, last[i] - 312 - UDF_SB_SESSION(sb));
|
||||||
} else {
|
if (bh) {
|
||||||
ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
|
tag *t = (tag *)bh->b_data;
|
||||||
location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
|
ident = le16_to_cpu(t->tagIdent);
|
||||||
brelse(bh);
|
location = le32_to_cpu(t->tagLocation);
|
||||||
|
brelse(bh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ident == TAG_IDENT_AVDP &&
|
if (ident == TAG_IDENT_AVDP &&
|
||||||
@ -716,10 +731,12 @@ static void udf_find_anchor(struct super_block *sb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!lastblock) {
|
if (!lastblock) {
|
||||||
/* We havn't found the lastblock. check 312 */
|
/* We haven't found the lastblock. check 312 */
|
||||||
if ((bh = sb_bread(sb, 312 + UDF_SB_SESSION(sb)))) {
|
bh = sb_bread(sb, 312 + UDF_SB_SESSION(sb));
|
||||||
ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
|
if (bh) {
|
||||||
location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
|
tag *t = (tag *)bh->b_data;
|
||||||
|
ident = le16_to_cpu(t->tagIdent);
|
||||||
|
location = le32_to_cpu(t->tagLocation);
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
|
|
||||||
if (ident == TAG_IDENT_AVDP && location == 256)
|
if (ident == TAG_IDENT_AVDP && location == 256)
|
||||||
@ -729,15 +746,15 @@ static void udf_find_anchor(struct super_block *sb)
|
|||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
|
for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
|
||||||
if (UDF_SB_ANCHOR(sb)[i]) {
|
if (UDF_SB_ANCHOR(sb)[i]) {
|
||||||
if (!(bh = udf_read_tagged(sb, UDF_SB_ANCHOR(sb)[i],
|
bh = udf_read_tagged(sb, UDF_SB_ANCHOR(sb)[i],
|
||||||
UDF_SB_ANCHOR(sb)[i], &ident))) {
|
UDF_SB_ANCHOR(sb)[i], &ident);
|
||||||
|
if (!bh)
|
||||||
UDF_SB_ANCHOR(sb)[i] = 0;
|
UDF_SB_ANCHOR(sb)[i] = 0;
|
||||||
} else {
|
else {
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
if ((ident != TAG_IDENT_AVDP) &&
|
if ((ident != TAG_IDENT_AVDP) &&
|
||||||
(i || (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE))) {
|
(i || (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE)))
|
||||||
UDF_SB_ANCHOR(sb)[i] = 0;
|
UDF_SB_ANCHOR(sb)[i] = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -745,7 +762,9 @@ static void udf_find_anchor(struct super_block *sb)
|
|||||||
UDF_SB_LASTBLOCK(sb) = lastblock;
|
UDF_SB_LASTBLOCK(sb) = lastblock;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr *root)
|
static int udf_find_fileset(struct super_block *sb,
|
||||||
|
kernel_lb_addr *fileset,
|
||||||
|
kernel_lb_addr *root)
|
||||||
{
|
{
|
||||||
struct buffer_head *bh = NULL;
|
struct buffer_head *bh = NULL;
|
||||||
long lastblock;
|
long lastblock;
|
||||||
@ -764,7 +783,8 @@ static int udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, ker
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bh) { /* Search backwards through the partitions */
|
if (!bh) {
|
||||||
|
/* Search backwards through the partitions */
|
||||||
kernel_lb_addr newfileset;
|
kernel_lb_addr newfileset;
|
||||||
|
|
||||||
/* --> cvg: FIXME - is it reasonable? */
|
/* --> cvg: FIXME - is it reasonable? */
|
||||||
@ -775,11 +795,13 @@ static int udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, ker
|
|||||||
fileset->logicalBlockNum == 0xFFFFFFFF &&
|
fileset->logicalBlockNum == 0xFFFFFFFF &&
|
||||||
fileset->partitionReferenceNum == 0xFFFF);
|
fileset->partitionReferenceNum == 0xFFFF);
|
||||||
newfileset.partitionReferenceNum--) {
|
newfileset.partitionReferenceNum--) {
|
||||||
lastblock = UDF_SB_PARTLEN(sb, newfileset.partitionReferenceNum);
|
lastblock = UDF_SB_PARTLEN(sb,
|
||||||
|
newfileset.partitionReferenceNum);
|
||||||
newfileset.logicalBlockNum = 0;
|
newfileset.logicalBlockNum = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
bh = udf_read_ptagged(sb, newfileset, 0, &ident);
|
bh = udf_read_ptagged(sb, newfileset, 0,
|
||||||
|
&ident);
|
||||||
if (!bh) {
|
if (!bh) {
|
||||||
newfileset.logicalBlockNum++;
|
newfileset.logicalBlockNum++;
|
||||||
continue;
|
continue;
|
||||||
@ -840,7 +862,8 @@ static void udf_load_pvoldesc(struct super_block *sb, struct buffer_head *bh)
|
|||||||
lets_to_cpu(pvoldesc->recordingDateAndTime))) {
|
lets_to_cpu(pvoldesc->recordingDateAndTime))) {
|
||||||
kernel_timestamp ts;
|
kernel_timestamp ts;
|
||||||
ts = lets_to_cpu(pvoldesc->recordingDateAndTime);
|
ts = lets_to_cpu(pvoldesc->recordingDateAndTime);
|
||||||
udf_debug("recording time %ld/%ld, %04u/%02u/%02u %02u:%02u (%x)\n",
|
udf_debug("recording time %ld/%ld, %04u/%02u/%02u"
|
||||||
|
" %02u:%02u (%x)\n",
|
||||||
recording, recording_usec,
|
recording, recording_usec,
|
||||||
ts.year, ts.month, ts.day, ts.hour,
|
ts.year, ts.month, ts.day, ts.hour,
|
||||||
ts.minute, ts.typeAndTimezone);
|
ts.minute, ts.typeAndTimezone);
|
||||||
@ -888,19 +911,21 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
|
|||||||
udf_debug("Searching map: (%d == %d)\n",
|
udf_debug("Searching map: (%d == %d)\n",
|
||||||
UDF_SB_PARTMAPS(sb)[i].s_partition_num, le16_to_cpu(p->partitionNumber));
|
UDF_SB_PARTMAPS(sb)[i].s_partition_num, le16_to_cpu(p->partitionNumber));
|
||||||
if (UDF_SB_PARTMAPS(sb)[i].s_partition_num == le16_to_cpu(p->partitionNumber)) {
|
if (UDF_SB_PARTMAPS(sb)[i].s_partition_num == le16_to_cpu(p->partitionNumber)) {
|
||||||
UDF_SB_PARTLEN(sb,i) = le32_to_cpu(p->partitionLength); /* blocks */
|
UDF_SB_PARTLEN(sb, i) = le32_to_cpu(p->partitionLength); /* blocks */
|
||||||
UDF_SB_PARTROOT(sb,i) = le32_to_cpu(p->partitionStartingLocation);
|
UDF_SB_PARTROOT(sb, i) = le32_to_cpu(p->partitionStartingLocation);
|
||||||
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_READ_ONLY)
|
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_READ_ONLY)
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_READ_ONLY;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_READ_ONLY;
|
||||||
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_WRITE_ONCE)
|
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_WRITE_ONCE)
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_WRITE_ONCE;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_WRITE_ONCE;
|
||||||
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_REWRITABLE)
|
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_REWRITABLE)
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_REWRITABLE;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_REWRITABLE;
|
||||||
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_OVERWRITABLE)
|
if (le32_to_cpu(p->accessType) == PD_ACCESS_TYPE_OVERWRITABLE)
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_OVERWRITABLE;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_OVERWRITABLE;
|
||||||
|
|
||||||
if (!strcmp(p->partitionContents.ident, PD_PARTITION_CONTENTS_NSR02) ||
|
if (!strcmp(p->partitionContents.ident,
|
||||||
!strcmp(p->partitionContents.ident, PD_PARTITION_CONTENTS_NSR03)) {
|
PD_PARTITION_CONTENTS_NSR02) ||
|
||||||
|
!strcmp(p->partitionContents.ident,
|
||||||
|
PD_PARTITION_CONTENTS_NSR03)) {
|
||||||
struct partitionHeaderDesc *phd;
|
struct partitionHeaderDesc *phd;
|
||||||
|
|
||||||
phd = (struct partitionHeaderDesc *)(p->partitionContentsUse);
|
phd = (struct partitionHeaderDesc *)(p->partitionContentsUse);
|
||||||
@ -916,7 +941,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
|
|||||||
udf_debug("cannot load unallocSpaceTable (part %d)\n", i);
|
udf_debug("cannot load unallocSpaceTable (part %d)\n", i);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_UNALLOC_TABLE;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_UNALLOC_TABLE;
|
||||||
udf_debug("unallocSpaceTable (part %d) @ %ld\n",
|
udf_debug("unallocSpaceTable (part %d) @ %ld\n",
|
||||||
i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table->i_ino);
|
i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_table->i_ino);
|
||||||
}
|
}
|
||||||
@ -927,7 +952,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
|
|||||||
le32_to_cpu(phd->unallocSpaceBitmap.extLength);
|
le32_to_cpu(phd->unallocSpaceBitmap.extLength);
|
||||||
UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition =
|
UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition =
|
||||||
le32_to_cpu(phd->unallocSpaceBitmap.extPosition);
|
le32_to_cpu(phd->unallocSpaceBitmap.extPosition);
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_UNALLOC_BITMAP;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_UNALLOC_BITMAP;
|
||||||
udf_debug("unallocSpaceBitmap (part %d) @ %d\n",
|
udf_debug("unallocSpaceBitmap (part %d) @ %d\n",
|
||||||
i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition);
|
i, UDF_SB_PARTMAPS(sb)[i].s_uspace.s_bitmap->s_extPosition);
|
||||||
}
|
}
|
||||||
@ -946,7 +971,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
|
|||||||
udf_debug("cannot load freedSpaceTable (part %d)\n", i);
|
udf_debug("cannot load freedSpaceTable (part %d)\n", i);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_FREED_TABLE;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_FREED_TABLE;
|
||||||
udf_debug("freedSpaceTable (part %d) @ %ld\n",
|
udf_debug("freedSpaceTable (part %d) @ %ld\n",
|
||||||
i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table->i_ino);
|
i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_table->i_ino);
|
||||||
}
|
}
|
||||||
@ -957,7 +982,7 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
|
|||||||
le32_to_cpu(phd->freedSpaceBitmap.extLength);
|
le32_to_cpu(phd->freedSpaceBitmap.extLength);
|
||||||
UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition =
|
UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition =
|
||||||
le32_to_cpu(phd->freedSpaceBitmap.extPosition);
|
le32_to_cpu(phd->freedSpaceBitmap.extPosition);
|
||||||
UDF_SB_PARTFLAGS(sb,i) |= UDF_PART_FLAG_FREED_BITMAP;
|
UDF_SB_PARTFLAGS(sb, i) |= UDF_PART_FLAG_FREED_BITMAP;
|
||||||
udf_debug("freedSpaceBitmap (part %d) @ %d\n",
|
udf_debug("freedSpaceBitmap (part %d) @ %d\n",
|
||||||
i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition);
|
i, UDF_SB_PARTMAPS(sb)[i].s_fspace.s_bitmap->s_extPosition);
|
||||||
}
|
}
|
||||||
@ -970,9 +995,11 @@ static int udf_load_partdesc(struct super_block *sb, struct buffer_head *bh)
|
|||||||
udf_debug("Partition (%d) not found in partition map\n",
|
udf_debug("Partition (%d) not found in partition map\n",
|
||||||
le16_to_cpu(p->partitionNumber));
|
le16_to_cpu(p->partitionNumber));
|
||||||
} else {
|
} else {
|
||||||
udf_debug("Partition (%d:%d type %x) starts at physical %d, block length %d\n",
|
udf_debug("Partition (%d:%d type %x) starts at physical %d, "
|
||||||
le16_to_cpu(p->partitionNumber), i, UDF_SB_PARTTYPE(sb,i),
|
"block length %d\n",
|
||||||
UDF_SB_PARTROOT(sb,i), UDF_SB_PARTLEN(sb,i));
|
le16_to_cpu(p->partitionNumber), i,
|
||||||
|
UDF_SB_PARTTYPE(sb, i), UDF_SB_PARTROOT(sb, i),
|
||||||
|
UDF_SB_PARTLEN(sb, i));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -994,19 +1021,19 @@ static int udf_load_logicalvol(struct super_block *sb, struct buffer_head *bh,
|
|||||||
type = ((struct genericPartitionMap *)&(lvd->partitionMaps[offset]))->partitionMapType;
|
type = ((struct genericPartitionMap *)&(lvd->partitionMaps[offset]))->partitionMapType;
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
struct genericPartitionMap1 *gpm1 = (struct genericPartitionMap1 *)&(lvd->partitionMaps[offset]);
|
struct genericPartitionMap1 *gpm1 = (struct genericPartitionMap1 *)&(lvd->partitionMaps[offset]);
|
||||||
UDF_SB_PARTTYPE(sb,i) = UDF_TYPE1_MAP15;
|
UDF_SB_PARTTYPE(sb, i) = UDF_TYPE1_MAP15;
|
||||||
UDF_SB_PARTVSN(sb,i) = le16_to_cpu(gpm1->volSeqNum);
|
UDF_SB_PARTVSN(sb, i) = le16_to_cpu(gpm1->volSeqNum);
|
||||||
UDF_SB_PARTNUM(sb,i) = le16_to_cpu(gpm1->partitionNum);
|
UDF_SB_PARTNUM(sb, i) = le16_to_cpu(gpm1->partitionNum);
|
||||||
UDF_SB_PARTFUNC(sb,i) = NULL;
|
UDF_SB_PARTFUNC(sb, i) = NULL;
|
||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
struct udfPartitionMap2 *upm2 = (struct udfPartitionMap2 *)&(lvd->partitionMaps[offset]);
|
struct udfPartitionMap2 *upm2 = (struct udfPartitionMap2 *)&(lvd->partitionMaps[offset]);
|
||||||
if (!strncmp(upm2->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL))) {
|
if (!strncmp(upm2->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL))) {
|
||||||
if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0150) {
|
if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0150) {
|
||||||
UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP15;
|
UDF_SB_PARTTYPE(sb, i) = UDF_VIRTUAL_MAP15;
|
||||||
UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt15;
|
UDF_SB_PARTFUNC(sb, i) = udf_get_pblock_virt15;
|
||||||
} else if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0200) {
|
} else if (le16_to_cpu(((__le16 *)upm2->partIdent.identSuffix)[0]) == 0x0200) {
|
||||||
UDF_SB_PARTTYPE(sb,i) = UDF_VIRTUAL_MAP20;
|
UDF_SB_PARTTYPE(sb, i) = UDF_VIRTUAL_MAP20;
|
||||||
UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_virt20;
|
UDF_SB_PARTFUNC(sb, i) = udf_get_pblock_virt20;
|
||||||
}
|
}
|
||||||
} else if (!strncmp(upm2->partIdent.ident, UDF_ID_SPARABLE, strlen(UDF_ID_SPARABLE))) {
|
} else if (!strncmp(upm2->partIdent.ident, UDF_ID_SPARABLE, strlen(UDF_ID_SPARABLE))) {
|
||||||
uint32_t loc;
|
uint32_t loc;
|
||||||
@ -1014,39 +1041,41 @@ static int udf_load_logicalvol(struct super_block *sb, struct buffer_head *bh,
|
|||||||
struct sparingTable *st;
|
struct sparingTable *st;
|
||||||
struct sparablePartitionMap *spm = (struct sparablePartitionMap *)&(lvd->partitionMaps[offset]);
|
struct sparablePartitionMap *spm = (struct sparablePartitionMap *)&(lvd->partitionMaps[offset]);
|
||||||
|
|
||||||
UDF_SB_PARTTYPE(sb,i) = UDF_SPARABLE_MAP15;
|
UDF_SB_PARTTYPE(sb, i) = UDF_SPARABLE_MAP15;
|
||||||
UDF_SB_TYPESPAR(sb,i).s_packet_len = le16_to_cpu(spm->packetLength);
|
UDF_SB_TYPESPAR(sb, i).s_packet_len = le16_to_cpu(spm->packetLength);
|
||||||
for (j = 0; j < spm->numSparingTables; j++) {
|
for (j = 0; j < spm->numSparingTables; j++) {
|
||||||
loc = le32_to_cpu(spm->locSparingTable[j]);
|
loc = le32_to_cpu(spm->locSparingTable[j]);
|
||||||
UDF_SB_TYPESPAR(sb,i).s_spar_map[j] =
|
UDF_SB_TYPESPAR(sb, i).s_spar_map[j] =
|
||||||
udf_read_tagged(sb, loc, loc, &ident);
|
udf_read_tagged(sb, loc, loc, &ident);
|
||||||
if (UDF_SB_TYPESPAR(sb,i).s_spar_map[j] != NULL) {
|
if (UDF_SB_TYPESPAR(sb, i).s_spar_map[j] != NULL) {
|
||||||
st = (struct sparingTable *)UDF_SB_TYPESPAR(sb,i).s_spar_map[j]->b_data;
|
st = (struct sparingTable *)UDF_SB_TYPESPAR(sb, i).s_spar_map[j]->b_data;
|
||||||
if (ident != 0 ||
|
if (ident != 0 ||
|
||||||
strncmp(st->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING))) {
|
strncmp(st->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING))) {
|
||||||
brelse(UDF_SB_TYPESPAR(sb,i).s_spar_map[j]);
|
brelse(UDF_SB_TYPESPAR(sb, i).s_spar_map[j]);
|
||||||
UDF_SB_TYPESPAR(sb,i).s_spar_map[j] = NULL;
|
UDF_SB_TYPESPAR(sb, i).s_spar_map[j] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UDF_SB_PARTFUNC(sb,i) = udf_get_pblock_spar15;
|
UDF_SB_PARTFUNC(sb, i) = udf_get_pblock_spar15;
|
||||||
} else {
|
} else {
|
||||||
udf_debug("Unknown ident: %s\n", upm2->partIdent.ident);
|
udf_debug("Unknown ident: %s\n",
|
||||||
|
upm2->partIdent.ident);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
UDF_SB_PARTVSN(sb,i) = le16_to_cpu(upm2->volSeqNum);
|
UDF_SB_PARTVSN(sb, i) = le16_to_cpu(upm2->volSeqNum);
|
||||||
UDF_SB_PARTNUM(sb,i) = le16_to_cpu(upm2->partitionNum);
|
UDF_SB_PARTNUM(sb, i) = le16_to_cpu(upm2->partitionNum);
|
||||||
}
|
}
|
||||||
udf_debug("Partition (%d:%d) type %d on volume %d\n",
|
udf_debug("Partition (%d:%d) type %d on volume %d\n",
|
||||||
i, UDF_SB_PARTNUM(sb,i), type, UDF_SB_PARTVSN(sb,i));
|
i, UDF_SB_PARTNUM(sb, i), type,
|
||||||
|
UDF_SB_PARTVSN(sb, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileset) {
|
if (fileset) {
|
||||||
long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]);
|
long_ad *la = (long_ad *)&(lvd->logicalVolContentsUse[0]);
|
||||||
|
|
||||||
*fileset = lelb_to_cpu(la->extLocation);
|
*fileset = lelb_to_cpu(la->extLocation);
|
||||||
udf_debug("FileSet found in LogicalVolDesc at block=%d, partition=%d\n",
|
udf_debug("FileSet found in LogicalVolDesc at block=%d, "
|
||||||
fileset->logicalBlockNum,
|
"partition=%d\n", fileset->logicalBlockNum,
|
||||||
fileset->partitionReferenceNum);
|
fileset->partitionReferenceNum);
|
||||||
}
|
}
|
||||||
if (lvd->integritySeqExt.extLength)
|
if (lvd->integritySeqExt.extLength)
|
||||||
@ -1071,7 +1100,8 @@ static void udf_load_logicalvolint(struct super_block *sb, kernel_extent_ad loc)
|
|||||||
UDF_SB_LVIDBH(sb) = bh;
|
UDF_SB_LVIDBH(sb) = bh;
|
||||||
|
|
||||||
if (UDF_SB_LVID(sb)->nextIntegrityExt.extLength)
|
if (UDF_SB_LVID(sb)->nextIntegrityExt.extLength)
|
||||||
udf_load_logicalvolint(sb, leea_to_cpu(UDF_SB_LVID(sb)->nextIntegrityExt));
|
udf_load_logicalvolint(sb,
|
||||||
|
leea_to_cpu(UDF_SB_LVID(sb)->nextIntegrityExt));
|
||||||
|
|
||||||
if (UDF_SB_LVIDBH(sb) != bh)
|
if (UDF_SB_LVIDBH(sb) != bh)
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
@ -1097,8 +1127,8 @@ static void udf_load_logicalvolint(struct super_block *sb, kernel_extent_ad loc)
|
|||||||
* July 1, 1997 - Andrew E. Mileski
|
* July 1, 1997 - Andrew E. Mileski
|
||||||
* Written, tested, and released.
|
* Written, tested, and released.
|
||||||
*/
|
*/
|
||||||
static int udf_process_sequence(struct super_block *sb, long block, long lastblock,
|
static int udf_process_sequence(struct super_block *sb, long block,
|
||||||
kernel_lb_addr *fileset)
|
long lastblock, kernel_lb_addr *fileset)
|
||||||
{
|
{
|
||||||
struct buffer_head *bh = NULL;
|
struct buffer_head *bh = NULL;
|
||||||
struct udf_vds_record vds[VDS_POS_LENGTH];
|
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
|
|||||||
}
|
}
|
||||||
for (i = 0; i < VDS_POS_LENGTH; i++) {
|
for (i = 0; i < VDS_POS_LENGTH; i++) {
|
||||||
if (vds[i].block) {
|
if (vds[i].block) {
|
||||||
bh = udf_read_tagged(sb, vds[i].block, vds[i].block, &ident);
|
bh = udf_read_tagged(sb, vds[i].block, vds[i].block,
|
||||||
|
&ident);
|
||||||
|
|
||||||
if (i == VDS_POS_PRIMARY_VOL_DESC) {
|
if (i == VDS_POS_PRIMARY_VOL_DESC) {
|
||||||
udf_load_pvoldesc(sb, bh);
|
udf_load_pvoldesc(sb, bh);
|
||||||
@ -1190,11 +1221,14 @@ static int udf_process_sequence(struct super_block *sb, long block, long lastblo
|
|||||||
brelse(bh);
|
brelse(bh);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (j = vds[i].block + 1; j < vds[VDS_POS_TERMINATING_DESC].block; j++) {
|
for (j = vds[i].block + 1;
|
||||||
|
j < vds[VDS_POS_TERMINATING_DESC].block;
|
||||||
|
j++) {
|
||||||
bh2 = udf_read_tagged(sb, j, j, &ident);
|
bh2 = udf_read_tagged(sb, j, j, &ident);
|
||||||
gd = (struct generic_desc *)bh2->b_data;
|
gd = (struct generic_desc *)bh2->b_data;
|
||||||
if (ident == TAG_IDENT_PD)
|
if (ident == TAG_IDENT_PD)
|
||||||
if (udf_load_partdesc(sb, bh2)) {
|
if (udf_load_partdesc(sb,
|
||||||
|
bh2)) {
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
brelse(bh2);
|
brelse(bh2);
|
||||||
return 1;
|
return 1;
|
||||||
@ -1222,14 +1256,16 @@ static int udf_check_valid(struct super_block *sb, int novrs, int silent)
|
|||||||
}
|
}
|
||||||
/* Check that it is NSR02 compliant */
|
/* Check that it is NSR02 compliant */
|
||||||
/* Process any "CD-ROM Volume Descriptor Set" (ECMA 167 2/8.3.1) */
|
/* Process any "CD-ROM Volume Descriptor Set" (ECMA 167 2/8.3.1) */
|
||||||
else if ((block = udf_vrs(sb, silent)) == -1) {
|
else {
|
||||||
udf_debug("Failed to read byte 32768. Assuming open disc. "
|
block = udf_vrs(sb, silent);
|
||||||
"Skipping validity check\n");
|
if (block == -1) {
|
||||||
if (!UDF_SB_LASTBLOCK(sb))
|
udf_debug("Failed to read byte 32768. Assuming open "
|
||||||
UDF_SB_LASTBLOCK(sb) = udf_get_last_block(sb);
|
"disc. Skipping validity check\n");
|
||||||
return 0;
|
if (!UDF_SB_LASTBLOCK(sb))
|
||||||
} else {
|
UDF_SB_LASTBLOCK(sb) = udf_get_last_block(sb);
|
||||||
return !block;
|
return 0;
|
||||||
|
} else
|
||||||
|
return !block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1252,7 +1288,7 @@ static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
|
|||||||
|
|
||||||
/* Locate the main sequence */
|
/* Locate the main sequence */
|
||||||
main_s = le32_to_cpu(anchor->mainVolDescSeqExt.extLocation);
|
main_s = le32_to_cpu(anchor->mainVolDescSeqExt.extLocation);
|
||||||
main_e = le32_to_cpu(anchor->mainVolDescSeqExt.extLength );
|
main_e = le32_to_cpu(anchor->mainVolDescSeqExt.extLength);
|
||||||
main_e = main_e >> sb->s_blocksize_bits;
|
main_e = main_e >> sb->s_blocksize_bits;
|
||||||
main_e += main_s;
|
main_e += main_s;
|
||||||
|
|
||||||
@ -1267,9 +1303,8 @@ static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
|
|||||||
/* Process the main & reserve sequences */
|
/* Process the main & reserve sequences */
|
||||||
/* responsible for finding the PartitionDesc(s) */
|
/* responsible for finding the PartitionDesc(s) */
|
||||||
if (!(udf_process_sequence(sb, main_s, main_e, fileset) &&
|
if (!(udf_process_sequence(sb, main_s, main_e, fileset) &&
|
||||||
udf_process_sequence(sb, reserve_s, reserve_e, fileset))) {
|
udf_process_sequence(sb, reserve_s, reserve_e, fileset)))
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1308,7 +1343,8 @@ static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
|
|||||||
if (j == UDF_SB_NUMPARTS(sb))
|
if (j == UDF_SB_NUMPARTS(sb))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!(UDF_SB_VAT(sb) = udf_iget(sb, ino)))
|
UDF_SB_VAT(sb) = udf_iget(sb, ino);
|
||||||
|
if (!UDF_SB_VAT(sb))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (UDF_SB_PARTTYPE(sb, i) == UDF_VIRTUAL_MAP15) {
|
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)
|
|||||||
UDF_SB_ANCHOR(sb)[2] = uopt.anchor;
|
UDF_SB_ANCHOR(sb)[2] = uopt.anchor;
|
||||||
UDF_SB_ANCHOR(sb)[3] = 256;
|
UDF_SB_ANCHOR(sb)[3] = 256;
|
||||||
|
|
||||||
if (udf_check_valid(sb, uopt.novrs, silent)) { /* read volume recognition sequences */
|
if (udf_check_valid(sb, uopt.novrs, silent)) {
|
||||||
printk("UDF-fs: No VRS found\n");
|
/* read volume recognition sequences */
|
||||||
|
printk(KERN_WARNING "UDF-fs: No VRS found\n");
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1496,7 +1533,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
|
|||||||
sb->s_time_gran = 1000;
|
sb->s_time_gran = 1000;
|
||||||
|
|
||||||
if (udf_load_partition(sb, &fileset)) {
|
if (udf_load_partition(sb, &fileset)) {
|
||||||
printk("UDF-fs: No partition found (1)\n");
|
printk(KERN_WARNING "UDF-fs: No partition found (1)\n");
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1508,7 +1545,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
|
|||||||
/* uint16_t maxUDFWriteRev = le16_to_cpu(UDF_SB_LVIDIU(sb)->maxUDFWriteRev); */
|
/* uint16_t maxUDFWriteRev = le16_to_cpu(UDF_SB_LVIDIU(sb)->maxUDFWriteRev); */
|
||||||
|
|
||||||
if (minUDFReadRev > UDF_MAX_READ_VERSION) {
|
if (minUDFReadRev > UDF_MAX_READ_VERSION) {
|
||||||
printk("UDF-fs: minUDFReadRev=%x (max is %x)\n",
|
printk(KERN_ERR "UDF-fs: minUDFReadRev=%x (max is %x)\n",
|
||||||
le16_to_cpu(UDF_SB_LVIDIU(sb)->minUDFReadRev),
|
le16_to_cpu(UDF_SB_LVIDIU(sb)->minUDFReadRev),
|
||||||
UDF_MAX_READ_VERSION);
|
UDF_MAX_READ_VERSION);
|
||||||
goto error_out;
|
goto error_out;
|
||||||
@ -1525,17 +1562,17 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!UDF_SB_NUMPARTS(sb)) {
|
if (!UDF_SB_NUMPARTS(sb)) {
|
||||||
printk("UDF-fs: No partition found (2)\n");
|
printk(KERN_WARNING "UDF-fs: No partition found (2)\n");
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_READ_ONLY) {
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_READ_ONLY) {
|
||||||
printk("UDF-fs: Partition marked readonly; forcing readonly mount\n");
|
printk(KERN_NOTICE "UDF-fs: Partition marked readonly; forcing readonly mount\n");
|
||||||
sb->s_flags |= MS_RDONLY;
|
sb->s_flags |= MS_RDONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (udf_find_fileset(sb, &fileset, &rootdir)) {
|
if (udf_find_fileset(sb, &fileset, &rootdir)) {
|
||||||
printk("UDF-fs: No fileset found\n");
|
printk(KERN_WARNING "UDF-fs: No fileset found\n");
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1556,7 +1593,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
|
|||||||
/* perhaps it's not extensible enough, but for now ... */
|
/* perhaps it's not extensible enough, but for now ... */
|
||||||
inode = udf_iget(sb, rootdir);
|
inode = udf_iget(sb, rootdir);
|
||||||
if (!inode) {
|
if (!inode) {
|
||||||
printk("UDF-fs: Error in udf_iget, block=%d, partition=%d\n",
|
printk(KERN_ERR "UDF-fs: Error in udf_iget, block=%d, partition=%d\n",
|
||||||
rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
|
rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
@ -1564,7 +1601,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
|
|||||||
/* Allocate a dentry for the root inode */
|
/* Allocate a dentry for the root inode */
|
||||||
sb->s_root = d_alloc_root(inode);
|
sb->s_root = d_alloc_root(inode);
|
||||||
if (!sb->s_root) {
|
if (!sb->s_root) {
|
||||||
printk("UDF-fs: Couldn't allocate root dentry\n");
|
printk(KERN_ERR "UDF-fs: Couldn't allocate root dentry\n");
|
||||||
iput(inode);
|
iput(inode);
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
@ -1580,9 +1617,9 @@ error_out:
|
|||||||
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE)
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE)
|
||||||
iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
|
iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
|
||||||
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP)
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP)
|
||||||
UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_uspace);
|
UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_uspace);
|
||||||
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP)
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP)
|
||||||
UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_fspace);
|
UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_fspace);
|
||||||
if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) {
|
if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) {
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
|
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,
|
|||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
vsnprintf(error_buf, sizeof(error_buf), fmt, args);
|
vsnprintf(error_buf, sizeof(error_buf), fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
printk (KERN_CRIT "UDF-fs error (device %s): %s: %s\n",
|
printk(KERN_CRIT "UDF-fs error (device %s): %s: %s\n",
|
||||||
sb->s_id, function, error_buf);
|
sb->s_id, function, error_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1655,9 +1692,9 @@ static void udf_put_super(struct super_block *sb)
|
|||||||
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE)
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE)
|
||||||
iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
|
iput(UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
|
||||||
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP)
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP)
|
||||||
UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_uspace);
|
UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_uspace);
|
||||||
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP)
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP)
|
||||||
UDF_SB_FREE_BITMAP(sb,UDF_SB_PARTITION(sb), s_fspace);
|
UDF_SB_FREE_BITMAP(sb, UDF_SB_PARTITION(sb), s_fspace);
|
||||||
if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) {
|
if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) {
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
|
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
|
|||||||
epos.offset = sizeof(struct unallocSpaceEntry);
|
epos.offset = sizeof(struct unallocSpaceEntry);
|
||||||
epos.bh = NULL;
|
epos.bh = NULL;
|
||||||
|
|
||||||
while ((etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) {
|
while ((etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1)
|
||||||
accum += (elen >> table->i_sb->s_blocksize_bits);
|
accum += (elen >> table->i_sb->s_blocksize_bits);
|
||||||
}
|
|
||||||
brelse(epos.bh);
|
brelse(epos.bh);
|
||||||
|
|
||||||
unlock_kernel();
|
unlock_kernel();
|
||||||
@ -1811,22 +1848,22 @@ static unsigned int udf_count_free(struct super_block *sb)
|
|||||||
if (accum)
|
if (accum)
|
||||||
return accum;
|
return accum;
|
||||||
|
|
||||||
if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP) {
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_BITMAP) {
|
||||||
accum += udf_count_free_bitmap(sb,
|
accum += udf_count_free_bitmap(sb,
|
||||||
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_bitmap);
|
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_bitmap);
|
||||||
}
|
}
|
||||||
if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP) {
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_BITMAP) {
|
||||||
accum += udf_count_free_bitmap(sb,
|
accum += udf_count_free_bitmap(sb,
|
||||||
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_bitmap);
|
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_bitmap);
|
||||||
}
|
}
|
||||||
if (accum)
|
if (accum)
|
||||||
return accum;
|
return accum;
|
||||||
|
|
||||||
if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_TABLE) {
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_UNALLOC_TABLE) {
|
||||||
accum += udf_count_free_table(sb,
|
accum += udf_count_free_table(sb,
|
||||||
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_table);
|
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_uspace.s_table);
|
||||||
}
|
}
|
||||||
if (UDF_SB_PARTFLAGS(sb,UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE) {
|
if (UDF_SB_PARTFLAGS(sb, UDF_SB_PARTITION(sb)) & UDF_PART_FLAG_FREED_TABLE) {
|
||||||
accum += udf_count_free_table(sb,
|
accum += udf_count_free_table(sb,
|
||||||
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
|
UDF_SB_PARTMAPS(sb)[UDF_SB_PARTITION(sb)].s_fspace.s_table);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user