Rename battfs_init to battfs_mount and battfs_close to battfs_umount.
[bertos.git] / bertos / fs / battfs.c
index 77cc57f0eaf8409e9d9ca42a40f7d1a6ac90fe1d..ae3cde9ed7940e361a4942bd53548852225e2b66 100644 (file)
@@ -232,7 +232,7 @@ static pgcnt_t countPages(pgoff_t *filelen_table, inode_t inode)
 static void movePages(struct BattFsSuper *disk, pgcnt_t src, int offset)
 {
        pgcnt_t dst = src + offset;
-       LOG_INFO("src %d, offset %d, size %ld\n", src, offset, (disk->page_count - MAX(dst, src)) * sizeof(pgcnt_t));
+       LOG_INFO("src %d, offset %d, size %d\n", src, offset, (unsigned int)((disk->page_count - MAX(dst, src)) * sizeof(pgcnt_t)));
        memmove(&disk->page_array[dst], &disk->page_array[src], (disk->page_count - MAX(dst, src)) * sizeof(pgcnt_t));
 
        if (offset < 0)
@@ -438,7 +438,7 @@ static bool loadPage(struct BattFsSuper *disk, pgcnt_t new_page, BattFsPageHeade
  * \a disk.
  * \return false on errors, true otherwise.
  */
-bool battfs_init(struct BattFsSuper *disk)
+bool battfs_mount(struct BattFsSuper *disk)
 {
        pgoff_t filelen_table[BATTFS_MAX_FILES];
 
@@ -620,7 +620,7 @@ static bool getNewPage(struct BattFsSuper *disk, pgcnt_t new_pos, inode_t inode,
        disk->cache_dirty = true;
 
        new_hdr->inode = inode;
-       new_hdr->pgoff =  pgoff;
+       new_hdr->pgoff = pgoff;
        new_hdr->fill = 0;
        new_hdr->seq = 0;
        return setBufferHdr(disk, new_hdr);
@@ -717,7 +717,7 @@ static size_t battfs_write(struct KFile *fd, const void *_buf, size_t size)
                /* Handle write outside EOF */
                if (pg_offset > fdb->max_off)
                {
-                       LOG_INFO("New page needed, pg_offset %d, pos %d\n", pg_offset, (fdb->start - disk->page_array) + pg_offset);
+                       LOG_INFO("New page needed, pg_offset %d, pos %d\n", pg_offset, (int)((fdb->start - disk->page_array) + pg_offset));
                        if (!getNewPage(disk, (fdb->start - disk->page_array) + pg_offset, fdb->inode, pg_offset, &curr_hdr))
                                return total_write;
                        fdb->max_off = pg_offset;
@@ -958,9 +958,9 @@ bool battfs_fileopen(BattFsSuper *disk, BattFs *fd, inode_t inode, filemode_t mo
 }
 
 /**
- * Close \a disk.
+ * Umount \a disk.
  */
-bool battfs_close(struct BattFsSuper *disk)
+bool battfs_umount(struct BattFsSuper *disk)
 {
        Node *n;
        int res = 0;