Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add blksize, nblocks, and birthtime_ns to stat for FFS #917

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

twiggler
Copy link
Contributor

On Linux, stat always returns the default block size of 4096
We are returning the actual block size of the filesystem, similar to stat on BSD

Note: st_blocks * 512 can be lower than st_blksize because FFS employs fragments

Closes #818

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.88%. Comparing base (c9b4aa1) to head (26b2cc8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #917      +/-   ##
==========================================
+ Coverage   76.84%   76.88%   +0.04%     
==========================================
  Files         322      322              
  Lines       27405    27408       +3     
==========================================
+ Hits        21060    21074      +14     
+ Misses       6345     6334      -11     
Flag Coverage Δ
unittests 76.88% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@twiggler twiggler requested a review from Poeloe October 28, 2024 08:24
Comment on lines +12 to +13
@pytest.fixture
def ffs_fs() -> Iterator[FfsFilesystem]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would place this fixture in the conftest.py file, rename it to fs_ffs and place it at the other fs_* fixtures there

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't, it's only used here.

Copy link
Contributor Author

@twiggler twiggler Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Poeloe The ffs_fs fixture is only used in this test file, so I agree with Schamper that it makes more sense to not expose them in the conftest.py file . We can always move them if they are needed in other tests.
Is that acceptable?

Comment on lines +20 to +21
@pytest.fixture
def ffs_fs_entry(ffs_fs: FfsFilesystem) -> Iterator[FfsFilesystemEntry]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just also place this fixture in the conftest.py, but I'll leave that up to you 😄

@twiggler twiggler merged commit 041d41d into main Oct 31, 2024
18 of 20 checks passed
@twiggler twiggler deleted the FFS-stat branch October 31, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add st_blocks and st_blksize to stat output for FFS
3 participants