From: batt Date: Fri, 19 Sep 2008 16:44:52 +0000 (+0000) Subject: Search files only in used blocks. X-Git-Tag: 2.0.0~117 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=da33e2cb2e8f6f678c84f6e5aace22a88d961b3e;p=bertos.git Search files only in used blocks. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1817 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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;