diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-02-08 15:20:39 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 20:22:35 +0300 |
commit | 3f2587bb22bbcd679e9cf034fb4a29bb48b051b3 (patch) | |
tree | 47052ce02f10d5f72656b41763feab86d105ea6a /fs/udf/inode.c | |
parent | 4b11111aba6c80cc2969fd1806d2a869bfc9f357 (diff) | |
download | linux-3f2587bb22bbcd679e9cf034fb4a29bb48b051b3.tar.xz |
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.c | 15 |
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) 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); |