Pack seqnum with mark MSB to save 1 byte.
[bertos.git] / fs / battfs.h
index 6f20839135a33fadea975858a7d9b884dc8b9a36..9235263e8efb0915c761b4af0a5e6bd7b9e51854 100644 (file)
@@ -92,7 +92,7 @@ typedef struct BattFsPageHeader
  * \see battfs_to_disk
  * \see disk_to_battfs
  */
-#define BATTFS_HEADER_LEN 13
+#define BATTFS_HEADER_LEN 12
 
 /**
  * Marks for valid pages.
@@ -196,8 +196,17 @@ typedef struct BattFsSuper
         */
        pgcnt_t *page_array;
 
-       mark_t free_min;      ///< Lowest free page counter.
-       mark_t free_max;      ///< Highest free page counter.
+    /**
+        * Lowest free page counter.
+        * This is the counter of the first availble free page.
+        */
+       mark_t free_start;
+
+    /**
+        * Highest free page counter.
+        * This value is the next to be used to mark a block as free.
+        */
+       mark_t free_next;
 
        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.