Lines Matching defs:c
25 static int jffs2_flash_setup(struct jffs2_sb_info *c);
31 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
61 ret = jffs2_read_dnode(c, f, f->metadata, mdata, 0, mdatalen);
78 ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &alloclen,
130 new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, alloc_type);
135 jffs2_complete_reservation(c);
152 jffs2_truncate_fragtree (c, &f->fragtree, iattr->ia_size);
155 jffs2_add_full_dnode_to_inode(c, f, new_metadata);
163 jffs2_mark_node_obsolete(c, old_metadata->raw);
169 jffs2_complete_reservation(c);
201 struct jffs2_sb_info *c = JFFS2_SB_INFO(dentry->d_sb);
206 buf->f_blocks = c->flash_size >> PAGE_SHIFT;
211 buf->f_fsid.val[1] = c->mtd->index;
213 spin_lock(&c->erase_completion_lock);
214 avail = c->dirty_size + c->free_size;
215 if (avail > c->sector_size * c->resv_blocks_write)
216 avail -= c->sector_size * c->resv_blocks_write;
219 spin_unlock(&c->erase_completion_lock);
232 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
236 jffs2_do_clear_inode(c, f);
242 struct jffs2_sb_info *c;
258 c = JFFS2_SB_INFO(inode->i_sb);
263 ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node);
321 ret = jffs2_read_dnode(c, f, f->metadata, (char *)&jdev, 0, f->metadata->size);
352 jffs2_do_clear_inode(c, f);
381 struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
383 if (c->flags & JFFS2_SB_FLAG_RO && !(sb->s_flags & MS_RDONLY))
391 jffs2_stop_garbage_collect_thread(c);
392 mutex_lock(&c->alloc_sem);
393 jffs2_flush_wbuf_pad(c);
394 mutex_unlock(&c->alloc_sem);
398 jffs2_start_garbage_collect_thread(c);
407 struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
414 jffs2_garbage_collect_trigger(c);
415 jffs2_erase_pending_blocks(c, 0);
416 jffs2_flush_wbuf_gc(c, 0);
426 struct jffs2_sb_info *c;
432 c = JFFS2_SB_INFO(sb);
463 ret = jffs2_do_new_inode (c, f, mode, ri);
488 struct jffs2_sb_info *c;
493 c = JFFS2_SB_INFO(sb);
496 if (c->mtd->type == MTD_NANDFLASH) {
500 if (c->mtd->type == MTD_DATAFLASH) {
506 c->flash_size = c->mtd->size;
507 c->sector_size = c->mtd->erasesize;
508 blocks = c->flash_size / c->sector_size;
513 if ((c->sector_size * blocks) != c->flash_size) {
514 c->flash_size = c->sector_size * blocks;
516 c->flash_size / 1024);
519 if (c->flash_size < 5*c->sector_size) {
520 printk(KERN_ERR "jffs2: Too few erase blocks (%d)\n", c->flash_size / c->sector_size);
524 c->cleanmarker_size = sizeof(struct jffs2_unknown_node);
527 ret = jffs2_flash_setup(c);
531 c->inocache_list = kcalloc(INOCACHE_HASHSIZE, sizeof(struct jffs2_inode_cache *), GFP_KERNEL);
532 if (!c->inocache_list) {
537 jffs2_init_xattr_subsystem(c);
539 if ((ret = jffs2_do_mount_fs(c)))
562 jffs2_start_garbage_collect_thread(c);
568 jffs2_free_ino_caches(c);
569 jffs2_free_raw_node_refs(c);
570 if (jffs2_blocks_use_vmalloc(c))
571 vfree(c->blocks);
573 kfree(c->blocks);
575 jffs2_clear_xattr_subsystem(c);
576 kfree(c->inocache_list);
578 jffs2_flash_cleanup(c);
583 void jffs2_gc_release_inode(struct jffs2_sb_info *c,
589 struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c,
610 inode = ilookup(OFNI_BS_2SFFJ(c), inum);
615 spin_lock(&c->inocache_lock);
616 ic = jffs2_get_ino_cache(c, inum);
619 spin_unlock(&c->inocache_lock);
626 sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock);
628 spin_unlock(&c->inocache_lock);
638 inode = jffs2_iget(OFNI_BS_2SFFJ(c), inum);
653 unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c,
670 void jffs2_gc_release_page(struct jffs2_sb_info *c,
680 static int jffs2_flash_setup(struct jffs2_sb_info *c) {
683 if (jffs2_cleanmarker_oob(c)) {
685 ret = jffs2_nand_flash_setup(c);
691 if (jffs2_dataflash(c)) {
692 ret = jffs2_dataflash_setup(c);
698 if (jffs2_nor_wbuf_flash(c)) {
699 ret = jffs2_nor_wbuf_flash_setup(c);
705 if (jffs2_ubivol(c)) {
706 ret = jffs2_ubivol_setup(c);
714 void jffs2_flash_cleanup(struct jffs2_sb_info *c) {
716 if (jffs2_cleanmarker_oob(c)) {
717 jffs2_nand_flash_cleanup(c);
721 if (jffs2_dataflash(c)) {
722 jffs2_dataflash_cleanup(c);
726 if (jffs2_nor_wbuf_flash(c)) {
727 jffs2_nor_wbuf_flash_cleanup(c);
731 if (jffs2_ubivol(c)) {
732 jffs2_ubivol_cleanup(c);