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

rust: Bind our default recommended max inline size #395

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rust/composefs-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
//! # Bindings for libcomposefs
//!
//! This crate contains a few manually maintained system bindings for libcomposefs.

/// Size of a SHA-256 digest in bytes.
pub const LCFS_SHA256_DIGEST_LEN: usize = 32;
/// Recommended inline content size.
pub const LCFS_RECOMMENDED_INLINE_CONTENT_MAX: u16 = 64;

extern "C" {
pub fn lcfs_compute_fsverity_from_fd(
Expand Down
3 changes: 3 additions & 0 deletions rust/composefs/src/dumpfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ use libc::S_IFDIR;

/// Maximum size accepted for inline content.
const MAX_INLINE_CONTENT: u16 = 5000;
/// The canonical default size to use for inline files.
pub const RECOMMENDED_MAX_INLINE_CONTENT: u16 = composefs_sys::LCFS_RECOMMENDED_INLINE_CONTENT_MAX;

/// https://github.com/torvalds/linux/blob/47ac09b91befbb6a235ab620c32af719f8208399/include/uapi/linux/limits.h#L15
/// This isn't exposed in libc/rustix, and in any case we should be conservative...if this ever
/// gets bumped it'd be a hazard.
Expand Down
Loading