Lines Matching defs:c
30 static int jffs2_flash_setup(struct jffs2_sb_info *c);
36 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
67 ret = jffs2_read_dnode(c, f, f->metadata, mdata, 0, mdatalen);
85 ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &alloclen,
139 new_metadata = jffs2_write_dnode(c, f, ri, mdata, mdatalen, alloc_type);
144 jffs2_complete_reservation(c);
161 jffs2_truncate_fragtree (c, &f->fragtree, iattr->ia_size);
164 jffs2_add_full_dnode_to_inode(c, f, new_metadata);
172 jffs2_mark_node_obsolete(c, old_metadata->raw);
178 jffs2_complete_reservation(c);
211 struct jffs2_sb_info *c = JFFS2_SB_INFO(dentry->d_sb);
216 buf->f_blocks = c->flash_size >> PAGE_SHIFT;
221 buf->f_fsid.val[1] = c->mtd->index;
223 spin_lock(&c->erase_completion_lock);
224 avail = c->dirty_size + c->free_size;
225 if (avail > c->sector_size * c->resv_blocks_write)
226 avail -= c->sector_size * c->resv_blocks_write;
229 spin_unlock(&c->erase_completion_lock);
242 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
249 jffs2_do_clear_inode(c, f);
255 struct jffs2_sb_info *c;
271 c = JFFS2_SB_INFO(inode->i_sb);
276 ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node);
333 ret = jffs2_read_dnode(c, f, f->metadata, (char *)&jdev, 0, f->metadata->size);
397 struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
399 if (c->flags & JFFS2_SB_FLAG_RO && !sb_rdonly(sb))
407 jffs2_stop_garbage_collect_thread(c);
408 mutex_lock(&c->alloc_sem);
409 jffs2_flush_wbuf_pad(c);
410 mutex_unlock(&c->alloc_sem);
414 jffs2_start_garbage_collect_thread(c);
426 struct jffs2_sb_info *c;
433 c = JFFS2_SB_INFO(sb);
465 ret = jffs2_do_new_inode (c, f, mode, ri);
515 struct jffs2_sb_info *c;
520 c = JFFS2_SB_INFO(sb);
523 if (c->mtd->type == MTD_MLCNANDFLASH)
527 if (c->mtd->type == MTD_NANDFLASH) {
531 if (c->mtd->type == MTD_DATAFLASH) {
537 c->flash_size = c->mtd->size;
538 c->sector_size = c->mtd->erasesize;
539 blocks = c->flash_size / c->sector_size;
544 if ((c->sector_size * blocks) != c->flash_size) {
545 c->flash_size = c->sector_size * blocks;
547 c->flash_size / 1024);
550 if (c->flash_size < 5*c->sector_size) {
552 c->flash_size / c->sector_size);
556 c->cleanmarker_size = sizeof(struct jffs2_unknown_node);
559 ret = jffs2_flash_setup(c);
563 c->inocache_hashsize = calculate_inocache_hashsize(c->flash_size);
564 c->inocache_list = kcalloc(c->inocache_hashsize, sizeof(struct jffs2_inode_cache *), GFP_KERNEL);
565 if (!c->inocache_list) {
570 jffs2_init_xattr_subsystem(c);
572 if ((ret = jffs2_do_mount_fs(c)))
598 jffs2_start_garbage_collect_thread(c);
602 jffs2_free_ino_caches(c);
603 jffs2_free_raw_node_refs(c);
604 kvfree(c->blocks);
606 jffs2_clear_xattr_subsystem(c);
607 kfree(c->inocache_list);
609 jffs2_flash_cleanup(c);
614 void jffs2_gc_release_inode(struct jffs2_sb_info *c,
620 struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c,
641 inode = ilookup(OFNI_BS_2SFFJ(c), inum);
646 spin_lock(&c->inocache_lock);
647 ic = jffs2_get_ino_cache(c, inum);
651 spin_unlock(&c->inocache_lock);
658 sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock);
660 spin_unlock(&c->inocache_lock);
670 inode = jffs2_iget(OFNI_BS_2SFFJ(c), inum);
685 static int jffs2_flash_setup(struct jffs2_sb_info *c) {
688 if (jffs2_cleanmarker_oob(c)) {
690 ret = jffs2_nand_flash_setup(c);
696 if (jffs2_dataflash(c)) {
697 ret = jffs2_dataflash_setup(c);
703 if (jffs2_nor_wbuf_flash(c)) {
704 ret = jffs2_nor_wbuf_flash_setup(c);
710 if (jffs2_ubivol(c)) {
711 ret = jffs2_ubivol_setup(c);
719 void jffs2_flash_cleanup(struct jffs2_sb_info *c) {
721 if (jffs2_cleanmarker_oob(c)) {
722 jffs2_nand_flash_cleanup(c);
726 if (jffs2_dataflash(c)) {
727 jffs2_dataflash_cleanup(c);
731 if (jffs2_nor_wbuf_flash(c)) {
732 jffs2_nor_wbuf_flash_cleanup(c);
736 if (jffs2_ubivol(c)) {
737 jffs2_ubivol_cleanup(c);