aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:46 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:35 -0500
commit28f7c4d413b9e6326f8d0aef31cd5ba8500b20dd (patch)
tree7372949bfb63da915ab1c43cb97eb9ecb4c621d5 /fs/udf/super.c
parent756fa92f4d725698ffa4ac1faeb8f4e8cdb6cd95 (diff)
udf: improve readability of udf_load_partition
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Acked-by: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r--fs/udf/super.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 52d2c32b6c7b..2048351c56c0 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1447,44 +1447,45 @@ static int udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1447 sbi = UDF_SB(sb); 1447 sbi = UDF_SB(sb);
1448 1448
1449 for (i = 0; i < ARRAY_SIZE(sbi->s_anchor); i++) { 1449 for (i = 0; i < ARRAY_SIZE(sbi->s_anchor); i++) {
1450 if (sbi->s_anchor[i] && 1450 if (!sbi->s_anchor[i])
1451 (bh = udf_read_tagged(sb, sbi->s_anchor[i], 1451 continue;
1452 sbi->s_anchor[i], &ident))) { 1452 bh = udf_read_tagged(sb, sbi->s_anchor[i], sbi->s_anchor[i],
1453 anchor = (struct anchorVolDescPtr *)bh->b_data; 1453 &ident);
1454 1454 if (!bh)
1455 /* Locate the main sequence */ 1455 continue;
1456 main_s = le32_to_cpu( 1456
1457 anchor->mainVolDescSeqExt.extLocation); 1457 anchor = (struct anchorVolDescPtr *)bh->b_data;
1458 main_e = le32_to_cpu( 1458
1459 anchor->mainVolDescSeqExt.extLength); 1459 /* Locate the main sequence */
1460 main_e = main_e >> sb->s_blocksize_bits; 1460 main_s = le32_to_cpu(anchor->mainVolDescSeqExt.extLocation);
1461 main_e += main_s; 1461 main_e = le32_to_cpu(anchor->mainVolDescSeqExt.extLength);
1462 1462 main_e = main_e >> sb->s_blocksize_bits;
1463 /* Locate the reserve sequence */ 1463 main_e += main_s;
1464 reserve_s = le32_to_cpu( 1464
1465 /* Locate the reserve sequence */
1466 reserve_s = le32_to_cpu(
1465 anchor->reserveVolDescSeqExt.extLocation); 1467 anchor->reserveVolDescSeqExt.extLocation);
1466 reserve_e = le32_to_cpu( 1468 reserve_e = le32_to_cpu(
1467 anchor->reserveVolDescSeqExt.extLength); 1469 anchor->reserveVolDescSeqExt.extLength);
1468 reserve_e = reserve_e >> sb->s_blocksize_bits; 1470 reserve_e = reserve_e >> sb->s_blocksize_bits;
1469 reserve_e += reserve_s; 1471 reserve_e += reserve_s;
1470 1472
1471 brelse(bh); 1473 brelse(bh);
1472 1474
1473 /* Process the main & reserve sequences */ 1475 /* Process the main & reserve sequences */
1474 /* responsible for finding the PartitionDesc(s) */ 1476 /* responsible for finding the PartitionDesc(s) */
1475 if (!(udf_process_sequence(sb, main_s, main_e, 1477 if (!(udf_process_sequence(sb, main_s, main_e,
1476 fileset) && 1478 fileset) &&
1477 udf_process_sequence(sb, reserve_s, reserve_e, 1479 udf_process_sequence(sb, reserve_s, reserve_e,
1478 fileset))) 1480 fileset)))
1479 break; 1481 break;
1480 }
1481 } 1482 }
1482 1483
1483 if (i == ARRAY_SIZE(sbi->s_anchor)) { 1484 if (i == ARRAY_SIZE(sbi->s_anchor)) {
1484 udf_debug("No Anchor block found\n"); 1485 udf_debug("No Anchor block found\n");
1485 return 1; 1486 return 1;
1486 } else 1487 }
1487 udf_debug("Using anchor in block %d\n", sbi->s_anchor[i]); 1488 udf_debug("Using anchor in block %d\n", sbi->s_anchor[i]);
1488 1489
1489 for (i = 0; i < sbi->s_partitions; i++) { 1490 for (i = 0; i < sbi->s_partitions; i++) {
1490 kernel_lb_addr uninitialized_var(ino); 1491 kernel_lb_addr uninitialized_var(ino);