From d86a921be38f9dfe999bfd36bc3a8e76a2ad929f Mon Sep 17 00:00:00 2001 From: batt Date: Thu, 3 Feb 2011 18:19:43 +0000 Subject: [PATCH] Load new page only on buffered devices. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4677 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/io/kblock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bertos/io/kblock.c b/bertos/io/kblock.c index 9c21f566..117c3e9b 100644 --- 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 -- 2.25.1