Lines Matching refs:c
67 static int validate_inode(struct ubifs_info *c, const struct inode *inode) in validate_inode() argument
72 if (inode->i_size > c->max_inode_sz) { in validate_inode()
73 ubifs_err(c, "inode is too large (%lld)", in validate_inode()
79 ubifs_err(c, "unknown compression type %d", ui->compr_type); in validate_inode()
93 ubifs_warn(c, "inode %lu uses '%s' compression, but it was not compiled in", in validate_inode()
97 err = dbg_check_dir(c, inode); in validate_inode()
106 struct ubifs_info *c = sb->s_fs_info; in ubifs_iget() local
125 ino_key_init(c, &key, inode->i_ino); in ubifs_iget()
127 err = ubifs_tnc_lookup(c, &key, ino); in ubifs_iget()
158 err = validate_inode(c, inode); in ubifs_iget()
249 ubifs_err(c, "inode %lu validation failed, error %d", inode->i_ino, err); in ubifs_iget()
250 ubifs_dump_node(c, ino); in ubifs_iget()
251 ubifs_dump_inode(c, inode); in ubifs_iget()
256 ubifs_err(c, "failed to read inode %lu, error %d", inode->i_ino, err); in ubifs_iget()
297 struct ubifs_info *c = inode->i_sb->s_fs_info; in ubifs_write_inode() local
324 err = ubifs_jnl_write_inode(c, inode); in ubifs_write_inode()
326 ubifs_err(c, "can't write inode %lu, error %d", in ubifs_write_inode()
329 err = dbg_check_inode_size(c, inode, ui->ui_size); in ubifs_write_inode()
334 ubifs_release_dirty_inode_budget(c, ui); in ubifs_write_inode()
341 struct ubifs_info *c = inode->i_sb->s_fs_info; in ubifs_evict_inode() local
364 err = ubifs_jnl_delete_inode(c, inode); in ubifs_evict_inode()
370 ubifs_err(c, "can't delete inode %lu, error %d", in ubifs_evict_inode()
375 ubifs_release_dirty_inode_budget(c, ui); in ubifs_evict_inode()
378 c->bi.nospace = c->bi.nospace_rp = 0; in ubifs_evict_inode()
398 struct ubifs_info *c = dentry->d_sb->s_fs_info; in ubifs_statfs() local
400 __le32 *uuid = (__le32 *)c->uuid; in ubifs_statfs()
402 free = ubifs_get_free_space(c); in ubifs_statfs()
408 buf->f_blocks = c->block_cnt; in ubifs_statfs()
410 if (free > c->report_rp_size) in ubifs_statfs()
411 buf->f_bavail = (free - c->report_rp_size) >> UBIFS_BLOCK_SHIFT; in ubifs_statfs()
419 ubifs_assert(buf->f_bfree <= c->block_cnt); in ubifs_statfs()
425 struct ubifs_info *c = root->d_sb->s_fs_info; in ubifs_show_options() local
427 if (c->mount_opts.unmount_mode == 2) in ubifs_show_options()
429 else if (c->mount_opts.unmount_mode == 1) in ubifs_show_options()
432 if (c->mount_opts.bulk_read == 2) in ubifs_show_options()
434 else if (c->mount_opts.bulk_read == 1) in ubifs_show_options()
437 if (c->mount_opts.chk_data_crc == 2) in ubifs_show_options()
439 else if (c->mount_opts.chk_data_crc == 1) in ubifs_show_options()
442 if (c->mount_opts.override_compr) { in ubifs_show_options()
444 ubifs_compr_name(c->mount_opts.compr_type)); in ubifs_show_options()
453 struct ubifs_info *c = sb->s_fs_info; in ubifs_sync_fs() local
467 for (i = 0; i < c->jhead_cnt; i++) { in ubifs_sync_fs()
468 err = ubifs_wbuf_sync(&c->jheads[i].wbuf); in ubifs_sync_fs()
480 err = ubifs_run_commit(c); in ubifs_sync_fs()
484 return ubi_sync(c->vi.ubi_num); in ubifs_sync_fs()
496 static int init_constants_early(struct ubifs_info *c) in init_constants_early() argument
498 if (c->vi.corrupted) { in init_constants_early()
499 ubifs_warn(c, "UBI volume is corrupted - read-only mode"); in init_constants_early()
500 c->ro_media = 1; in init_constants_early()
503 if (c->di.ro_mode) { in init_constants_early()
504 ubifs_msg(c, "read-only UBI device"); in init_constants_early()
505 c->ro_media = 1; in init_constants_early()
508 if (c->vi.vol_type == UBI_STATIC_VOLUME) { in init_constants_early()
509 ubifs_msg(c, "static UBI volume - read-only mode"); in init_constants_early()
510 c->ro_media = 1; in init_constants_early()
513 c->leb_cnt = c->vi.size; in init_constants_early()
514 c->leb_size = c->vi.usable_leb_size; in init_constants_early()
515 c->leb_start = c->di.leb_start; in init_constants_early()
516 c->half_leb_size = c->leb_size / 2; in init_constants_early()
517 c->min_io_size = c->di.min_io_size; in init_constants_early()
518 c->min_io_shift = fls(c->min_io_size) - 1; in init_constants_early()
519 c->max_write_size = c->di.max_write_size; in init_constants_early()
520 c->max_write_shift = fls(c->max_write_size) - 1; in init_constants_early()
522 if (c->leb_size < UBIFS_MIN_LEB_SZ) { in init_constants_early()
523 ubifs_err(c, "too small LEBs (%d bytes), min. is %d bytes", in init_constants_early()
524 c->leb_size, UBIFS_MIN_LEB_SZ); in init_constants_early()
528 if (c->leb_cnt < UBIFS_MIN_LEB_CNT) { in init_constants_early()
529 ubifs_err(c, "too few LEBs (%d), min. is %d", in init_constants_early()
530 c->leb_cnt, UBIFS_MIN_LEB_CNT); in init_constants_early()
534 if (!is_power_of_2(c->min_io_size)) { in init_constants_early()
535 ubifs_err(c, "bad min. I/O size %d", c->min_io_size); in init_constants_early()
543 if (c->max_write_size < c->min_io_size || in init_constants_early()
544 c->max_write_size % c->min_io_size || in init_constants_early()
545 !is_power_of_2(c->max_write_size)) { in init_constants_early()
546 ubifs_err(c, "bad write buffer size %d for %d min. I/O unit", in init_constants_early()
547 c->max_write_size, c->min_io_size); in init_constants_early()
556 if (c->min_io_size < 8) { in init_constants_early()
557 c->min_io_size = 8; in init_constants_early()
558 c->min_io_shift = 3; in init_constants_early()
559 if (c->max_write_size < c->min_io_size) { in init_constants_early()
560 c->max_write_size = c->min_io_size; in init_constants_early()
561 c->max_write_shift = c->min_io_shift; in init_constants_early()
565 c->ref_node_alsz = ALIGN(UBIFS_REF_NODE_SZ, c->min_io_size); in init_constants_early()
566 c->mst_node_alsz = ALIGN(UBIFS_MST_NODE_SZ, c->min_io_size); in init_constants_early()
572 c->ranges[UBIFS_PAD_NODE].len = UBIFS_PAD_NODE_SZ; in init_constants_early()
573 c->ranges[UBIFS_SB_NODE].len = UBIFS_SB_NODE_SZ; in init_constants_early()
574 c->ranges[UBIFS_MST_NODE].len = UBIFS_MST_NODE_SZ; in init_constants_early()
575 c->ranges[UBIFS_REF_NODE].len = UBIFS_REF_NODE_SZ; in init_constants_early()
576 c->ranges[UBIFS_TRUN_NODE].len = UBIFS_TRUN_NODE_SZ; in init_constants_early()
577 c->ranges[UBIFS_CS_NODE].len = UBIFS_CS_NODE_SZ; in init_constants_early()
579 c->ranges[UBIFS_INO_NODE].min_len = UBIFS_INO_NODE_SZ; in init_constants_early()
580 c->ranges[UBIFS_INO_NODE].max_len = UBIFS_MAX_INO_NODE_SZ; in init_constants_early()
581 c->ranges[UBIFS_ORPH_NODE].min_len = in init_constants_early()
583 c->ranges[UBIFS_ORPH_NODE].max_len = c->leb_size; in init_constants_early()
584 c->ranges[UBIFS_DENT_NODE].min_len = UBIFS_DENT_NODE_SZ; in init_constants_early()
585 c->ranges[UBIFS_DENT_NODE].max_len = UBIFS_MAX_DENT_NODE_SZ; in init_constants_early()
586 c->ranges[UBIFS_XENT_NODE].min_len = UBIFS_XENT_NODE_SZ; in init_constants_early()
587 c->ranges[UBIFS_XENT_NODE].max_len = UBIFS_MAX_XENT_NODE_SZ; in init_constants_early()
588 c->ranges[UBIFS_DATA_NODE].min_len = UBIFS_DATA_NODE_SZ; in init_constants_early()
589 c->ranges[UBIFS_DATA_NODE].max_len = UBIFS_MAX_DATA_NODE_SZ; in init_constants_early()
594 c->ranges[UBIFS_IDX_NODE].min_len = UBIFS_IDX_NODE_SZ + UBIFS_BRANCH_SZ; in init_constants_early()
599 c->ranges[UBIFS_IDX_NODE].max_len = INT_MAX; in init_constants_early()
605 c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size); in init_constants_early()
606 c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size); in init_constants_early()
613 c->leb_overhead = c->leb_size % UBIFS_MAX_DATA_NODE_SZ; in init_constants_early()
616 c->max_bu_buf_len = UBIFS_MAX_BULK_READ * UBIFS_MAX_DATA_NODE_SZ; in init_constants_early()
617 if (c->max_bu_buf_len > c->leb_size) in init_constants_early()
618 c->max_bu_buf_len = c->leb_size; in init_constants_early()
637 static int bud_wbuf_callback(struct ubifs_info *c, int lnum, int free, int pad) in bud_wbuf_callback() argument
639 return ubifs_update_one_lp(c, lnum, free, pad, 0, 0); in bud_wbuf_callback()
651 static int init_constants_sb(struct ubifs_info *c) in init_constants_sb() argument
656 c->main_bytes = (long long)c->main_lebs * c->leb_size; in init_constants_sb()
657 c->max_znode_sz = sizeof(struct ubifs_znode) + in init_constants_sb()
658 c->fanout * sizeof(struct ubifs_zbranch); in init_constants_sb()
660 tmp = ubifs_idx_node_sz(c, 1); in init_constants_sb()
661 c->ranges[UBIFS_IDX_NODE].min_len = tmp; in init_constants_sb()
662 c->min_idx_node_sz = ALIGN(tmp, 8); in init_constants_sb()
664 tmp = ubifs_idx_node_sz(c, c->fanout); in init_constants_sb()
665 c->ranges[UBIFS_IDX_NODE].max_len = tmp; in init_constants_sb()
666 c->max_idx_node_sz = ALIGN(tmp, 8); in init_constants_sb()
669 tmp = UBIFS_CS_NODE_SZ + UBIFS_REF_NODE_SZ * c->jhead_cnt; in init_constants_sb()
670 tmp = ALIGN(tmp, c->min_io_size); in init_constants_sb()
671 if (tmp > c->leb_size) { in init_constants_sb()
672 ubifs_err(c, "too small LEB size %d, at least %d needed", in init_constants_sb()
673 c->leb_size, tmp); in init_constants_sb()
681 tmp64 = c->max_bud_bytes + c->leb_size - 1; in init_constants_sb()
682 c->max_bud_cnt = div_u64(tmp64, c->leb_size); in init_constants_sb()
683 tmp = (c->ref_node_alsz * c->max_bud_cnt + c->leb_size - 1); in init_constants_sb()
684 tmp /= c->leb_size; in init_constants_sb()
686 if (c->log_lebs < tmp) { in init_constants_sb()
687 ubifs_err(c, "too small log %d LEBs, required min. %d LEBs", in init_constants_sb()
688 c->log_lebs, tmp); in init_constants_sb()
699 c->bi.page_budget = UBIFS_MAX_DATA_NODE_SZ * UBIFS_BLOCKS_PER_PAGE; in init_constants_sb()
700 c->bi.inode_budget = UBIFS_INO_NODE_SZ; in init_constants_sb()
701 c->bi.dent_budget = UBIFS_MAX_DENT_NODE_SZ; in init_constants_sb()
710 c->bg_bud_bytes = (c->max_bud_bytes * 13) >> 4; in init_constants_sb()
718 tmp64 = (long long)(c->jhead_cnt + 1) * c->leb_size + 1; in init_constants_sb()
719 if (c->bg_bud_bytes < tmp64) in init_constants_sb()
720 c->bg_bud_bytes = tmp64; in init_constants_sb()
721 if (c->max_bud_bytes < tmp64 + c->leb_size) in init_constants_sb()
722 c->max_bud_bytes = tmp64 + c->leb_size; in init_constants_sb()
724 err = ubifs_calc_lpt_geom(c); in init_constants_sb()
729 c->idx_leb_size = c->leb_size - c->max_idx_node_sz; in init_constants_sb()
741 static void init_constants_master(struct ubifs_info *c) in init_constants_master() argument
745 c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); in init_constants_master()
746 c->report_rp_size = ubifs_reported_space(c, c->rp_size); in init_constants_master()
757 tmp64 = c->main_lebs - 1 - 1 - MIN_INDEX_LEBS - c->jhead_cnt + 1; in init_constants_master()
758 tmp64 *= (long long)c->leb_size - c->leb_overhead; in init_constants_master()
759 tmp64 = ubifs_reported_space(c, tmp64); in init_constants_master()
760 c->block_cnt = tmp64 >> UBIFS_BLOCK_SHIFT; in init_constants_master()
774 static int take_gc_lnum(struct ubifs_info *c) in take_gc_lnum() argument
778 if (c->gc_lnum == -1) { in take_gc_lnum()
779 ubifs_err(c, "no LEB for GC"); in take_gc_lnum()
784 err = ubifs_change_one_lp(c, c->gc_lnum, c->leb_size, 0, in take_gc_lnum()
796 static int alloc_wbufs(struct ubifs_info *c) in alloc_wbufs() argument
800 c->jheads = kcalloc(c->jhead_cnt, sizeof(struct ubifs_jhead), in alloc_wbufs()
802 if (!c->jheads) in alloc_wbufs()
806 for (i = 0; i < c->jhead_cnt; i++) { in alloc_wbufs()
807 INIT_LIST_HEAD(&c->jheads[i].buds_list); in alloc_wbufs()
808 err = ubifs_wbuf_init(c, &c->jheads[i].wbuf); in alloc_wbufs()
812 c->jheads[i].wbuf.sync_callback = &bud_wbuf_callback; in alloc_wbufs()
813 c->jheads[i].wbuf.jhead = i; in alloc_wbufs()
814 c->jheads[i].grouped = 1; in alloc_wbufs()
821 c->jheads[GCHD].wbuf.no_timer = 1; in alloc_wbufs()
822 c->jheads[GCHD].grouped = 0; in alloc_wbufs()
831 static void free_wbufs(struct ubifs_info *c) in free_wbufs() argument
835 if (c->jheads) { in free_wbufs()
836 for (i = 0; i < c->jhead_cnt; i++) { in free_wbufs()
837 kfree(c->jheads[i].wbuf.buf); in free_wbufs()
838 kfree(c->jheads[i].wbuf.inodes); in free_wbufs()
840 kfree(c->jheads); in free_wbufs()
841 c->jheads = NULL; in free_wbufs()
849 static void free_orphans(struct ubifs_info *c) in free_orphans() argument
853 while (c->orph_dnext) { in free_orphans()
854 orph = c->orph_dnext; in free_orphans()
855 c->orph_dnext = orph->dnext; in free_orphans()
860 while (!list_empty(&c->orph_list)) { in free_orphans()
861 orph = list_entry(c->orph_list.next, struct ubifs_orphan, list); in free_orphans()
864 ubifs_err(c, "orphan list not empty at unmount"); in free_orphans()
867 vfree(c->orph_buf); in free_orphans()
868 c->orph_buf = NULL; in free_orphans()
875 static void free_buds(struct ubifs_info *c) in free_buds() argument
879 rbtree_postorder_for_each_entry_safe(bud, n, &c->buds, rb) in free_buds()
892 static int check_volume_empty(struct ubifs_info *c) in check_volume_empty() argument
896 c->empty = 1; in check_volume_empty()
897 for (lnum = 0; lnum < c->leb_cnt; lnum++) { in check_volume_empty()
898 err = ubifs_is_mapped(c, lnum); in check_volume_empty()
902 c->empty = 0; in check_volume_empty()
977 static int ubifs_parse_options(struct ubifs_info *c, char *options, in ubifs_parse_options() argument
1000 c->mount_opts.unmount_mode = 2; in ubifs_parse_options()
1003 c->mount_opts.unmount_mode = 1; in ubifs_parse_options()
1006 c->mount_opts.bulk_read = 2; in ubifs_parse_options()
1007 c->bulk_read = 1; in ubifs_parse_options()
1010 c->mount_opts.bulk_read = 1; in ubifs_parse_options()
1011 c->bulk_read = 0; in ubifs_parse_options()
1014 c->mount_opts.chk_data_crc = 2; in ubifs_parse_options()
1015 c->no_chk_data_crc = 0; in ubifs_parse_options()
1018 c->mount_opts.chk_data_crc = 1; in ubifs_parse_options()
1019 c->no_chk_data_crc = 1; in ubifs_parse_options()
1028 c->mount_opts.compr_type = UBIFS_COMPR_NONE; in ubifs_parse_options()
1030 c->mount_opts.compr_type = UBIFS_COMPR_LZO; in ubifs_parse_options()
1032 c->mount_opts.compr_type = UBIFS_COMPR_ZLIB; in ubifs_parse_options()
1034 ubifs_err(c, "unknown compressor \"%s\"", name); //FIXME: is c ready? in ubifs_parse_options()
1039 c->mount_opts.override_compr = 1; in ubifs_parse_options()
1040 c->default_compr = c->mount_opts.compr_type; in ubifs_parse_options()
1046 struct super_block *sb = c->vfs_sb; in ubifs_parse_options()
1050 ubifs_err(c, "unrecognized mount option \"%s\" or missing value", in ubifs_parse_options()
1070 static void destroy_journal(struct ubifs_info *c) in destroy_journal() argument
1072 while (!list_empty(&c->unclean_leb_list)) { in destroy_journal()
1075 ucleb = list_entry(c->unclean_leb_list.next, in destroy_journal()
1080 while (!list_empty(&c->old_buds)) { in destroy_journal()
1083 bud = list_entry(c->old_buds.next, struct ubifs_bud, list); in destroy_journal()
1087 ubifs_destroy_idx_gc(c); in destroy_journal()
1088 ubifs_destroy_size_tree(c); in destroy_journal()
1089 ubifs_tnc_close(c); in destroy_journal()
1090 free_buds(c); in destroy_journal()
1097 static void bu_init(struct ubifs_info *c) in bu_init() argument
1099 ubifs_assert(c->bulk_read == 1); in bu_init()
1101 if (c->bu.buf) in bu_init()
1105 c->bu.buf = kmalloc(c->max_bu_buf_len, GFP_KERNEL | __GFP_NOWARN); in bu_init()
1106 if (!c->bu.buf) { in bu_init()
1107 if (c->max_bu_buf_len > UBIFS_KMALLOC_OK) { in bu_init()
1108 c->max_bu_buf_len = UBIFS_KMALLOC_OK; in bu_init()
1113 ubifs_warn(c, "cannot allocate %d bytes of memory for bulk-read, disabling it", in bu_init()
1114 c->max_bu_buf_len); in bu_init()
1115 c->mount_opts.bulk_read = 1; in bu_init()
1116 c->bulk_read = 0; in bu_init()
1128 static int check_free_space(struct ubifs_info *c) in check_free_space() argument
1130 ubifs_assert(c->dark_wm > 0); in check_free_space()
1131 if (c->lst.total_free + c->lst.total_dirty < c->dark_wm) { in check_free_space()
1132 ubifs_err(c, "insufficient free space to mount in R/W mode"); in check_free_space()
1133 ubifs_dump_budg(c, &c->bi); in check_free_space()
1134 ubifs_dump_lprops(c); in check_free_space()
1147 static int mount_ubifs(struct ubifs_info *c) in mount_ubifs() argument
1153 c->ro_mount = !!(c->vfs_sb->s_flags & MS_RDONLY); in mount_ubifs()
1155 c->probing = !!(c->vfs_sb->s_flags & MS_SILENT); in mount_ubifs()
1157 err = init_constants_early(c); in mount_ubifs()
1161 err = ubifs_debugging_init(c); in mount_ubifs()
1165 err = check_volume_empty(c); in mount_ubifs()
1169 if (c->empty && (c->ro_mount || c->ro_media)) { in mount_ubifs()
1174 ubifs_err(c, "can't format empty UBI volume: read-only %s", in mount_ubifs()
1175 c->ro_media ? "UBI volume" : "mount"); in mount_ubifs()
1180 if (c->ro_media && !c->ro_mount) { in mount_ubifs()
1181 ubifs_err(c, "cannot mount read-write - read-only media"); in mount_ubifs()
1192 c->bottom_up_buf = kmalloc(BOTTOM_UP_HEIGHT * sizeof(int), GFP_KERNEL); in mount_ubifs()
1193 if (!c->bottom_up_buf) in mount_ubifs()
1196 c->sbuf = vmalloc(c->leb_size); in mount_ubifs()
1197 if (!c->sbuf) in mount_ubifs()
1200 if (!c->ro_mount) { in mount_ubifs()
1201 c->ileb_buf = vmalloc(c->leb_size); in mount_ubifs()
1202 if (!c->ileb_buf) in mount_ubifs()
1206 if (c->bulk_read == 1) in mount_ubifs()
1207 bu_init(c); in mount_ubifs()
1209 if (!c->ro_mount) { in mount_ubifs()
1210 c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ, in mount_ubifs()
1212 if (!c->write_reserve_buf) in mount_ubifs()
1216 c->mounting = 1; in mount_ubifs()
1218 err = ubifs_read_superblock(c); in mount_ubifs()
1222 c->probing = 0; in mount_ubifs()
1228 if (!ubifs_compr_present(c->default_compr)) { in mount_ubifs()
1229 ubifs_err(c, "'compressor \"%s\" is not compiled in", in mount_ubifs()
1230 ubifs_compr_name(c->default_compr)); in mount_ubifs()
1235 err = init_constants_sb(c); in mount_ubifs()
1239 sz = ALIGN(c->max_idx_node_sz, c->min_io_size); in mount_ubifs()
1240 sz = ALIGN(sz + c->max_idx_node_sz, c->min_io_size); in mount_ubifs()
1241 c->cbuf = kmalloc(sz, GFP_NOFS); in mount_ubifs()
1242 if (!c->cbuf) { in mount_ubifs()
1247 err = alloc_wbufs(c); in mount_ubifs()
1251 sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id); in mount_ubifs()
1252 if (!c->ro_mount) { in mount_ubifs()
1254 c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name); in mount_ubifs()
1255 if (IS_ERR(c->bgt)) { in mount_ubifs()
1256 err = PTR_ERR(c->bgt); in mount_ubifs()
1257 c->bgt = NULL; in mount_ubifs()
1258 ubifs_err(c, "cannot spawn \"%s\", error %d", in mount_ubifs()
1259 c->bgt_name, err); in mount_ubifs()
1262 wake_up_process(c->bgt); in mount_ubifs()
1265 err = ubifs_read_master(c); in mount_ubifs()
1269 init_constants_master(c); in mount_ubifs()
1271 if ((c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY)) != 0) { in mount_ubifs()
1272 ubifs_msg(c, "recovery needed"); in mount_ubifs()
1273 c->need_recovery = 1; in mount_ubifs()
1276 if (c->need_recovery && !c->ro_mount) { in mount_ubifs()
1277 err = ubifs_recover_inl_heads(c, c->sbuf); in mount_ubifs()
1282 err = ubifs_lpt_init(c, 1, !c->ro_mount); in mount_ubifs()
1286 if (!c->ro_mount && c->space_fixup) { in mount_ubifs()
1287 err = ubifs_fixup_free_space(c); in mount_ubifs()
1292 if (!c->ro_mount && !c->need_recovery) { in mount_ubifs()
1297 c->mst_node->flags |= cpu_to_le32(UBIFS_MST_DIRTY); in mount_ubifs()
1298 err = ubifs_write_master(c); in mount_ubifs()
1303 err = dbg_check_idx_size(c, c->bi.old_idx_sz); in mount_ubifs()
1307 err = ubifs_replay_journal(c); in mount_ubifs()
1312 c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); in mount_ubifs()
1314 err = ubifs_mount_orphans(c, c->need_recovery, c->ro_mount); in mount_ubifs()
1318 if (!c->ro_mount) { in mount_ubifs()
1321 err = check_free_space(c); in mount_ubifs()
1326 lnum = c->lhead_lnum + 1; in mount_ubifs()
1327 if (lnum >= UBIFS_LOG_LNUM + c->log_lebs) in mount_ubifs()
1329 if (lnum == c->ltail_lnum) { in mount_ubifs()
1330 err = ubifs_consolidate_log(c); in mount_ubifs()
1335 if (c->need_recovery) { in mount_ubifs()
1336 err = ubifs_recover_size(c); in mount_ubifs()
1339 err = ubifs_rcvry_gc_commit(c); in mount_ubifs()
1343 err = take_gc_lnum(c); in mount_ubifs()
1351 err = ubifs_leb_unmap(c, c->gc_lnum); in mount_ubifs()
1356 err = dbg_check_lprops(c); in mount_ubifs()
1359 } else if (c->need_recovery) { in mount_ubifs()
1360 err = ubifs_recover_size(c); in mount_ubifs()
1370 err = take_gc_lnum(c); in mount_ubifs()
1376 list_add_tail(&c->infos_list, &ubifs_infos); in mount_ubifs()
1379 if (c->need_recovery) { in mount_ubifs()
1380 if (c->ro_mount) in mount_ubifs()
1381 ubifs_msg(c, "recovery deferred"); in mount_ubifs()
1383 c->need_recovery = 0; in mount_ubifs()
1384 ubifs_msg(c, "recovery completed"); in mount_ubifs()
1390 ubifs_assert(c->lst.taken_empty_lebs > 0); in mount_ubifs()
1393 ubifs_assert(c->lst.taken_empty_lebs > 0); in mount_ubifs()
1395 err = dbg_check_filesystem(c); in mount_ubifs()
1399 err = dbg_debugfs_init_fs(c); in mount_ubifs()
1403 c->mounting = 0; in mount_ubifs()
1405 ubifs_msg(c, "UBIFS: mounted UBI device %d, volume %d, name \"%s\"%s", in mount_ubifs()
1406 c->vi.ubi_num, c->vi.vol_id, c->vi.name, in mount_ubifs()
1407 c->ro_mount ? ", R/O mode" : ""); in mount_ubifs()
1408 x = (long long)c->main_lebs * c->leb_size; in mount_ubifs()
1409 y = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes; in mount_ubifs()
1410 ubifs_msg(c, "LEB size: %d bytes (%d KiB), min./max. I/O unit sizes: %d bytes/%d bytes", in mount_ubifs()
1411 c->leb_size, c->leb_size >> 10, c->min_io_size, in mount_ubifs()
1412 c->max_write_size); in mount_ubifs()
1413 …ubifs_msg(c, "FS size: %lld bytes (%lld MiB, %d LEBs), journal size %lld bytes (%lld MiB, %d LEBs)… in mount_ubifs()
1414 x, x >> 20, c->main_lebs, in mount_ubifs()
1415 y, y >> 20, c->log_lebs + c->max_bud_cnt); in mount_ubifs()
1416 ubifs_msg(c, "reserved for root: %llu bytes (%llu KiB)", in mount_ubifs()
1417 c->report_rp_size, c->report_rp_size >> 10); in mount_ubifs()
1418 ubifs_msg(c, "media format: w%d/r%d (latest is w%d/r%d), UUID %pUB%s", in mount_ubifs()
1419 c->fmt_version, c->ro_compat_version, in mount_ubifs()
1420 UBIFS_FORMAT_VERSION, UBIFS_RO_COMPAT_VERSION, c->uuid, in mount_ubifs()
1421 c->big_lpt ? ", big LPT model" : ", small LPT model"); in mount_ubifs()
1423 dbg_gen("default compressor: %s", ubifs_compr_name(c->default_compr)); in mount_ubifs()
1425 c->jhead_cnt - NONDATA_JHEADS_CNT); in mount_ubifs()
1427 c->log_lebs, UBIFS_LOG_LNUM, c->log_last); in mount_ubifs()
1429 c->lpt_lebs, c->lpt_first, c->lpt_last); in mount_ubifs()
1431 c->orph_lebs, c->orph_first, c->orph_last); in mount_ubifs()
1433 c->main_lebs, c->main_first, c->leb_cnt - 1); in mount_ubifs()
1434 dbg_gen("index LEBs: %d", c->lst.idx_lebs); in mount_ubifs()
1436 c->bi.old_idx_sz, c->bi.old_idx_sz >> 10, in mount_ubifs()
1437 c->bi.old_idx_sz >> 20); in mount_ubifs()
1438 dbg_gen("key hash type: %d", c->key_hash_type); in mount_ubifs()
1439 dbg_gen("tree fanout: %d", c->fanout); in mount_ubifs()
1440 dbg_gen("reserved GC LEB: %d", c->gc_lnum); in mount_ubifs()
1441 dbg_gen("max. znode size %d", c->max_znode_sz); in mount_ubifs()
1442 dbg_gen("max. index node size %d", c->max_idx_node_sz); in mount_ubifs()
1451 UBIFS_MAX_DENT_NODE_SZ, ubifs_idx_node_sz(c, c->fanout)); in mount_ubifs()
1452 dbg_gen("dead watermark: %d", c->dead_wm); in mount_ubifs()
1453 dbg_gen("dark watermark: %d", c->dark_wm); in mount_ubifs()
1454 dbg_gen("LEB overhead: %d", c->leb_overhead); in mount_ubifs()
1455 x = (long long)c->main_lebs * c->dark_wm; in mount_ubifs()
1459 c->max_bud_bytes, c->max_bud_bytes >> 10, in mount_ubifs()
1460 c->max_bud_bytes >> 20); in mount_ubifs()
1462 c->bg_bud_bytes, c->bg_bud_bytes >> 10, in mount_ubifs()
1463 c->bg_bud_bytes >> 20); in mount_ubifs()
1465 c->bud_bytes, c->bud_bytes >> 10, c->bud_bytes >> 20); in mount_ubifs()
1466 dbg_gen("max. seq. number: %llu", c->max_sqnum); in mount_ubifs()
1467 dbg_gen("commit number: %llu", c->cmt_no); in mount_ubifs()
1473 list_del(&c->infos_list); in mount_ubifs()
1476 free_orphans(c); in mount_ubifs()
1478 destroy_journal(c); in mount_ubifs()
1480 ubifs_lpt_free(c, 0); in mount_ubifs()
1482 kfree(c->mst_node); in mount_ubifs()
1483 kfree(c->rcvrd_mst_node); in mount_ubifs()
1484 if (c->bgt) in mount_ubifs()
1485 kthread_stop(c->bgt); in mount_ubifs()
1487 free_wbufs(c); in mount_ubifs()
1489 kfree(c->cbuf); in mount_ubifs()
1491 kfree(c->write_reserve_buf); in mount_ubifs()
1492 kfree(c->bu.buf); in mount_ubifs()
1493 vfree(c->ileb_buf); in mount_ubifs()
1494 vfree(c->sbuf); in mount_ubifs()
1495 kfree(c->bottom_up_buf); in mount_ubifs()
1496 ubifs_debugging_exit(c); in mount_ubifs()
1509 static void ubifs_umount(struct ubifs_info *c) in ubifs_umount() argument
1511 dbg_gen("un-mounting UBI device %d, volume %d", c->vi.ubi_num, in ubifs_umount()
1512 c->vi.vol_id); in ubifs_umount()
1514 dbg_debugfs_exit_fs(c); in ubifs_umount()
1516 list_del(&c->infos_list); in ubifs_umount()
1519 if (c->bgt) in ubifs_umount()
1520 kthread_stop(c->bgt); in ubifs_umount()
1522 destroy_journal(c); in ubifs_umount()
1523 free_wbufs(c); in ubifs_umount()
1524 free_orphans(c); in ubifs_umount()
1525 ubifs_lpt_free(c, 0); in ubifs_umount()
1527 kfree(c->cbuf); in ubifs_umount()
1528 kfree(c->rcvrd_mst_node); in ubifs_umount()
1529 kfree(c->mst_node); in ubifs_umount()
1530 kfree(c->write_reserve_buf); in ubifs_umount()
1531 kfree(c->bu.buf); in ubifs_umount()
1532 vfree(c->ileb_buf); in ubifs_umount()
1533 vfree(c->sbuf); in ubifs_umount()
1534 kfree(c->bottom_up_buf); in ubifs_umount()
1535 ubifs_debugging_exit(c); in ubifs_umount()
1546 static int ubifs_remount_rw(struct ubifs_info *c) in ubifs_remount_rw() argument
1550 if (c->rw_incompat) { in ubifs_remount_rw()
1551 ubifs_err(c, "the file-system is not R/W-compatible"); in ubifs_remount_rw()
1552 …ubifs_msg(c, "on-flash format version is w%d/r%d, but software only supports up to version w%d/r%d… in ubifs_remount_rw()
1553 c->fmt_version, c->ro_compat_version, in ubifs_remount_rw()
1558 mutex_lock(&c->umount_mutex); in ubifs_remount_rw()
1559 dbg_save_space_info(c); in ubifs_remount_rw()
1560 c->remounting_rw = 1; in ubifs_remount_rw()
1561 c->ro_mount = 0; in ubifs_remount_rw()
1563 if (c->space_fixup) { in ubifs_remount_rw()
1564 err = ubifs_fixup_free_space(c); in ubifs_remount_rw()
1569 err = check_free_space(c); in ubifs_remount_rw()
1573 if (c->old_leb_cnt != c->leb_cnt) { in ubifs_remount_rw()
1576 sup = ubifs_read_sb_node(c); in ubifs_remount_rw()
1581 sup->leb_cnt = cpu_to_le32(c->leb_cnt); in ubifs_remount_rw()
1582 err = ubifs_write_sb_node(c, sup); in ubifs_remount_rw()
1588 if (c->need_recovery) { in ubifs_remount_rw()
1589 ubifs_msg(c, "completing deferred recovery"); in ubifs_remount_rw()
1590 err = ubifs_write_rcvrd_mst_node(c); in ubifs_remount_rw()
1593 err = ubifs_recover_size(c); in ubifs_remount_rw()
1596 err = ubifs_clean_lebs(c, c->sbuf); in ubifs_remount_rw()
1599 err = ubifs_recover_inl_heads(c, c->sbuf); in ubifs_remount_rw()
1604 ubifs_assert(c->tot_orphans == 0); in ubifs_remount_rw()
1605 err = ubifs_clear_orphans(c); in ubifs_remount_rw()
1610 if (!(c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY))) { in ubifs_remount_rw()
1611 c->mst_node->flags |= cpu_to_le32(UBIFS_MST_DIRTY); in ubifs_remount_rw()
1612 err = ubifs_write_master(c); in ubifs_remount_rw()
1617 c->ileb_buf = vmalloc(c->leb_size); in ubifs_remount_rw()
1618 if (!c->ileb_buf) { in ubifs_remount_rw()
1623 c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ, GFP_KERNEL); in ubifs_remount_rw()
1624 if (!c->write_reserve_buf) { in ubifs_remount_rw()
1629 err = ubifs_lpt_init(c, 0, 1); in ubifs_remount_rw()
1634 c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name); in ubifs_remount_rw()
1635 if (IS_ERR(c->bgt)) { in ubifs_remount_rw()
1636 err = PTR_ERR(c->bgt); in ubifs_remount_rw()
1637 c->bgt = NULL; in ubifs_remount_rw()
1638 ubifs_err(c, "cannot spawn \"%s\", error %d", in ubifs_remount_rw()
1639 c->bgt_name, err); in ubifs_remount_rw()
1642 wake_up_process(c->bgt); in ubifs_remount_rw()
1644 c->orph_buf = vmalloc(c->leb_size); in ubifs_remount_rw()
1645 if (!c->orph_buf) { in ubifs_remount_rw()
1651 lnum = c->lhead_lnum + 1; in ubifs_remount_rw()
1652 if (lnum >= UBIFS_LOG_LNUM + c->log_lebs) in ubifs_remount_rw()
1654 if (lnum == c->ltail_lnum) { in ubifs_remount_rw()
1655 err = ubifs_consolidate_log(c); in ubifs_remount_rw()
1660 if (c->need_recovery) in ubifs_remount_rw()
1661 err = ubifs_rcvry_gc_commit(c); in ubifs_remount_rw()
1663 err = ubifs_leb_unmap(c, c->gc_lnum); in ubifs_remount_rw()
1668 c->remounting_rw = 0; in ubifs_remount_rw()
1670 if (c->need_recovery) { in ubifs_remount_rw()
1671 c->need_recovery = 0; in ubifs_remount_rw()
1672 ubifs_msg(c, "deferred recovery completed"); in ubifs_remount_rw()
1684 err = dbg_check_space_info(c); in ubifs_remount_rw()
1687 mutex_unlock(&c->umount_mutex); in ubifs_remount_rw()
1691 c->ro_mount = 1; in ubifs_remount_rw()
1692 vfree(c->orph_buf); in ubifs_remount_rw()
1693 c->orph_buf = NULL; in ubifs_remount_rw()
1694 if (c->bgt) { in ubifs_remount_rw()
1695 kthread_stop(c->bgt); in ubifs_remount_rw()
1696 c->bgt = NULL; in ubifs_remount_rw()
1698 free_wbufs(c); in ubifs_remount_rw()
1699 kfree(c->write_reserve_buf); in ubifs_remount_rw()
1700 c->write_reserve_buf = NULL; in ubifs_remount_rw()
1701 vfree(c->ileb_buf); in ubifs_remount_rw()
1702 c->ileb_buf = NULL; in ubifs_remount_rw()
1703 ubifs_lpt_free(c, 1); in ubifs_remount_rw()
1704 c->remounting_rw = 0; in ubifs_remount_rw()
1705 mutex_unlock(&c->umount_mutex); in ubifs_remount_rw()
1716 static void ubifs_remount_ro(struct ubifs_info *c) in ubifs_remount_ro() argument
1720 ubifs_assert(!c->need_recovery); in ubifs_remount_ro()
1721 ubifs_assert(!c->ro_mount); in ubifs_remount_ro()
1723 mutex_lock(&c->umount_mutex); in ubifs_remount_ro()
1724 if (c->bgt) { in ubifs_remount_ro()
1725 kthread_stop(c->bgt); in ubifs_remount_ro()
1726 c->bgt = NULL; in ubifs_remount_ro()
1729 dbg_save_space_info(c); in ubifs_remount_ro()
1731 for (i = 0; i < c->jhead_cnt; i++) in ubifs_remount_ro()
1732 ubifs_wbuf_sync(&c->jheads[i].wbuf); in ubifs_remount_ro()
1734 c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_DIRTY); in ubifs_remount_ro()
1735 c->mst_node->flags |= cpu_to_le32(UBIFS_MST_NO_ORPHS); in ubifs_remount_ro()
1736 c->mst_node->gc_lnum = cpu_to_le32(c->gc_lnum); in ubifs_remount_ro()
1737 err = ubifs_write_master(c); in ubifs_remount_ro()
1739 ubifs_ro_mode(c, err); in ubifs_remount_ro()
1741 vfree(c->orph_buf); in ubifs_remount_ro()
1742 c->orph_buf = NULL; in ubifs_remount_ro()
1743 kfree(c->write_reserve_buf); in ubifs_remount_ro()
1744 c->write_reserve_buf = NULL; in ubifs_remount_ro()
1745 vfree(c->ileb_buf); in ubifs_remount_ro()
1746 c->ileb_buf = NULL; in ubifs_remount_ro()
1747 ubifs_lpt_free(c, 1); in ubifs_remount_ro()
1748 c->ro_mount = 1; in ubifs_remount_ro()
1749 err = dbg_check_space_info(c); in ubifs_remount_ro()
1751 ubifs_ro_mode(c, err); in ubifs_remount_ro()
1752 mutex_unlock(&c->umount_mutex); in ubifs_remount_ro()
1758 struct ubifs_info *c = sb->s_fs_info; in ubifs_put_super() local
1760 ubifs_msg(c, "un-mount UBI device %d", c->vi.ubi_num); in ubifs_put_super()
1767 if (!c->ro_error) { in ubifs_put_super()
1768 ubifs_assert(c->bi.idx_growth == 0); in ubifs_put_super()
1769 ubifs_assert(c->bi.dd_growth == 0); in ubifs_put_super()
1770 ubifs_assert(c->bi.data_growth == 0); in ubifs_put_super()
1779 mutex_lock(&c->umount_mutex); in ubifs_put_super()
1780 if (!c->ro_mount) { in ubifs_put_super()
1785 if (c->bgt) { in ubifs_put_super()
1786 kthread_stop(c->bgt); in ubifs_put_super()
1787 c->bgt = NULL; in ubifs_put_super()
1794 if (!c->ro_error) { in ubifs_put_super()
1798 for (i = 0; i < c->jhead_cnt; i++) in ubifs_put_super()
1799 ubifs_wbuf_sync(&c->jheads[i].wbuf); in ubifs_put_super()
1806 c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_DIRTY); in ubifs_put_super()
1807 c->mst_node->flags |= cpu_to_le32(UBIFS_MST_NO_ORPHS); in ubifs_put_super()
1808 c->mst_node->gc_lnum = cpu_to_le32(c->gc_lnum); in ubifs_put_super()
1809 err = ubifs_write_master(c); in ubifs_put_super()
1816 ubifs_err(c, "failed to write master node, error %d", in ubifs_put_super()
1819 for (i = 0; i < c->jhead_cnt; i++) in ubifs_put_super()
1821 hrtimer_cancel(&c->jheads[i].wbuf.timer); in ubifs_put_super()
1825 ubifs_umount(c); in ubifs_put_super()
1826 bdi_destroy(&c->bdi); in ubifs_put_super()
1827 ubi_close_volume(c->ubi); in ubifs_put_super()
1828 mutex_unlock(&c->umount_mutex); in ubifs_put_super()
1834 struct ubifs_info *c = sb->s_fs_info; in ubifs_remount_fs() local
1839 err = ubifs_parse_options(c, data, 1); in ubifs_remount_fs()
1841 ubifs_err(c, "invalid or unknown remount parameter"); in ubifs_remount_fs()
1845 if (c->ro_mount && !(*flags & MS_RDONLY)) { in ubifs_remount_fs()
1846 if (c->ro_error) { in ubifs_remount_fs()
1847 ubifs_msg(c, "cannot re-mount R/W due to prior errors"); in ubifs_remount_fs()
1850 if (c->ro_media) { in ubifs_remount_fs()
1851 ubifs_msg(c, "cannot re-mount R/W - UBI volume is R/O"); in ubifs_remount_fs()
1854 err = ubifs_remount_rw(c); in ubifs_remount_fs()
1857 } else if (!c->ro_mount && (*flags & MS_RDONLY)) { in ubifs_remount_fs()
1858 if (c->ro_error) { in ubifs_remount_fs()
1859 ubifs_msg(c, "cannot re-mount R/O due to prior errors"); in ubifs_remount_fs()
1862 ubifs_remount_ro(c); in ubifs_remount_fs()
1865 if (c->bulk_read == 1) in ubifs_remount_fs()
1866 bu_init(c); in ubifs_remount_fs()
1869 kfree(c->bu.buf); in ubifs_remount_fs()
1870 c->bu.buf = NULL; in ubifs_remount_fs()
1873 ubifs_assert(c->lst.taken_empty_lebs > 0); in ubifs_remount_fs()
1954 struct ubifs_info *c; in alloc_ubifs_info() local
1956 c = kzalloc(sizeof(struct ubifs_info), GFP_KERNEL); in alloc_ubifs_info()
1957 if (c) { in alloc_ubifs_info()
1958 spin_lock_init(&c->cnt_lock); in alloc_ubifs_info()
1959 spin_lock_init(&c->cs_lock); in alloc_ubifs_info()
1960 spin_lock_init(&c->buds_lock); in alloc_ubifs_info()
1961 spin_lock_init(&c->space_lock); in alloc_ubifs_info()
1962 spin_lock_init(&c->orphan_lock); in alloc_ubifs_info()
1963 init_rwsem(&c->commit_sem); in alloc_ubifs_info()
1964 mutex_init(&c->lp_mutex); in alloc_ubifs_info()
1965 mutex_init(&c->tnc_mutex); in alloc_ubifs_info()
1966 mutex_init(&c->log_mutex); in alloc_ubifs_info()
1967 mutex_init(&c->umount_mutex); in alloc_ubifs_info()
1968 mutex_init(&c->bu_mutex); in alloc_ubifs_info()
1969 mutex_init(&c->write_reserve_mutex); in alloc_ubifs_info()
1970 init_waitqueue_head(&c->cmt_wq); in alloc_ubifs_info()
1971 c->buds = RB_ROOT; in alloc_ubifs_info()
1972 c->old_idx = RB_ROOT; in alloc_ubifs_info()
1973 c->size_tree = RB_ROOT; in alloc_ubifs_info()
1974 c->orph_tree = RB_ROOT; in alloc_ubifs_info()
1975 INIT_LIST_HEAD(&c->infos_list); in alloc_ubifs_info()
1976 INIT_LIST_HEAD(&c->idx_gc); in alloc_ubifs_info()
1977 INIT_LIST_HEAD(&c->replay_list); in alloc_ubifs_info()
1978 INIT_LIST_HEAD(&c->replay_buds); in alloc_ubifs_info()
1979 INIT_LIST_HEAD(&c->uncat_list); in alloc_ubifs_info()
1980 INIT_LIST_HEAD(&c->empty_list); in alloc_ubifs_info()
1981 INIT_LIST_HEAD(&c->freeable_list); in alloc_ubifs_info()
1982 INIT_LIST_HEAD(&c->frdi_idx_list); in alloc_ubifs_info()
1983 INIT_LIST_HEAD(&c->unclean_leb_list); in alloc_ubifs_info()
1984 INIT_LIST_HEAD(&c->old_buds); in alloc_ubifs_info()
1985 INIT_LIST_HEAD(&c->orph_list); in alloc_ubifs_info()
1986 INIT_LIST_HEAD(&c->orph_new); in alloc_ubifs_info()
1987 c->no_chk_data_crc = 1; in alloc_ubifs_info()
1989 c->highest_inum = UBIFS_FIRST_INO; in alloc_ubifs_info()
1990 c->lhead_lnum = c->ltail_lnum = UBIFS_LOG_LNUM; in alloc_ubifs_info()
1992 ubi_get_volume_info(ubi, &c->vi); in alloc_ubifs_info()
1993 ubi_get_device_info(c->vi.ubi_num, &c->di); in alloc_ubifs_info()
1995 return c; in alloc_ubifs_info()
2000 struct ubifs_info *c = sb->s_fs_info; in ubifs_fill_super() local
2004 c->vfs_sb = sb; in ubifs_fill_super()
2006 c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READWRITE); in ubifs_fill_super()
2007 if (IS_ERR(c->ubi)) { in ubifs_fill_super()
2008 err = PTR_ERR(c->ubi); in ubifs_fill_super()
2020 c->bdi.name = "ubifs", in ubifs_fill_super()
2021 c->bdi.capabilities = 0; in ubifs_fill_super()
2022 err = bdi_init(&c->bdi); in ubifs_fill_super()
2025 err = bdi_register(&c->bdi, NULL, "ubifs_%d_%d", in ubifs_fill_super()
2026 c->vi.ubi_num, c->vi.vol_id); in ubifs_fill_super()
2030 err = ubifs_parse_options(c, data, 0); in ubifs_fill_super()
2034 sb->s_bdi = &c->bdi; in ubifs_fill_super()
2035 sb->s_fs_info = c; in ubifs_fill_super()
2039 sb->s_maxbytes = c->max_inode_sz = key_max_inode_size(c); in ubifs_fill_super()
2040 if (c->max_inode_sz > MAX_LFS_FILESIZE) in ubifs_fill_super()
2041 sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE; in ubifs_fill_super()
2044 mutex_lock(&c->umount_mutex); in ubifs_fill_super()
2045 err = mount_ubifs(c); in ubifs_fill_super()
2064 mutex_unlock(&c->umount_mutex); in ubifs_fill_super()
2068 ubifs_umount(c); in ubifs_fill_super()
2070 mutex_unlock(&c->umount_mutex); in ubifs_fill_super()
2072 bdi_destroy(&c->bdi); in ubifs_fill_super()
2074 ubi_close_volume(c->ubi); in ubifs_fill_super()
2082 struct ubifs_info *c = sb->s_fs_info; in sb_test() local
2084 return c->vi.cdev == c1->vi.cdev; in sb_test()
2097 struct ubifs_info *c; in ubifs_mount() local
2115 c = alloc_ubifs_info(ubi); in ubifs_mount()
2116 if (!c) { in ubifs_mount()
2121 dbg_gen("opened ubi%d_%d", c->vi.ubi_num, c->vi.vol_id); in ubifs_mount()
2123 sb = sget(fs_type, sb_test, sb_set, flags, c); in ubifs_mount()
2126 kfree(c); in ubifs_mount()
2132 kfree(c); in ubifs_mount()
2148 ubifs_msg(c, "full atime support is enabled."); in ubifs_mount()
2166 struct ubifs_info *c = s->s_fs_info; in kill_ubifs_super() local
2168 kfree(c); in kill_ubifs_super()