yaffs2: Make checkpoint block scanning skip bad blocks.
[yaffs2.git] / yaffs_guts.h
index 93809665c6097c0524eba88ea428018b9984f6a3..e3558c5a6d04385492eb896e2c2cf429d5547322 100644 (file)
 #define YAFFS_TNODES_INTERNAL_BITS     (YAFFS_TNODES_LEVEL0_BITS - 1)
 #define YAFFS_TNODES_INTERNAL_MASK     0x7
 #define YAFFS_TNODES_MAX_LEVEL         8
-
+#define YAFFS_TNODES_MAX_BITS          (YAFFS_TNODES_LEVEL0_BITS + \
+                                       YAFFS_TNODES_INTERNAL_BITS * \
+                                       YAFFS_TNODES_MAX_LEVEL)
+#define YAFFS_MAX_CHUNK_ID             ((1 << YAFFS_TNODES_MAX_BITS) - 1)
 
 /* Constants for YAFFS1 mode */
 #define YAFFS_BYTES_PER_SPARE          16
@@ -61,7 +64,7 @@
 #define YAFFS_MIN_YAFFS2_CHUNK_SIZE    1024
 #define YAFFS_MIN_YAFFS2_SPARE_SIZE    32
 
-#define YAFFS_MAX_CHUNK_ID             0x000fffff
+
 
 #define YAFFS_ALLOCATION_NOBJECTS      100
 #define YAFFS_ALLOCATION_NTNODES       100
@@ -72,7 +75,9 @@
 #define YAFFS_OBJECT_SPACE             0x40000
 #define YAFFS_MAX_OBJECT_ID            (YAFFS_OBJECT_SPACE - 1)
 
-#define YAFFS_CHECKPOINT_VERSION       5
+/* Binary data version stamps */
+#define YAFFS_SUMMARY_VERSION          1
+#define YAFFS_CHECKPOINT_VERSION       6
 
 #ifdef CONFIG_YAFFS_UNICODE
 #define YAFFS_MAX_NAME_LENGTH          127
@@ -531,7 +536,7 @@ struct yaffs_param {
                                 */
        int use_nand_ecc;       /* Flag to decide whether or not to use
                                 * NAND driver ECC on data (yaffs1) */
-        int tags_9bytes;       /* Use 9 byte tags */
+       int tags_9bytes;        /* Use 9 byte tags */
        int no_tags_ecc;        /* Flag to decide whether or not to do ECC
                                 * on packed tags (yaffs2) */
 
@@ -600,6 +605,11 @@ struct yaffs_param {
        int always_check_erased;        /* Force chunk erased check always on */
 
        int disable_summary;
+
+       int max_objects;        /*
+                                * Set to limit the number of objects created.
+                                * 0 = no limit.
+                               */
 };
 
 struct yaffs_dev {
@@ -949,11 +959,15 @@ u32 yaffs_get_group_base(struct yaffs_dev *dev, struct yaffs_tnode *tn,
 
 int yaffs_is_non_empty_dir(struct yaffs_obj *obj);
 
-/*\
+void yaffs_addr_to_chunk(struct yaffs_dev *dev, loff_t addr,
+                               int *chunk_out, u32 *offset_out);
+/*
  * Marshalling functions to get loff_t file sizes into aand out of
  * object headers.
  */
 void yaffs_oh_size_load(struct yaffs_obj_hdr *oh, loff_t fsize);
 loff_t yaffs_oh_to_size(struct yaffs_obj_hdr *oh);
+loff_t yaffs_max_file_size(struct yaffs_dev *dev);
+
 
 #endif