summaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 04:20:39 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 09:22:35 -0800
commit3f2587bb22bbcd679e9cf034fb4a29bb48b051b3 (patch)
tree47052ce02f10d5f72656b41763feab86d105ea6a /fs/udf/super.c
parent4b11111aba6c80cc2969fd1806d2a869bfc9f357 (diff)
downloadlinux-3f2587bb22bbcd679e9cf034fb4a29bb48b051b3.tar.bz2
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.c16
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)
struct udf_sb_info *sbi = UDF_SB(sb);
struct buffer_head *bh = sbi->s_lvid_bh;
if (bh) {
- int i;
kernel_timestamp cpu_time;
struct logicalVolIntegrityDesc *lvid =
(struct logicalVolIntegrityDesc *)bh->b_data;
@@ -1582,12 +1581,7 @@ static void udf_open_lvid(struct super_block *sb)
le16_to_cpu(lvid->descTag.descCRCLength),
0));
- lvid->descTag.tagChecksum = 0;
- for (i = 0; i < 16; i++)
- if (i != 4)
- lvid->descTag.tagChecksum +=
- ((uint8_t *) &(lvid->descTag))[i];
-
+ lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag);
mark_buffer_dirty(bh);
}
}
@@ -1595,7 +1589,6 @@ static void udf_open_lvid(struct super_block *sb)
static void udf_close_lvid(struct super_block *sb)
{
kernel_timestamp cpu_time;
- int i;
struct udf_sb_info *sbi = UDF_SB(sb);
struct buffer_head *bh = sbi->s_lvid_bh;
struct logicalVolIntegrityDesc *lvid;
@@ -1626,12 +1619,7 @@ static void udf_close_lvid(struct super_block *sb)
le16_to_cpu(lvid->descTag.descCRCLength),
0));
- lvid->descTag.tagChecksum = 0;
- for (i = 0; i < 16; i++)
- if (i != 4)
- lvid->descTag.tagChecksum +=
- ((uint8_t *)&(lvid->descTag))[i];
-
+ lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag);
mark_buffer_dirty(bh);
}
}