Search files only in used blocks.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Sep 2008 16:44:52 +0000 (16:44 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Sep 2008 16:44:52 +0000 (16:44 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1817 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/fs/battfs.c

index a817d0beba5eea0154c53e134b06d61b9ad25d91..ae2ec123c37fbecea443f98ee70a0cc05987718a 100644 (file)
@@ -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;