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

Support st_blksize and st_blocks on JFFS2 #912

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Support st_blksize and st_blocks on JFFS2 #912

wants to merge 2 commits into from

Conversation

twiggler
Copy link
Contributor

The block size is a function of the "erase size" of the underlying flash device.
Linux stat reports the default block size, which is defined as 4k in libc.

Also tried to implement missing nlink functionality as a bonus, but it exceeded the story budget.
Will create issue for it after the weekend.

Closes #819

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.68%. Comparing base (cb69261) to head (7543c0d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #912      +/-   ##
==========================================
+ Coverage   76.65%   76.68%   +0.03%     
==========================================
  Files         316      316              
  Lines       27101    27103       +2     
==========================================
+ Hits        20774    20784      +10     
+ Misses       6327     6319       -8     
Flag Coverage Δ
unittests 76.68% <100.00%> (+0.03%) ⬆️

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.

# JFFS2 block size is a function of the "erase size" of the underlying flash device.
# Linux stat reports the default block size, which is defined as 4k in libc.
st_info.st_blksize = 4096
st_info.st_blocks = (node.isize + 511) // 512 if self.is_file() else 0
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a unit test for a directory entry?

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 JFFS
2 participants