Revert "btrfs: update superblock checksum on write"

This reverts commit caf05af5dd.
This commit is contained in:
Augustin Cavalier
2019-10-26 17:48:11 -04:00
parent f02f815ed4
commit 5fb44dff84
2 changed files with 2 additions and 4 deletions
@@ -66,7 +66,7 @@ static uint32 kCrcTable[256] = {
\param data Pointer to the byte stream. \param data Pointer to the byte stream.
\param length Length of the byte stream in bytes. \param length Length of the byte stream in bytes.
\return The crc checksum. \return The crc checksum, or 0 if an error occurred.
*/ */
uint32 uint32
calculate_crc(uint32 crc, uint8* data, uint16 length) calculate_crc(uint32 crc, uint8* data, uint16 length)
@@ -656,9 +656,7 @@ Volume::FindBlock(off_t logical, off_t& physical)
status_t status_t
Volume::WriteSuperBlock() Volume::WriteSuperBlock()
{ {
fSuperBlock.checksum = calculate_crc((uint32)~1, // TODO(lesderid): Calculate checksum
(uint8 *)(*(&fSuperBlock + sizeof(fSuperBlock.checksum))),
sizeof(fSuperBlock) - sizeof(fSuperBlock.checksum));
if (write_pos(fDevice, BTRFS_SUPER_BLOCK_OFFSET, &fSuperBlock, if (write_pos(fDevice, BTRFS_SUPER_BLOCK_OFFSET, &fSuperBlock,
sizeof(btrfs_super_block)) sizeof(btrfs_super_block))