aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/misc.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2008-10-15 06:28:03 -0400
committerJan Kara <jack@suse.cz>2009-04-02 06:29:47 -0400
commit5ca4e4be841e389d7d17833fef7be2359f290163 (patch)
tree9c059a3b7599260d096fae395d640e79bdc46f30 /fs/udf/misc.c
parent833bb3046b6cb320e775ea2160ddca87d53260d5 (diff)
Remove struct typedefs from fs/udf/ecma_167.h et al.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/misc.c')
-rw-r--r--fs/udf/misc.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 84bf0fd4a4f1..6e164c7b549a 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -134,10 +134,10 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
134 } 134 }
135 } 135 }
136 /* rewrite CRC + checksum of eahd */ 136 /* rewrite CRC + checksum of eahd */
137 crclen = sizeof(struct extendedAttrHeaderDesc) - sizeof(tag); 137 crclen = sizeof(struct extendedAttrHeaderDesc) - sizeof(struct tag);
138 eahd->descTag.descCRCLength = cpu_to_le16(crclen); 138 eahd->descTag.descCRCLength = cpu_to_le16(crclen);
139 eahd->descTag.descCRC = cpu_to_le16(crc_itu_t(0, (char *)eahd + 139 eahd->descTag.descCRC = cpu_to_le16(crc_itu_t(0, (char *)eahd +
140 sizeof(tag), crclen)); 140 sizeof(struct tag), crclen));
141 eahd->descTag.tagChecksum = udf_tag_checksum(&eahd->descTag); 141 eahd->descTag.tagChecksum = udf_tag_checksum(&eahd->descTag);
142 iinfo->i_lenEAttr += size; 142 iinfo->i_lenEAttr += size;
143 return (struct genericFormat *)&ea[offset]; 143 return (struct genericFormat *)&ea[offset];
@@ -202,7 +202,7 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
202struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, 202struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
203 uint32_t location, uint16_t *ident) 203 uint32_t location, uint16_t *ident)
204{ 204{
205 tag *tag_p; 205 struct tag *tag_p;
206 struct buffer_head *bh = NULL; 206 struct buffer_head *bh = NULL;
207 207
208 /* Read the block */ 208 /* Read the block */
@@ -216,7 +216,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
216 return NULL; 216 return NULL;
217 } 217 }
218 218
219 tag_p = (tag *)(bh->b_data); 219 tag_p = (struct tag *)(bh->b_data);
220 220
221 *ident = le16_to_cpu(tag_p->tagIdent); 221 *ident = le16_to_cpu(tag_p->tagIdent);
222 222
@@ -241,9 +241,9 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
241 } 241 }
242 242
243 /* Verify the descriptor CRC */ 243 /* Verify the descriptor CRC */
244 if (le16_to_cpu(tag_p->descCRCLength) + sizeof(tag) > sb->s_blocksize || 244 if (le16_to_cpu(tag_p->descCRCLength) + sizeof(struct tag) > sb->s_blocksize ||
245 le16_to_cpu(tag_p->descCRC) == crc_itu_t(0, 245 le16_to_cpu(tag_p->descCRC) == crc_itu_t(0,
246 bh->b_data + sizeof(tag), 246 bh->b_data + sizeof(struct tag),
247 le16_to_cpu(tag_p->descCRCLength))) 247 le16_to_cpu(tag_p->descCRCLength)))
248 return bh; 248 return bh;
249 249
@@ -255,7 +255,7 @@ error_out:
255 return NULL; 255 return NULL;
256} 256}
257 257
258struct buffer_head *udf_read_ptagged(struct super_block *sb, kernel_lb_addr loc, 258struct buffer_head *udf_read_ptagged(struct super_block *sb, struct kernel_lb_addr loc,
259 uint32_t offset, uint16_t *ident) 259 uint32_t offset, uint16_t *ident)
260{ 260{
261 return udf_read_tagged(sb, udf_get_lb_pblock(sb, loc, offset), 261 return udf_read_tagged(sb, udf_get_lb_pblock(sb, loc, offset),
@@ -264,18 +264,18 @@ struct buffer_head *udf_read_ptagged(struct super_block *sb, kernel_lb_addr loc,
264 264
265void udf_update_tag(char *data, int length) 265void udf_update_tag(char *data, int length)
266{ 266{
267 tag *tptr = (tag *)data; 267 struct tag *tptr = (struct tag *)data;
268 length -= sizeof(tag); 268 length -= sizeof(struct tag);
269 269
270 tptr->descCRCLength = cpu_to_le16(length); 270 tptr->descCRCLength = cpu_to_le16(length);
271 tptr->descCRC = cpu_to_le16(crc_itu_t(0, data + sizeof(tag), length)); 271 tptr->descCRC = cpu_to_le16(crc_itu_t(0, data + sizeof(struct tag), length));
272 tptr->tagChecksum = udf_tag_checksum(tptr); 272 tptr->tagChecksum = udf_tag_checksum(tptr);
273} 273}
274 274
275void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum, 275void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum,
276 uint32_t loc, int length) 276 uint32_t loc, int length)
277{ 277{
278 tag *tptr = (tag *)data; 278 struct tag *tptr = (struct tag *)data;
279 tptr->tagIdent = cpu_to_le16(ident); 279 tptr->tagIdent = cpu_to_le16(ident);
280 tptr->descVersion = cpu_to_le16(version); 280 tptr->descVersion = cpu_to_le16(version);
281 tptr->tagSerialNum = cpu_to_le16(snum); 281 tptr->tagSerialNum = cpu_to_le16(snum);
@@ -283,12 +283,12 @@ void udf_new_tag(char *data, uint16_t ident, uint16_t version, uint16_t snum,
283 udf_update_tag(data, length); 283 udf_update_tag(data, length);
284} 284}
285 285
286u8 udf_tag_checksum(const tag *t) 286u8 udf_tag_checksum(const struct tag *t)
287{ 287{
288 u8 *data = (u8 *)t; 288 u8 *data = (u8 *)t;
289 u8 checksum = 0; 289 u8 checksum = 0;
290 int i; 290 int i;
291 for (i = 0; i < sizeof(tag); ++i) 291 for (i = 0; i < sizeof(struct tag); ++i)
292 if (i != 4) /* position of checksum */ 292 if (i != 4) /* position of checksum */
293 checksum += data[i]; 293 checksum += data[i];
294 return checksum; 294 return checksum;