diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-02-08 07:20:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:35 -0500 |
commit | 3f2587bb22bbcd679e9cf034fb4a29bb48b051b3 (patch) | |
tree | 47052ce02f10d5f72656b41763feab86d105ea6a /fs/udf/super.c | |
parent | 4b11111aba6c80cc2969fd1806d2a869bfc9f357 (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/super.c')
-rw-r--r-- | fs/udf/super.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 7f75a949e152..12fb91d23a83 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -1564,7 +1564,6 @@ static void udf_open_lvid(struct super_block *sb) | |||
1564 | struct udf_sb_info *sbi = UDF_SB(sb); | 1564 | struct udf_sb_info *sbi = UDF_SB(sb); |
1565 | struct buffer_head *bh = sbi->s_lvid_bh; | 1565 | struct buffer_head *bh = sbi->s_lvid_bh; |
1566 | if (bh) { | 1566 | if (bh) { |
1567 | int i; | ||
1568 | kernel_timestamp cpu_time; | 1567 | kernel_timestamp cpu_time; |
1569 | struct logicalVolIntegrityDesc *lvid = | 1568 | struct logicalVolIntegrityDesc *lvid = |
1570 | (struct logicalVolIntegrityDesc *)bh->b_data; | 1569 | (struct logicalVolIntegrityDesc *)bh->b_data; |
@@ -1582,12 +1581,7 @@ static void udf_open_lvid(struct super_block *sb) | |||
1582 | le16_to_cpu(lvid->descTag.descCRCLength), | 1581 | le16_to_cpu(lvid->descTag.descCRCLength), |
1583 | 0)); | 1582 | 0)); |
1584 | 1583 | ||
1585 | lvid->descTag.tagChecksum = 0; | 1584 | lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag); |
1586 | for (i = 0; i < 16; i++) | ||
1587 | if (i != 4) | ||
1588 | lvid->descTag.tagChecksum += | ||
1589 | ((uint8_t *) &(lvid->descTag))[i]; | ||
1590 | |||
1591 | mark_buffer_dirty(bh); | 1585 | mark_buffer_dirty(bh); |
1592 | } | 1586 | } |
1593 | } | 1587 | } |
@@ -1595,7 +1589,6 @@ static void udf_open_lvid(struct super_block *sb) | |||
1595 | static void udf_close_lvid(struct super_block *sb) | 1589 | static void udf_close_lvid(struct super_block *sb) |
1596 | { | 1590 | { |
1597 | kernel_timestamp cpu_time; | 1591 | kernel_timestamp cpu_time; |
1598 | int i; | ||
1599 | struct udf_sb_info *sbi = UDF_SB(sb); | 1592 | struct udf_sb_info *sbi = UDF_SB(sb); |
1600 | struct buffer_head *bh = sbi->s_lvid_bh; | 1593 | struct buffer_head *bh = sbi->s_lvid_bh; |
1601 | struct logicalVolIntegrityDesc *lvid; | 1594 | struct logicalVolIntegrityDesc *lvid; |
@@ -1626,12 +1619,7 @@ static void udf_close_lvid(struct super_block *sb) | |||
1626 | le16_to_cpu(lvid->descTag.descCRCLength), | 1619 | le16_to_cpu(lvid->descTag.descCRCLength), |
1627 | 0)); | 1620 | 0)); |
1628 | 1621 | ||
1629 | lvid->descTag.tagChecksum = 0; | 1622 | lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag); |
1630 | for (i = 0; i < 16; i++) | ||
1631 | if (i != 4) | ||
1632 | lvid->descTag.tagChecksum += | ||
1633 | ((uint8_t *)&(lvid->descTag))[i]; | ||
1634 | |||
1635 | mark_buffer_dirty(bh); | 1623 | mark_buffer_dirty(bh); |
1636 | } | 1624 | } |
1637 | } | 1625 | } |