Skip to content

Commit f8f5a3b

Browse files
robin-nitrokeysosthene-nitrokey
authored andcommitted
Bump littlefs2 to 0.4.0
1 parent 216b8ac commit f8f5a3b

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Added support for custom backends in `backend` module.
2020
- Added optional support for API extensions in `serde_extensions` module
2121
behind the `serde-extensions` feature.
22+
- Added `types::Path` re-export of `littlefs2::path::Path`.
2223

2324
### Changed
2425

@@ -30,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3031
`PollClient::syscall`.
3132
- Upgrade the `interchange` dependency to version 0.3.0 ([#99][])
3233
- As a consequence the type `pipe::TrussedInterchange` becomes a const`pipe::TRUSSED_INTERCHANGE`
34+
- Updated `littlefs2` to 0.4.0.
3335

3436
### Fixed
3537

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ delog = "0.1.0"
4242
cbor-smol = "0.4"
4343
heapless-bytes = { version = "0.3.0", features = ["cbor"] }
4444
interchange = "0.3.0"
45-
littlefs2 = "0.3.1"
45+
littlefs2 = "0.4.0"
4646
p256-cortex-m4 = { version = "0.1.0-alpha.5", features = ["prehash", "sec1-signatures"] }
4747
salty = { version = "0.2.0", features = ["cose"] }
4848
serde-indexed = "0.1.0"

src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub use littlefs2::{
1111
driver::Storage as LfsStorage,
1212
fs::{DirEntry, Filesystem, Metadata},
1313
io::Result as LfsResult,
14-
path::PathBuf,
14+
path::{Path, PathBuf},
1515
};
1616

1717
use rand_core::{CryptoRng, RngCore};

src/virt/store.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
path::PathBuf,
66
};
77

8-
use generic_array::typenum::{U16, U512};
8+
use generic_array::typenum::{U512, U8};
99
use littlefs2::{const_ram_storage, driver::Storage, fs::Allocation};
1010

1111
use crate::{
@@ -53,15 +53,9 @@ impl Storage for FilesystemStorage {
5353
const BLOCK_CYCLES: isize = -1;
5454

5555
type CACHE_SIZE = U512;
56-
type LOOKAHEADWORDS_SIZE = U16;
57-
// TODO: This can't actually be changed currently
58-
// type FILENAME_MAX_PLUS_ONE = U256;
59-
// type PATH_MAX_PLUS_ONE = U256;
60-
// const FILEBYTES_MAX: usize = littlefs2::ll::LFS_FILE_MAX as _;
61-
// TODO: This can't actually be changed currently
62-
// type ATTRBYTES_MAX = U1022;
63-
64-
fn read(&self, offset: usize, buffer: &mut [u8]) -> LfsResult<usize> {
56+
type LOOKAHEAD_SIZE = U8;
57+
58+
fn read(&mut self, offset: usize, buffer: &mut [u8]) -> LfsResult<usize> {
6559
debug!("read: offset: {}, len: {}", offset, buffer.len());
6660
let mut file = File::open(&self.0).unwrap();
6761
file.seek(SeekFrom::Start(offset as _)).unwrap();

0 commit comments

Comments
 (0)