aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:39 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:35 -0500
commit3f2587bb22bbcd679e9cf034fb4a29bb48b051b3 (patch)
tree47052ce02f10d5f72656b41763feab86d105ea6a /fs/udf/inode.c
parent4b11111aba6c80cc2969fd1806d2a869bfc9f357 (diff)
udf: create common function for tag checksumming
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Acked-by: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r--fs/udf/inode.c15
1 files changed, 2 insertions, 13 deletions
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)
1440 uint32_t udfperms; 1440 uint32_t udfperms;
1441 uint16_t icbflags; 1441 uint16_t icbflags;
1442 uint16_t crclen; 1442 uint16_t crclen;
1443 int i;
1444 kernel_timestamp cpu_time; 1443 kernel_timestamp cpu_time;
1445 int err = 0; 1444 int err = 0;
1446 struct udf_sb_info *sbi = UDF_SB(inode->i_sb); 1445 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)
1476 use->descTag.descCRC = cpu_to_le16(udf_crc((char *)use + 1475 use->descTag.descCRC = cpu_to_le16(udf_crc((char *)use +
1477 sizeof(tag), crclen, 1476 sizeof(tag), crclen,
1478 0)); 1477 0));
1479 1478 use->descTag.tagChecksum = udf_tag_checksum(&use->descTag);
1480 use->descTag.tagChecksum = 0;
1481 for (i = 0; i < 16; i++)
1482 if (i != 4)
1483 use->descTag.tagChecksum +=
1484 ((uint8_t *)&(use->descTag))[i];
1485 1479
1486 mark_buffer_dirty(bh); 1480 mark_buffer_dirty(bh);
1487 brelse(bh); 1481 brelse(bh);
@@ -1650,12 +1644,7 @@ static int udf_update_inode(struct inode *inode, int do_sync)
1650 fe->descTag.descCRCLength = cpu_to_le16(crclen); 1644 fe->descTag.descCRCLength = cpu_to_le16(crclen);
1651 fe->descTag.descCRC = cpu_to_le16(udf_crc((char *)fe + sizeof(tag), 1645 fe->descTag.descCRC = cpu_to_le16(udf_crc((char *)fe + sizeof(tag),
1652 crclen, 0)); 1646 crclen, 0));
1653 1647 fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag);
1654 fe->descTag.tagChecksum = 0;
1655 for (i = 0; i < 16; i++)
1656 if (i != 4)
1657 fe->descTag.tagChecksum +=
1658 ((uint8_t *)&(fe->descTag))[i];
1659 1648
1660 /* write the data blocks */ 1649 /* write the data blocks */
1661 mark_buffer_dirty(bh); 1650 mark_buffer_dirty(bh);