0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef _JFFS2_FS_SB
0014 #define _JFFS2_FS_SB
0015
0016 #include <linux/types.h>
0017 #include <linux/spinlock.h>
0018 #include <linux/workqueue.h>
0019 #include <linux/completion.h>
0020 #include <linux/mutex.h>
0021 #include <linux/timer.h>
0022 #include <linux/wait.h>
0023 #include <linux/list.h>
0024 #include <linux/rwsem.h>
0025
0026 #define JFFS2_SB_FLAG_RO 1
0027 #define JFFS2_SB_FLAG_SCANNING 2
0028 #define JFFS2_SB_FLAG_BUILDING 4
0029
0030 struct jffs2_inodirty;
0031
0032 struct jffs2_mount_opts {
0033 bool override_compr;
0034 unsigned int compr;
0035
0036
0037
0038
0039
0040
0041 bool set_rp_size;
0042 unsigned int rp_size;
0043 };
0044
0045
0046
0047
0048
0049 struct jffs2_sb_info {
0050 struct mtd_info *mtd;
0051
0052 uint32_t highest_ino;
0053 uint32_t check_ino;
0054
0055 unsigned int flags;
0056
0057 struct task_struct *gc_task;
0058 struct completion gc_thread_start;
0059 struct completion gc_thread_exit;
0060
0061 struct mutex alloc_sem;
0062
0063
0064 uint32_t cleanmarker_size;
0065
0066
0067 uint32_t flash_size;
0068 uint32_t used_size;
0069 uint32_t dirty_size;
0070 uint32_t wasted_size;
0071 uint32_t free_size;
0072 uint32_t erasing_size;
0073 uint32_t bad_size;
0074 uint32_t sector_size;
0075 uint32_t unchecked_size;
0076
0077 uint32_t nr_free_blocks;
0078 uint32_t nr_erasing_blocks;
0079
0080
0081 uint8_t resv_blocks_write;
0082 uint8_t resv_blocks_deletion;
0083 uint8_t resv_blocks_gctrigger;
0084 uint8_t resv_blocks_gcbad;
0085 uint8_t resv_blocks_gcmerge;
0086
0087 uint8_t vdirty_blocks_gctrigger;
0088
0089 uint32_t nospc_dirty_size;
0090
0091 uint32_t nr_blocks;
0092 struct jffs2_eraseblock *blocks;
0093
0094 struct jffs2_eraseblock *nextblock;
0095
0096 struct jffs2_eraseblock *gcblock;
0097
0098 struct list_head clean_list;
0099 struct list_head very_dirty_list;
0100 struct list_head dirty_list;
0101 struct list_head erasable_list;
0102 struct list_head erasable_pending_wbuf_list;
0103 struct list_head erasing_list;
0104 struct list_head erase_checking_list;
0105 struct list_head erase_pending_list;
0106 struct list_head erase_complete_list;
0107 struct list_head free_list;
0108 struct list_head bad_list;
0109 struct list_head bad_used_list;
0110
0111 spinlock_t erase_completion_lock;
0112
0113 wait_queue_head_t erase_wait;
0114
0115 wait_queue_head_t inocache_wq;
0116 int inocache_hashsize;
0117 struct jffs2_inode_cache **inocache_list;
0118 spinlock_t inocache_lock;
0119
0120
0121
0122
0123 struct mutex erase_free_sem;
0124
0125 uint32_t wbuf_pagesize;
0126
0127 #ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
0128 unsigned char *wbuf_verify;
0129 #endif
0130 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
0131 unsigned char *wbuf;
0132 uint32_t wbuf_ofs;
0133 uint32_t wbuf_len;
0134 struct jffs2_inodirty *wbuf_inodes;
0135 struct rw_semaphore wbuf_sem;
0136
0137 struct delayed_work wbuf_dwork;
0138
0139 unsigned char *oobbuf;
0140 int oobavail;
0141 #endif
0142
0143 struct jffs2_summary *summary;
0144 struct jffs2_mount_opts mount_opts;
0145
0146 #ifdef CONFIG_JFFS2_FS_XATTR
0147 #define XATTRINDEX_HASHSIZE (57)
0148 uint32_t highest_xid;
0149 uint32_t highest_xseqno;
0150 struct list_head xattrindex[XATTRINDEX_HASHSIZE];
0151 struct list_head xattr_unchecked;
0152 struct list_head xattr_dead_list;
0153 struct jffs2_xattr_ref *xref_dead_list;
0154 struct jffs2_xattr_ref *xref_temp;
0155 struct rw_semaphore xattr_sem;
0156 uint32_t xdatum_mem_usage;
0157 uint32_t xdatum_mem_threshold;
0158 #endif
0159
0160 void *os_priv;
0161 };
0162
0163 #endif