Skip to content

Commit

Permalink
Bump littlefs2 to 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Feb 8, 2023
1 parent 1c55b3b commit 3b1d6e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for custom backends in `backend` module.
- Added optional support for API extensions in `serde_extensions` module
behind the `serde-extensions` feature.
- Added `types::Path` re-export of `littlefs2::path::Path`.

### Changed

Expand All @@ -28,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Replaced the client ID with a `ClientContext` struct.
- Always trigger syscall in `PollClient::request` and remove
`PollClient::syscall`.
- Updated `littlefs2` to 0.4.0.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ delog = "0.1.0"
cbor-smol = "0.4"
heapless-bytes = { version = "0.3.0", features = ["cbor"] }
interchange = "0.2.1"
littlefs2 = "0.3.1"
littlefs2 = "0.4.0"
p256-cortex-m4 = { version = "0.1.0-alpha.5", features = ["prehash", "sec1-signatures"] }
salty = { version = "0.2.0", features = ["cose"] }
serde-indexed = "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub use littlefs2::{
driver::Storage as LfsStorage,
fs::{DirEntry, Filesystem, Metadata},
io::Result as LfsResult,
path::PathBuf,
path::{Path, PathBuf},
};

use rand_core::{CryptoRng, RngCore};
Expand Down
14 changes: 4 additions & 10 deletions src/virt/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
path::PathBuf,
};

use generic_array::typenum::{U16, U512};
use generic_array::typenum::{U8, U512};
use littlefs2::{const_ram_storage, driver::Storage, fs::Allocation};

use crate::{
Expand Down Expand Up @@ -53,15 +53,9 @@ impl Storage for FilesystemStorage {
const BLOCK_CYCLES: isize = -1;

type CACHE_SIZE = U512;
type LOOKAHEADWORDS_SIZE = U16;
// TODO: This can't actually be changed currently
// type FILENAME_MAX_PLUS_ONE = U256;
// type PATH_MAX_PLUS_ONE = U256;
// const FILEBYTES_MAX: usize = littlefs2::ll::LFS_FILE_MAX as _;
// TODO: This can't actually be changed currently
// type ATTRBYTES_MAX = U1022;

fn read(&self, offset: usize, buffer: &mut [u8]) -> LfsResult<usize> {
type LOOKAHEAD_SIZE = U8;

fn read(&mut self, offset: usize, buffer: &mut [u8]) -> LfsResult<usize> {
debug!("read: offset: {}, len: {}", offset, buffer.len());
let mut file = File::open(&self.0).unwrap();
file.seek(SeekFrom::Start(offset as _)).unwrap();
Expand Down

0 comments on commit 3b1d6e5

Please sign in to comment.