Commit 1ab92785 authored by marcin.slusarz@gmail.com's avatar marcin.slusarz@gmail.com Committed by Jan Kara

udf: simplify __udf_read_inode

- move all brelse(ibh) after main if, because it's called
  on every path except one where ibh is null
- move variables to the most inner blocks
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent c2104fda
...@@ -1101,16 +1101,16 @@ static void __udf_read_inode(struct inode *inode) ...@@ -1101,16 +1101,16 @@ static void __udf_read_inode(struct inode *inode)
fe = (struct fileEntry *)bh->b_data; fe = (struct fileEntry *)bh->b_data;
if (fe->icbTag.strategyType == cpu_to_le16(4096)) { if (fe->icbTag.strategyType == cpu_to_le16(4096)) {
struct buffer_head *ibh = NULL, *nbh = NULL; struct buffer_head *ibh;
struct indirectEntry *ie;
ibh = udf_read_ptagged(inode->i_sb, iinfo->i_location, 1, ibh = udf_read_ptagged(inode->i_sb, iinfo->i_location, 1,
&ident); &ident);
if (ident == TAG_IDENT_IE) { if (ident == TAG_IDENT_IE && ibh) {
if (ibh) { struct buffer_head *nbh = NULL;
kernel_lb_addr loc; kernel_lb_addr loc;
ie = (struct indirectEntry *)ibh->b_data; struct indirectEntry *ie;
ie = (struct indirectEntry *)ibh->b_data;
loc = lelb_to_cpu(ie->indirectICB.extLocation); loc = lelb_to_cpu(ie->indirectICB.extLocation);
if (ie->indirectICB.extLength && if (ie->indirectICB.extLength &&
...@@ -1126,17 +1126,11 @@ static void __udf_read_inode(struct inode *inode) ...@@ -1126,17 +1126,11 @@ static void __udf_read_inode(struct inode *inode)
brelse(nbh); brelse(nbh);
__udf_read_inode(inode); __udf_read_inode(inode);
return; return;
} else {
brelse(nbh);
brelse(ibh);
} }
} else { brelse(nbh);
brelse(ibh);
} }
} }
} else {
brelse(ibh); brelse(ibh);
}
} else if (fe->icbTag.strategyType != cpu_to_le16(4)) { } else if (fe->icbTag.strategyType != cpu_to_le16(4)) {
printk(KERN_ERR "udf: unsupported strategy type: %d\n", printk(KERN_ERR "udf: unsupported strategy type: %d\n",
le16_to_cpu(fe->icbTag.strategyType)); le16_to_cpu(fe->icbTag.strategyType));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment