projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add IS_ALIGNED macro to test alignment of a pointer
[bertos.git]
/
bertos
/
io
/
kblock.c
diff --git
a/bertos/io/kblock.c
b/bertos/io/kblock.c
index 9c21f56659b6e34a9f92c53bd8e35755395aba32..117c3e9b48ef3b9b51b43f134778580c87ea2df6 100644
(file)
--- a/
bertos/io/kblock.c
+++ b/
bertos/io/kblock.c
@@
-153,8
+153,11
@@
int kblock_trim(struct KBlock *b, block_idx_t start, block_idx_t count)
{
ASSERT(start + count <= b->blk_cnt);
- if (!kblock_loadPage(b, start))
- return EOF;
+ if (kblock_buffered(b))
+ {
+ if (!kblock_loadPage(b, start))
+ return EOF;
+ }
b->priv.blk_start += start;
b->priv.curr_blk = 0; // adjust logical address