mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 16:14:13 +01:00
Compare commits
1 Commits
bf_lfs_fil
...
copyright-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2db5dc80c2 |
@@ -1,3 +1,4 @@
|
|||||||
|
Copyright (c) 2022, The littlefs authors.
|
||||||
Copyright (c) 2017, Arm Limited. All rights reserved.
|
Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Block device emulated in a file
|
* Block device emulated in a file
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Block device emulated in a file
|
* Block device emulated in a file
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Block device emulated in RAM
|
* Block device emulated in RAM
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Block device emulated in RAM
|
* Block device emulated in RAM
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
* Testing block device, wraps filebd and rambd while providing a bunch
|
* Testing block device, wraps filebd and rambd while providing a bunch
|
||||||
* of hooks for testing littlefs in various conditions.
|
* of hooks for testing littlefs in various conditions.
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
* Testing block device, wraps filebd and rambd while providing a bunch
|
* Testing block device, wraps filebd and rambd while providing a bunch
|
||||||
* of hooks for testing littlefs in various conditions.
|
* of hooks for testing littlefs in various conditions.
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
13
lfs.c
13
lfs.c
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* The little filesystem
|
* The little filesystem
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
@@ -2730,18 +2731,14 @@ static int lfs_file_outline(lfs_t *lfs, lfs_file_t *file) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void lfs_file_invalidate_reading_flag(lfs_t *lfs, lfs_file_t *file) {
|
#ifndef LFS_READONLY
|
||||||
|
static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
|
||||||
if (file->flags & LFS_F_READING) {
|
if (file->flags & LFS_F_READING) {
|
||||||
if (!(file->flags & LFS_F_INLINE)) {
|
if (!(file->flags & LFS_F_INLINE)) {
|
||||||
lfs_cache_drop(lfs, &file->cache);
|
lfs_cache_drop(lfs, &file->cache);
|
||||||
}
|
}
|
||||||
file->flags &= ~LFS_F_READING;
|
file->flags &= ~LFS_F_READING;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef LFS_READONLY
|
|
||||||
static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
|
|
||||||
lfs_file_invalidate_reading_flag(lfs, file);
|
|
||||||
|
|
||||||
if (file->flags & LFS_F_WRITING) {
|
if (file->flags & LFS_F_WRITING) {
|
||||||
lfs_off_t pos = file->pos;
|
lfs_off_t pos = file->pos;
|
||||||
@@ -3091,10 +3088,6 @@ static lfs_soff_t lfs_file_rawseek(lfs_t *lfs, lfs_file_t *file,
|
|||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
// Seek doesn't update cache parameters properly.
|
|
||||||
// It has to be invalidated otherwise next read will return incorrect values.
|
|
||||||
lfs_file_invalidate_reading_flag(lfs,file);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// update pos
|
// update pos
|
||||||
|
|||||||
1
lfs.h
1
lfs.h
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* The little filesystem
|
* The little filesystem
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* lfs util functions
|
* lfs util functions
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* lfs utility functions
|
* lfs utility functions
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2022, The littlefs authors.
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user