aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/misc.c')
-rw-r--r--fs/udf/misc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 15297deb5051..7cecb3098061 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -81,14 +81,16 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
81 return NULL; 81 return NULL;
82 } 82 }
83 } else { 83 } else {
84 struct udf_sb_info *sbi = UDF_SB(inode->i_sb);
85
84 size -= sizeof(struct extendedAttrHeaderDesc); 86 size -= sizeof(struct extendedAttrHeaderDesc);
85 UDF_I_LENEATTR(inode) += sizeof(struct extendedAttrHeaderDesc); 87 UDF_I_LENEATTR(inode) += sizeof(struct extendedAttrHeaderDesc);
86 eahd->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EAHD); 88 eahd->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EAHD);
87 if (UDF_SB_UDFREV(inode->i_sb) >= 0x0200) 89 if (sbi->s_udfrev >= 0x0200)
88 eahd->descTag.descVersion = cpu_to_le16(3); 90 eahd->descTag.descVersion = cpu_to_le16(3);
89 else 91 else
90 eahd->descTag.descVersion = cpu_to_le16(2); 92 eahd->descTag.descVersion = cpu_to_le16(2);
91 eahd->descTag.tagSerialNum = cpu_to_le16(UDF_SB_SERIALNUM(inode->i_sb)); 93 eahd->descTag.tagSerialNum = cpu_to_le16(sbi->s_serial_number);
92 eahd->descTag.tagLocation = cpu_to_le32(UDF_I_LOCATION(inode).logicalBlockNum); 94 eahd->descTag.tagLocation = cpu_to_le32(UDF_I_LOCATION(inode).logicalBlockNum);
93 eahd->impAttrLocation = cpu_to_le32(0xFFFFFFFF); 95 eahd->impAttrLocation = cpu_to_le32(0xFFFFFFFF);
94 eahd->appAttrLocation = cpu_to_le32(0xFFFFFFFF); 96 eahd->appAttrLocation = cpu_to_le32(0xFFFFFFFF);
@@ -192,15 +194,16 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
192 struct buffer_head *bh = NULL; 194 struct buffer_head *bh = NULL;
193 register uint8_t checksum; 195 register uint8_t checksum;
194 register int i; 196 register int i;
197 struct udf_sb_info *sbi = UDF_SB(sb);
195 198
196 /* Read the block */ 199 /* Read the block */
197 if (block == 0xFFFFFFFF) 200 if (block == 0xFFFFFFFF)
198 return NULL; 201 return NULL;
199 202
200 bh = udf_tread(sb, block + UDF_SB_SESSION(sb)); 203 bh = udf_tread(sb, block + sbi->s_session);
201 if (!bh) { 204 if (!bh) {
202 udf_debug("block=%d, location=%d: read failed\n", 205 udf_debug("block=%d, location=%d: read failed\n",
203 block + UDF_SB_SESSION(sb), location); 206 block + sbi->s_session, location);
204 return NULL; 207 return NULL;
205 } 208 }
206 209
@@ -210,7 +213,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
210 213
211 if (location != le32_to_cpu(tag_p->tagLocation)) { 214 if (location != le32_to_cpu(tag_p->tagLocation)) {
212 udf_debug("location mismatch block %u, tag %u != %u\n", 215 udf_debug("location mismatch block %u, tag %u != %u\n",
213 block + UDF_SB_SESSION(sb), le32_to_cpu(tag_p->tagLocation), location); 216 block + sbi->s_session, le32_to_cpu(tag_p->tagLocation), location);
214 goto error_out; 217 goto error_out;
215 } 218 }
216 219
@@ -240,7 +243,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
240 return bh; 243 return bh;
241 } 244 }
242 udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", 245 udf_debug("Crc failure block %d: crc = %d, crclen = %d\n",
243 block + UDF_SB_SESSION(sb), le16_to_cpu(tag_p->descCRC), 246 block + sbi->s_session, le16_to_cpu(tag_p->descCRC),
244 le16_to_cpu(tag_p->descCRCLength)); 247 le16_to_cpu(tag_p->descCRCLength));
245 248
246error_out: 249error_out: