aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/dir.c')
-rw-r--r--fs/udf/dir.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index 6fd831413c9a..4d9b2153f686 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -117,6 +117,7 @@ do_udf_readdir(struct inode *dir, struct file *filp, filldir_t filldir,
117 int i, num; 117 int i, num;
118 unsigned int dt_type; 118 unsigned int dt_type;
119 struct extent_position epos = { NULL, 0, {0, 0} }; 119 struct extent_position epos = { NULL, 0, {0, 0} };
120 struct udf_inode_info *iinfo;
120 121
121 if (nf_pos >= size) 122 if (nf_pos >= size)
122 return 0; 123 return 0;
@@ -125,15 +126,16 @@ do_udf_readdir(struct inode *dir, struct file *filp, filldir_t filldir,
125 nf_pos = (udf_ext0_offset(dir) >> 2); 126 nf_pos = (udf_ext0_offset(dir) >> 2);
126 127
127 fibh.soffset = fibh.eoffset = (nf_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2; 128 fibh.soffset = fibh.eoffset = (nf_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
128 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { 129 iinfo = UDF_I(dir);
130 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
129 fibh.sbh = fibh.ebh = NULL; 131 fibh.sbh = fibh.ebh = NULL;
130 } else if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2), 132 } else if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2),
131 &epos, &eloc, &elen, &offset) == (EXT_RECORDED_ALLOCATED >> 30)) { 133 &epos, &eloc, &elen, &offset) == (EXT_RECORDED_ALLOCATED >> 30)) {
132 block = udf_get_lb_pblock(dir->i_sb, eloc, offset); 134 block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
133 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { 135 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
134 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_SHORT) 136 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
135 epos.offset -= sizeof(short_ad); 137 epos.offset -= sizeof(short_ad);
136 else if (UDF_I(dir)->i_alloc_type == 138 else if (iinfo->i_alloc_type ==
137 ICBTAG_FLAG_AD_LONG) 139 ICBTAG_FLAG_AD_LONG)
138 epos.offset -= sizeof(long_ad); 140 epos.offset -= sizeof(long_ad);
139 } else { 141 } else {