udf: cache struct udf_inode_info
cache UDF_I(struct inode *) return values when there are
at least 2 uses in one function
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
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>
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index cfe213f..fc53334 100644
--- a/fs/udf/partition.c
+++ b/fs/udf/partition.c
@@ -55,6 +55,7 @@
struct udf_sb_info *sbi = UDF_SB(sb);
struct udf_part_map *map;
struct udf_virtual_data *vdata;
+ struct udf_inode_info *iinfo;
map = &sbi->s_partmaps[partition];
vdata = &map->s_type_specific.s_virtual;
@@ -88,15 +89,14 @@
brelse(bh);
- if (UDF_I(sbi->s_vat_inode)->i_location.partitionReferenceNum ==
- partition) {
+ iinfo = UDF_I(sbi->s_vat_inode);
+ if (iinfo->i_location.partitionReferenceNum == partition) {
udf_debug("recursive call to udf_get_pblock!\n");
return 0xFFFFFFFF;
}
return udf_get_pblock(sb, loc,
- UDF_I(sbi->s_vat_inode)->i_location.
- partitionReferenceNum,
+ iinfo->i_location.partitionReferenceNum,
offset);
}