*
* -->
*
+ * \brief BattFS: a filesystem for embedded platforms (implementation).
+ *
* \version $Id:$
*
* \author Francesco Sacchi <batt@develer.com>
*
- * \brief BattFS: a filesystem for embedded platforms (implementation).
*/
#include "battfs.h"
+#warning TODO:Fix and complete this module.
+
+#if 0
#include <cfg/debug.h>
#include <cfg/macros.h> /* MIN, MAX */
#include <mware/byteorder.h> /* cpu_to_xx */
* Upper interval is invalid.
* Use lower values.
*/
-
+
disk->free_start = minl;
disk->free_next = maxl;
}
{
/* Increase free space */
disk->free_bytes += disk->page_size - BATTFS_HEADER_LEN;
-
+
/* Check if page is marked free */
if (hdr.fcs_free == computeFcsFree(&hdr))
{
else
{
BattFsPageHeader hdr_old;
-
+
if (!battfs_readHeader(disk, disk->page_array[array_pos], &hdr_old))
return false;
array_pos -= hdr.pgoff;
array_pos += filelen_table[hdr.inode];
movePages(disk, array_pos, -1);
-
+
/* Decrease file page count */
filelen_table[hdr.inode]--;
/* Init list for opened files. */
LIST_INIT(&disk->file_opened_list);
- return true;
+ return true;
}
/**
while (first <= last)
{
- page = (first + last) / 2;
+ page = (first + last) / 2;
if (!battfs_readHeader(disk, disk->page_array[page], &hdr))
return NULL;
fcs = computeFcs(&hdr);
if (hdr.fcs == fcs && hdr.inode == inode)
- return (&disk->page_array[page]) - hdr.pgoff;
- else if (hdr.fcs == fcs && hdr.inode < inode)
- first = page + 1;
- else
- last = page - 1;
+ return (&disk->page_array[page]) - hdr.pgoff;
+ else if (hdr.fcs == fcs && hdr.inode < inode)
+ first = page + 1;
+ else
+ last = page - 1;
}
return NULL;
fd->fd.read = battfs_read;
fd->fd.reopen = kfile_genericReopen;
fd->fd.seek = kfile_genericSeek;
-
+
#warning TODO battfs_write, battfs_error, battfs_clearerr
#if 0
fd->fd.write = battfs_write;
return true;
}
+
+#endif