From 3f2587bb22bbcd679e9cf034fb4a29bb48b051b3 Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Fri, 8 Feb 2008 04:20:39 -0800 Subject: udf: create common function for tag checksumming Signed-off-by: Marcin Slusarz Acked-by: Jan Kara Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/udf/inode.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'fs/udf/inode.c') diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 3ce2f6d1aafa..42783da9cfe3 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1440,7 +1440,6 @@ static int udf_update_inode(struct inode *inode, int do_sync) uint32_t udfperms; uint16_t icbflags; uint16_t crclen; - int i; kernel_timestamp cpu_time; int err = 0; struct udf_sb_info *sbi = UDF_SB(inode->i_sb); @@ -1476,12 +1475,7 @@ static int udf_update_inode(struct inode *inode, int do_sync) use->descTag.descCRC = cpu_to_le16(udf_crc((char *)use + sizeof(tag), crclen, 0)); - - use->descTag.tagChecksum = 0; - for (i = 0; i < 16; i++) - if (i != 4) - use->descTag.tagChecksum += - ((uint8_t *)&(use->descTag))[i]; + use->descTag.tagChecksum = udf_tag_checksum(&use->descTag); mark_buffer_dirty(bh); brelse(bh); @@ -1650,12 +1644,7 @@ static int udf_update_inode(struct inode *inode, int do_sync) fe->descTag.descCRCLength = cpu_to_le16(crclen); fe->descTag.descCRC = cpu_to_le16(udf_crc((char *)fe + sizeof(tag), crclen, 0)); - - fe->descTag.tagChecksum = 0; - for (i = 0; i < 16; i++) - if (i != 4) - fe->descTag.tagChecksum += - ((uint8_t *)&(fe->descTag))[i]; + fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag); /* write the data blocks */ mark_buffer_dirty(bh); -- cgit v1.2.2