Lines Matching refs:c

76 	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);  in jffs2_statfs()  local
81 buf->f_blocks = c->flash_size >> PAGE_SHIFT; in jffs2_statfs()
86 spin_lock_bh(&c->erase_completion_lock); in jffs2_statfs()
88 avail = c->dirty_size + c->free_size; in jffs2_statfs()
89 if (avail > c->sector_size * JFFS2_RESERVED_BLOCKS_WRITE) in jffs2_statfs()
90 avail -= c->sector_size * JFFS2_RESERVED_BLOCKS_WRITE; in jffs2_statfs()
98 printk(KERN_DEBUG "flash_size: %08x\n", c->flash_size); in jffs2_statfs()
99 printk(KERN_DEBUG "used_size: %08x\n", c->used_size); in jffs2_statfs()
100 printk(KERN_DEBUG "dirty_size: %08x\n", c->dirty_size); in jffs2_statfs()
101 printk(KERN_DEBUG "free_size: %08x\n", c->free_size); in jffs2_statfs()
102 printk(KERN_DEBUG "erasing_size: %08x\n", c->erasing_size); in jffs2_statfs()
103 printk(KERN_DEBUG "bad_size: %08x\n", c->bad_size); in jffs2_statfs()
104 printk(KERN_DEBUG "sector_size: %08x\n", c->sector_size); in jffs2_statfs()
106 if (c->nextblock) { in jffs2_statfs()
107 printk(KERN_DEBUG "nextblock: 0x%08x\n", c->nextblock->offset); in jffs2_statfs()
111 if (c->gcblock) { in jffs2_statfs()
112 printk(KERN_DEBUG "gcblock: 0x%08x\n", c->gcblock->offset); in jffs2_statfs()
116 if (list_empty(&c->clean_list)) { in jffs2_statfs()
121 list_for_each(this, &c->clean_list) { in jffs2_statfs()
126 if (list_empty(&c->dirty_list)) { in jffs2_statfs()
131 list_for_each(this, &c->dirty_list) { in jffs2_statfs()
136 if (list_empty(&c->erasing_list)) { in jffs2_statfs()
141 list_for_each(this, &c->erasing_list) { in jffs2_statfs()
146 if (list_empty(&c->erase_pending_list)) { in jffs2_statfs()
151 list_for_each(this, &c->erase_pending_list) { in jffs2_statfs()
156 if (list_empty(&c->free_list)) { in jffs2_statfs()
161 list_for_each(this, &c->free_list) { in jffs2_statfs()
166 if (list_empty(&c->bad_list)) { in jffs2_statfs()
171 list_for_each(this, &c->bad_list) { in jffs2_statfs()
176 if (list_empty(&c->bad_used_list)) { in jffs2_statfs()
181 list_for_each(this, &c->bad_used_list) { in jffs2_statfs()
188 spin_unlock_bh(&c->erase_completion_lock); in jffs2_statfs()
196 struct jffs2_sb_info *c; in jffs2_read_super() local
208 c = JFFS2_SB_INFO(sb); in jffs2_read_super()
209 memset(c, 0, sizeof(*c)); in jffs2_read_super()
211 c->mtd = get_mtd_device(NULL, MINOR(sb->s_dev)); in jffs2_read_super()
212 if (!c->mtd) { in jffs2_read_super()
216 c->sector_size = c->mtd->erasesize; in jffs2_read_super()
217 c->free_size = c->flash_size = c->mtd->size; in jffs2_read_super()
218 c->nr_blocks = c->mtd->size / c->mtd->erasesize; in jffs2_read_super()
219 c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL); in jffs2_read_super()
220 if (!c->blocks) in jffs2_read_super()
222 for (i=0; i<c->nr_blocks; i++) { in jffs2_read_super()
223 INIT_LIST_HEAD(&c->blocks[i].list); in jffs2_read_super()
224 c->blocks[i].offset = i * c->sector_size; in jffs2_read_super()
225 c->blocks[i].free_size = c->sector_size; in jffs2_read_super()
226 c->blocks[i].dirty_size = 0; in jffs2_read_super()
227 c->blocks[i].used_size = 0; in jffs2_read_super()
228 c->blocks[i].first_node = NULL; in jffs2_read_super()
229 c->blocks[i].last_node = NULL; in jffs2_read_super()
232 spin_lock_init(&c->nodelist_lock); in jffs2_read_super()
233 init_MUTEX(&c->alloc_sem); in jffs2_read_super()
234 init_waitqueue_head(&c->erase_wait); in jffs2_read_super()
235 spin_lock_init(&c->erase_completion_lock); in jffs2_read_super()
236 spin_lock_init(&c->inocache_lock); in jffs2_read_super()
238 INIT_LIST_HEAD(&c->clean_list); in jffs2_read_super()
239 INIT_LIST_HEAD(&c->dirty_list); in jffs2_read_super()
240 INIT_LIST_HEAD(&c->erasing_list); in jffs2_read_super()
241 INIT_LIST_HEAD(&c->erase_pending_list); in jffs2_read_super()
242 INIT_LIST_HEAD(&c->erase_complete_list); in jffs2_read_super()
243 INIT_LIST_HEAD(&c->free_list); in jffs2_read_super()
244 INIT_LIST_HEAD(&c->bad_list); in jffs2_read_super()
245 INIT_LIST_HEAD(&c->bad_used_list); in jffs2_read_super()
246 c->highest_ino = 1; in jffs2_read_super()
248 if (jffs2_build_filesystem(c)) { in jffs2_read_super()
274 jffs2_start_garbage_collect_thread(c); in jffs2_read_super()
280 jffs2_free_ino_caches(c); in jffs2_read_super()
281 jffs2_free_raw_node_refs(c); in jffs2_read_super()
282 kfree(c->blocks); in jffs2_read_super()
284 put_mtd_device(c->mtd); in jffs2_read_super()
290 struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); in jffs2_put_super() local
295 jffs2_stop_garbage_collect_thread(c); in jffs2_put_super()
296 jffs2_free_ino_caches(c); in jffs2_put_super()
297 jffs2_free_raw_node_refs(c); in jffs2_put_super()
298 kfree(c->blocks); in jffs2_put_super()
299 if (c->mtd->sync) in jffs2_put_super()
300 c->mtd->sync(c->mtd); in jffs2_put_super()
301 put_mtd_device(c->mtd); in jffs2_put_super()
308 struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); in jffs2_remount_fs() local
310 if (c->flags & JFFS2_SB_FLAG_RO && !(sb->s_flags & MS_RDONLY)) in jffs2_remount_fs()
317 jffs2_stop_garbage_collect_thread(c); in jffs2_remount_fs()
320 jffs2_start_garbage_collect_thread(c); in jffs2_remount_fs()
329 struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); in jffs2_write_super() local
335 jffs2_garbage_collect_trigger(c); in jffs2_write_super()
336 jffs2_erase_pending_blocks(c); in jffs2_write_super()
337 jffs2_mark_erased_blocks(c); in jffs2_write_super()