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

View File

@ -66,7 +66,7 @@ static uint32 kCrcTable[256] = {
\param data Pointer to the byte stream.
\param length Length of the byte stream in bytes.
\return The crc checksum.
\return The crc checksum, or 0 if an error occurred.
*/
uint32
calculate_crc(uint32 crc, uint8* data, uint16 length)

View File

@ -656,9 +656,7 @@ Volume::FindBlock(off_t logical, off_t& physical)
status_t
Volume::WriteSuperBlock()
{
fSuperBlock.checksum = calculate_crc((uint32)~1,
(uint8 *)(*(&fSuperBlock + sizeof(fSuperBlock.checksum))),
sizeof(fSuperBlock) - sizeof(fSuperBlock.checksum));
// TODO(lesderid): Calculate checksum
if (write_pos(fDevice, BTRFS_SUPER_BLOCK_OFFSET, &fSuperBlock,
sizeof(btrfs_super_block))