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/namei.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/namei.c')
-rw-r--r-- | fs/udf/namei.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index a126950d79e6..9b5cfc5f725c 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -47,8 +47,6 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi, | |||
47 | { | 47 | { |
48 | uint16_t crclen = fibh->eoffset - fibh->soffset - sizeof(tag); | 48 | uint16_t crclen = fibh->eoffset - fibh->soffset - sizeof(tag); |
49 | uint16_t crc; | 49 | uint16_t crc; |
50 | uint8_t checksum = 0; | ||
51 | int i; | ||
52 | int offset; | 50 | int offset; |
53 | uint16_t liu = le16_to_cpu(cfi->lengthOfImpUse); | 51 | uint16_t liu = le16_to_cpu(cfi->lengthOfImpUse); |
54 | uint8_t lfi = cfi->lengthFileIdent; | 52 | uint8_t lfi = cfi->lengthFileIdent; |
@@ -122,13 +120,8 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi, | |||
122 | 120 | ||
123 | cfi->descTag.descCRC = cpu_to_le16(crc); | 121 | cfi->descTag.descCRC = cpu_to_le16(crc); |
124 | cfi->descTag.descCRCLength = cpu_to_le16(crclen); | 122 | cfi->descTag.descCRCLength = cpu_to_le16(crclen); |
123 | cfi->descTag.tagChecksum = udf_tag_checksum(&cfi->descTag); | ||
125 | 124 | ||
126 | for (i = 0; i < 16; i++) { | ||
127 | if (i != 4) | ||
128 | checksum += ((uint8_t *)&cfi->descTag)[i]; | ||
129 | } | ||
130 | |||
131 | cfi->descTag.tagChecksum = checksum; | ||
132 | if (adinicb || (sizeof(struct fileIdentDesc) <= -fibh->soffset)) { | 125 | if (adinicb || (sizeof(struct fileIdentDesc) <= -fibh->soffset)) { |
133 | memcpy((uint8_t *)sfi, (uint8_t *)cfi, | 126 | memcpy((uint8_t *)sfi, (uint8_t *)cfi, |
134 | sizeof(struct fileIdentDesc)); | 127 | sizeof(struct fileIdentDesc)); |