Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Jan 1, 2024
1 parent 57ab363 commit 8b856a7
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions remarkable_update_fuse/ext4/inode.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from ctypes import c_uint16
from crcmod import mkCrcFun

from .enum import TypedCEnumeration
from .struct import Ext4Struct
from .enum import EXT4_OS
from .enum import EXT4_FL
Expand Down Expand Up @@ -171,18 +170,12 @@ def checksum(self):
)
if self.has_hi:
offset = Inode.i_checksum_hi.offset
csum = crc32c(
data[self.EXT2_GOOD_OLD_INODE_SIZE : offset],
csum,
)
csum = crc32c(data[self.EXT2_GOOD_OLD_INODE_SIZE : offset], csum)
if self.fits_in_hi:
csum = crc32c(b"\0" * Inode.i_checksum_hi.size, csum)
offset += Inode.i_checksum_hi.size

csum = crc32c(
data[offset:],
csum,
)
csum = crc32c(data[offset:], csum)

if not self.has_hi:
csum &= 0xFFFF
Expand All @@ -201,3 +194,7 @@ def expected_checksum(self):
provided_csum |= self.i_checksum_hi << 16

return provided_csum

@property
def is_inline(self):
return (self.i_flags & EXT4_FL.EXTENTS) == 0

0 comments on commit 8b856a7

Please sign in to comment.