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

file: add file_system_stat #2530

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

file: add file_system_stat #2530

wants to merge 2 commits into from

Conversation

bhalevy
Copy link
Member

@bhalevy bhalevy commented Nov 7, 2024

Return an abstract file_system_stat_data representing
the system statvfs for the filesystem identified
by the given file name.

The motivation is implementing a disk-space monitor
in scylladb.

Return an abstract file_system_stat_data representing
the system statvfs for the filesystem identified
by the given file name.

The motivation is implementing a disk-space monitor
in scylladb.

Signed-off-by: Benny Halevy <[email protected]>
@bhalevy
Copy link
Member Author

bhalevy commented Nov 10, 2024

  • added #include <coroutine>

@bhalevy bhalevy requested a review from xemul November 13, 2024 08:38
@bhalevy
Copy link
Member Author

bhalevy commented Nov 13, 2024

@xemul can you please review and consider merging?

@xemul
Copy link
Contributor

xemul commented Nov 14, 2024

This PR adds

  • conversion from statvfs to newly introduced file_system_stat_data
  • wrapper around already public reactor::statvfs()

So basically it adds 1:1 wrapper over existing APIs. What's the point?

@bhalevy
Copy link
Member Author

bhalevy commented Nov 14, 2024

This PR adds

  • conversion from statvfs to newly introduced file_system_stat_data
  • wrapper around already public reactor::statvfs()

So basically it adds 1:1 wrapper over existing APIs. What's the point?

The wrapper is similar to other "global" entry points we have so that callers won't need to access the reactor api.

As for the abstract file_system_stat_data, again, it's similar to the file stat_data struct that is not linux specific and provides an isolation layer.

Users don't need to know about the crazy linux/posix semantics on statvfs regarding the lock size or fragment size and how they relate to total/free/available blocks in the filesystem. It's too system specific.

@bhalevy
Copy link
Member Author

bhalevy commented Nov 19, 2024

ping @xemul

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.

2 participants