disk_size_t disk_size; ///< Size of the disk, in bytes (page_count * page_size).
disk_size_t free_bytes; ///< Free space on the disk.
-
+
List file_opened_list; ///< List used to keep trace of open files.
/* TODO add other fields. */
} BattFsSuper;
pgcnt_t *start; ///< Pointer to page_array file start position.
} KFileBattFs;
+/**
+ * Id for battfs file descriptors.
+ */
+#define KFT_BATTFS MAKE_ID('B', 'T', 'F', 'S')
+
/**
* Macro used to cast a KFile to a KFileBattFs.
* Also perform dynamic type check.
bool battfs_init(struct BattFsSuper *d);
bool battfs_close(struct BattFsSuper *disk);
+bool battfs_fileExists(BattFsSuper *disk, inode_t inode);
bool battfs_fileopen(BattFsSuper *disk, KFileBattFs *fd, inode_t inode, filemode_t mode);
bool battfs_writeTestBlock(struct BattFsSuper *disk, pgcnt_t page, inode_t inode, seq_t seq, fill_t fill, pgoff_t pgoff, mark_t mark);