From: batt Date: Thu, 3 Feb 2011 18:19:43 +0000 (+0000) Subject: Load new page only on buffered devices. X-Git-Tag: 2.7.0~289 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d86a921be38f9dfe999bfd36bc3a8e76a2ad929f;p=bertos.git Load new page only on buffered devices. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4677 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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