From da33e2cb2e8f6f678c84f6e5aace22a88d961b3e Mon Sep 17 00:00:00 2001 From: batt Date: Fri, 19 Sep 2008 16:44:52 +0000 Subject: [PATCH] Search files only in used blocks. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1817 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/fs/battfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bertos/fs/battfs.c b/bertos/fs/battfs.c index a817d0be..ae2ec123 100644 --- a/bertos/fs/battfs.c +++ b/bertos/fs/battfs.c @@ -586,10 +586,10 @@ static size_t battfs_read(struct KFile *fd, void *_buf, size_t size) static pgcnt_t *findFile(BattFsSuper *disk, inode_t inode) { BattFsPageHeader hdr; - pgcnt_t first = 0, page, last = disk->page_count -1; + pgcnt_t first = 0, page, last = disk->free_page_start; fcs_t fcs; - while (first <= last) + while (first < last) { page = (first + last) / 2; -- 2.25.1