+typedef uint8_t filemode_t; ///< Type for file open modes.
+typedef uint32_t file_size_t; ///< Type for file sizes.
+
+/**
+ * Modes for battfs_fileopen.
+ * \{
+ */
+#define BATTFS_CREATE BV(0) ///< Create file if does not exist
+#define BATTFS_RD BV(1) ///< Open file for reading
+#define BATTFS_WR BV(2) ///< Open file fir writing
+/*/}*/
+
+
+/**
+ * Describe a BattFs file usign a KFile.
+ */
+typedef struct KFileBattFs
+{
+ KFile fd; ///< KFile context
+ Node link; ///< Link for inserting in opened file list
+ inode_t inode; ///< inode of the opened file
+ BattFsSuper *disk; ///< Disk context
+ filemode_t mode; ///< File open mode
+ 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.
+ */
+INLINE KFileBattFs * KFILEBATTFS(KFile *fd)
+{
+ ASSERT(fd->_type == KFT_BATTFS);
+ return (KFileBattFs *)fd;
+}
+
+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);
+