summaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 13:20:46 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 18:22:35 +0100
commit28f7c4d413b9e6326f8d0aef31cd5ba8500b20dd (patch)
tree7372949bfb63da915ab1c43cb97eb9ecb4c621d5 /fs/udf/super.c
parentudf: fix udf_debug macro (diff)
downloadlinux-28f7c4d413b9e6326f8d0aef31cd5ba8500b20dd.tar.xz
linux-28f7c4d413b9e6326f8d0aef31cd5ba8500b20dd.zip
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)
sbi = UDF_SB(sb);
for (i = 0; i < ARRAY_SIZE(sbi->s_anchor); i++) {
- if (sbi->s_anchor[i] &&
- (bh = udf_read_tagged(sb, sbi->s_anchor[i],
- sbi->s_anchor[i], &ident))) {
- anchor = (struct anchorVolDescPtr *)bh->b_data;
-
- /* Locate the main sequence */
- main_s = le32_to_cpu(
- anchor->mainVolDescSeqExt.extLocation);
- main_e = le32_to_cpu(
- anchor->mainVolDescSeqExt.extLength);
- main_e = main_e >> sb->s_blocksize_bits;
- main_e += main_s;
-
- /* Locate the reserve sequence */
- reserve_s = le32_to_cpu(
+ if (!sbi->s_anchor[i])
+ continue;
+ bh = udf_read_tagged(sb, sbi->s_anchor[i], sbi->s_anchor[i],
+ &ident);
+ if (!bh)
+ continue;
+
+ anchor = (struct anchorVolDescPtr *)bh->b_data;
+
+ /* Locate the main sequence */
+ main_s = le32_to_cpu(anchor->mainVolDescSeqExt.extLocation);
+ main_e = le32_to_cpu(anchor->mainVolDescSeqExt.extLength);
+ main_e = main_e >> sb->s_blocksize_bits;
+ main_e += main_s;
+
+ /* Locate the reserve sequence */
+ reserve_s = le32_to_cpu(
anchor->reserveVolDescSeqExt.extLocation);
- reserve_e = le32_to_cpu(
+ reserve_e = le32_to_cpu(
anchor->reserveVolDescSeqExt.extLength);
- reserve_e = reserve_e >> sb->s_blocksize_bits;
- reserve_e += reserve_s;
+ reserve_e = reserve_e >> sb->s_blocksize_bits;
+ reserve_e += reserve_s;
- brelse(bh);
+ brelse(bh);
- /* Process the main & reserve sequences */
- /* responsible for finding the PartitionDesc(s) */
- if (!(udf_process_sequence(sb, main_s, main_e,
- fileset) &&
- udf_process_sequence(sb, reserve_s, reserve_e,
- fileset)))
- break;
- }
+ /* Process the main & reserve sequences */
+ /* responsible for finding the PartitionDesc(s) */
+ if (!(udf_process_sequence(sb, main_s, main_e,
+ fileset) &&
+ udf_process_sequence(sb, reserve_s, reserve_e,
+ fileset)))
+ break;
}
if (i == ARRAY_SIZE(sbi->s_anchor)) {
udf_debug("No Anchor block found\n");
return 1;
- } else
- udf_debug("Using anchor in block %d\n", sbi->s_anchor[i]);
+ }
+ udf_debug("Using anchor in block %d\n", sbi->s_anchor[i]);
for (i = 0; i < sbi->s_partitions; i++) {
kernel_lb_addr uninitialized_var(ino);