+ /* Runtime checkpointing stuff */
+ int checkpt_page_seq; /* running sequence number of checkpoint pages */
+ int checkpt_byte_count;
+ int checkpt_byte_offs;
+ __u8 *checkpt_buffer;
+ int checkpt_open_write;
+ int blocks_in_checkpt;
+ int checkpt_cur_chunk;
+ int checkpt_cur_block;
+ int checkpt_next_block;
+ int *checkpt_block_list;
+ int checkpt_max_blocks;
+ __u32 checkpt_sum;
+ __u32 checkpt_xor;
+
+ int checkpoint_blocks_required; /* Number of blocks needed to store current checkpoint set */
+
+ /* Block Info */
+ yaffs_block_info_t *block_info;
+ __u8 *chunk_bits; /* bitmap of chunks in use */
+ unsigned block_info_alt:1; /* was allocated using alternative strategy */
+ unsigned chunk_bits_alt:1; /* was allocated using alternative strategy */
+ int chunk_bit_stride; /* Number of bytes of chunk_bits per block.
+ * Must be consistent with chunks_per_block.
+ */
+
+ int n_erased_blocks;
+ int alloc_block; /* Current block being allocated off */
+ __u32 alloc_page;
+ int alloc_block_finder; /* Used to search for next allocation block */
+
+ /* Object and Tnode memory management */
+ void *allocator;
+ int n_obj;
+ int n_tnodes;
+
+ int n_hardlinks;
+
+ yaffs_obj_bucket obj_bucket[YAFFS_NOBJECT_BUCKETS];
+ __u32 bucket_finder;
+
+ int n_free_chunks;
+
+ /* Garbage collection control */
+ __u32 *gc_cleanup_list; /* objects to delete at the end of a GC. */
+ __u32 n_clean_ups;
+
+ unsigned has_pending_prioritised_gc; /* We think this device might have pending prioritised gcs */
+ unsigned gc_disable;
+ unsigned gc_block_finder;
+ unsigned gc_dirtiest;
+ unsigned gc_pages_in_use;
+ unsigned gc_not_done;
+ unsigned gc_block;
+ unsigned gc_chunk;
+ unsigned gc_skip;
+
+ /* Special directories */
+ yaffs_obj_t *root_dir;
+ yaffs_obj_t *lost_n_found;
+
+ /* Buffer areas for storing data to recover from write failures TODO
+ * __u8 buffered_data[YAFFS_CHUNKS_PER_BLOCK][YAFFS_BYTES_PER_CHUNK];
+ * yaffs_spare buffered_spare[YAFFS_CHUNKS_PER_BLOCK];
+ */
+
+ int buffered_block; /* Which block is buffered here? */
+ int doing_buffered_block_rewrite;
+
+ yaffs_cache_t *cache;
+ int cache_last_use;
+
+ /* Stuff for background deletion and unlinked files.*/
+ yaffs_obj_t *unlinked_dir; /* Directory where unlinked and deleted files live. */
+ yaffs_obj_t *del_dir; /* Directory where deleted objects are sent to disappear. */
+ yaffs_obj_t *unlinked_deletion; /* Current file being background deleted.*/
+ int n_deleted_files; /* Count of files awaiting deletion;*/
+ int n_unlinked_files; /* Count of unlinked files. */
+ int n_bg_deletions; /* Count of background deletions. */
+
+ /* Temporary buffer management */
+ yaffs_buffer_t temp_buffer[YAFFS_N_TEMP_BUFFERS];
+ int max_temp;
+ int temp_in_use;
+ int unmanaged_buffer_allocs;
+ int unmanaged_buffer_deallocs;
+
+ /* yaffs2 runtime stuff */
+ unsigned seq_number; /* Sequence number of currently allocating block */
+ unsigned oldest_dirty_seq;
+ unsigned oldest_dirty_block;
+
+ /* Block refreshing */
+ int refresh_skip; /* A skip down counter. Refresh happens when this gets to zero. */
+
+ /* Dirty directory handling */
+ struct ylist_head dirty_dirs; /* List of dirty directories */
+
+
+ /* Statistcs */
+ __u32 n_page_writes;
+ __u32 n_page_reads;
+ __u32 n_erasures;
+ __u32 n_erase_failures;
+ __u32 n_gc_copies;
+ __u32 all_gcs;
+ __u32 passive_gc_count;
+ __u32 oldest_dirty_gc_count;
+ __u32 n_gc_blocks;
+ __u32 bg_gcs;
+ __u32 n_retired_writes;
+ __u32 n_retired_blocks;
+ __u32 n_ecc_fixed;
+ __u32 n_ecc_unfixed;
+ __u32 n_tags_ecc_fixed;
+ __u32 n_tags_ecc_unfixed;
+ __u32 n_deletions;
+ __u32 n_unmarked_deletions;
+ __u32 refresh_count;
+ __u32 cache_hits;
+
+};