Skip to content

Commit

Permalink
Explain the stat block calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
twiggler committed Oct 10, 2024
1 parent d2a6383 commit e6ba1be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dissect/target/filesystems/xfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def lstat(self) -> fsutil.stat_result:
st_info.st_blksize = self.fs.xfs.block_size
# Convert number of filesystem blocks to basic blocks
# Reference: https://github.com/torvalds/linux/blob/e32cde8d2bd7d251a8f9b434143977ddf13dcec6/fs/xfs/xfs_iops.c#L602 # noqa: E501
# Note that block size in XFS is always a multiple of 512, so the division below is safe
st_info.st_blocks = self.entry.nblocks * (self.fs.xfs.block_size // 512)

# XFS has a birth time, since inode version 3 (version 5 of filesystem)
Expand Down

0 comments on commit e6ba1be

Please sign in to comment.