Home
last modified time | relevance | path

Searched refs:ubi (Results 1 – 18 of 18) sorted by relevance

/drivers/mtd/ubi/
Dbuild.c153 int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol, int ntype) in ubi_volume_notify() argument
157 ubi_do_get_device_info(ubi, &nt.di); in ubi_volume_notify()
158 ubi_do_get_volume_info(ubi, vol, &nt.vi); in ubi_volume_notify()
166 if (ubi_update_fastmap(ubi)) { in ubi_volume_notify()
168 ubi_ro_mode(ubi); in ubi_volume_notify()
186 int ubi_notify_all(struct ubi_device *ubi, int ntype, struct notifier_block *nb) in ubi_notify_all() argument
191 ubi_do_get_device_info(ubi, &nt.di); in ubi_notify_all()
193 mutex_lock(&ubi->device_mutex); in ubi_notify_all()
194 for (i = 0; i < ubi->vtbl_slots; i++) { in ubi_notify_all()
200 if (!ubi->volumes[i]) in ubi_notify_all()
[all …]
Dwl.c137 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec);
138 static int self_check_in_wl_tree(const struct ubi_device *ubi,
140 static int self_check_in_pq(const struct ubi_device *ubi,
150 struct ubi_device *ubi = container_of(wrk, struct ubi_device, fm_work); in update_fastmap_work_fn() local
151 ubi_update_fastmap(ubi); in update_fastmap_work_fn()
159 static int ubi_is_fm_block(struct ubi_device *ubi, int pnum) in ubi_is_fm_block() argument
163 if (!ubi->fm) in ubi_is_fm_block()
166 for (i = 0; i < ubi->fm->used_blocks; i++) in ubi_is_fm_block()
167 if (ubi->fm->e[i]->pnum == pnum) in ubi_is_fm_block()
173 static int ubi_is_fm_block(struct ubi_device *ubi, int pnum) in ubi_is_fm_block() argument
[all …]
Deba.c60 unsigned long long ubi_next_sqnum(struct ubi_device *ubi) in ubi_next_sqnum() argument
64 spin_lock(&ubi->ltree_lock); in ubi_next_sqnum()
65 sqnum = ubi->global_sqnum++; in ubi_next_sqnum()
66 spin_unlock(&ubi->ltree_lock); in ubi_next_sqnum()
79 static int ubi_get_compat(const struct ubi_device *ubi, int vol_id) in ubi_get_compat() argument
96 static struct ubi_ltree_entry *ltree_lookup(struct ubi_device *ubi, int vol_id, in ltree_lookup() argument
101 p = ubi->ltree.rb_node; in ltree_lookup()
135 static struct ubi_ltree_entry *ltree_add_entry(struct ubi_device *ubi, in ltree_add_entry() argument
149 spin_lock(&ubi->ltree_lock); in ltree_add_entry()
150 le1 = ltree_lookup(ubi, vol_id, lnum); in ltree_add_entry()
[all …]
Dvtbl.c64 static void self_vtbl_check(const struct ubi_device *ubi);
80 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx, in ubi_change_vtbl_record() argument
87 ubi_assert(idx >= 0 && idx < ubi->vtbl_slots); in ubi_change_vtbl_record()
88 layout_vol = ubi->volumes[vol_id2idx(ubi, UBI_LAYOUT_VOLUME_ID)]; in ubi_change_vtbl_record()
97 memcpy(&ubi->vtbl[idx], vtbl_rec, sizeof(struct ubi_vtbl_record)); in ubi_change_vtbl_record()
99 err = ubi_eba_unmap_leb(ubi, layout_vol, i); in ubi_change_vtbl_record()
103 err = ubi_eba_write_leb(ubi, layout_vol, i, ubi->vtbl, 0, in ubi_change_vtbl_record()
104 ubi->vtbl_size); in ubi_change_vtbl_record()
109 self_vtbl_check(ubi); in ubi_change_vtbl_record()
122 int ubi_vtbl_rename_volumes(struct ubi_device *ubi, in ubi_vtbl_rename_volumes() argument
[all …]
Dio.c94 static int self_check_not_bad(const struct ubi_device *ubi, int pnum);
95 static int self_check_peb_ec_hdr(const struct ubi_device *ubi, int pnum);
96 static int self_check_ec_hdr(const struct ubi_device *ubi, int pnum,
98 static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum);
99 static int self_check_vid_hdr(const struct ubi_device *ubi, int pnum,
101 static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum,
126 int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset, in ubi_io_read() argument
135 ubi_assert(pnum >= 0 && pnum < ubi->peb_count); in ubi_io_read()
136 ubi_assert(offset >= 0 && offset + len <= ubi->peb_size); in ubi_io_read()
139 err = self_check_not_bad(ubi, pnum); in ubi_io_read()
[all …]
Dvmt.c32 static int self_check_volumes(struct ubi_device *ubi);
72 struct ubi_device *ubi; in vol_attribute_show() local
74 ubi = ubi_get_device(vol->ubi->ubi_num); in vol_attribute_show()
75 if (!ubi) in vol_attribute_show()
78 spin_lock(&ubi->volumes_lock); in vol_attribute_show()
79 if (!ubi->volumes[vol->vol_id]) { in vol_attribute_show()
80 spin_unlock(&ubi->volumes_lock); in vol_attribute_show()
81 ubi_put_device(ubi); in vol_attribute_show()
86 spin_unlock(&ubi->volumes_lock); in vol_attribute_show()
115 spin_lock(&ubi->volumes_lock); in vol_attribute_show()
[all …]
Dubi.h306 struct ubi_device *ubi; member
724 int (*func)(struct ubi_device *ubi, struct ubi_work *wrk, int cancel);
744 int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum,
749 struct ubi_ainf_peb *ubi_early_get_peb(struct ubi_device *ubi,
751 int ubi_attach(struct ubi_device *ubi, int force_scan);
755 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx,
757 int ubi_vtbl_rename_volumes(struct ubi_device *ubi,
759 int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai);
762 int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req);
765 int ubi_rename_volumes(struct ubi_device *ubi, struct list_head *rename_list);
[all …]
Dkapi.c39 void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di) in ubi_do_get_device_info() argument
41 di->ubi_num = ubi->ubi_num; in ubi_do_get_device_info()
42 di->leb_size = ubi->leb_size; in ubi_do_get_device_info()
43 di->leb_start = ubi->leb_start; in ubi_do_get_device_info()
44 di->min_io_size = ubi->min_io_size; in ubi_do_get_device_info()
45 di->max_write_size = ubi->max_write_size; in ubi_do_get_device_info()
46 di->ro_mode = ubi->ro_mode; in ubi_do_get_device_info()
47 di->cdev = ubi->cdev.dev; in ubi_do_get_device_info()
61 struct ubi_device *ubi; in ubi_get_device_info() local
65 ubi = ubi_get_device(ubi_num); in ubi_get_device_info()
[all …]
Dfastmap.c23 size_t ubi_calc_fm_size(struct ubi_device *ubi) in ubi_calc_fm_size() argument
30 (ubi->peb_count * sizeof(struct ubi_fm_ec)) + \ in ubi_calc_fm_size()
32 (ubi->peb_count * sizeof(__be32))) + \ in ubi_calc_fm_size()
34 return roundup(size, ubi->leb_size); in ubi_calc_fm_size()
46 static struct ubi_vid_hdr *new_fm_vhdr(struct ubi_device *ubi, int vol_id) in new_fm_vhdr() argument
50 new = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); in new_fm_vhdr()
203 static int update_vol(struct ubi_device *ubi, struct ubi_attach_info *ai, in update_vol() argument
235 cmp_res = ubi_compare_lebs(ubi, aeb, new_aeb->pnum, new_vh); in update_vol()
299 static int process_pool_aeb(struct ubi_device *ubi, struct ubi_attach_info *ai, in process_pool_aeb() argument
338 return update_vol(ubi, ai, av, new_vh, new_aeb); in process_pool_aeb()
[all …]
Dmisc.c35 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf, in ubi_calc_data_len() argument
40 ubi_assert(!(length & (ubi->min_io_size - 1))); in ubi_calc_data_len()
47 length = ALIGN(i + 1, ubi->min_io_size); in ubi_calc_data_len()
61 int ubi_check_volume(struct ubi_device *ubi, int vol_id) in ubi_check_volume() argument
65 struct ubi_volume *vol = ubi->volumes[vol_id]; in ubi_check_volume()
82 err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1); in ubi_check_volume()
103 void ubi_update_reserved(struct ubi_device *ubi) in ubi_update_reserved() argument
105 int need = ubi->beb_rsvd_level - ubi->beb_rsvd_pebs; in ubi_update_reserved()
107 if (need <= 0 || ubi->avail_pebs == 0) in ubi_update_reserved()
110 need = min_t(int, need, ubi->avail_pebs); in ubi_update_reserved()
[all …]
Dattach.c92 static int self_check_ai(struct ubi_device *ubi, struct ubi_attach_info *ai);
322 int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb, in ubi_compare_lebs() argument
370 vh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); in ubi_compare_lebs()
375 err = ubi_io_read_vid_hdr(ubi, pnum, vh, 0); in ubi_compare_lebs()
396 mutex_lock(&ubi->buf_mutex); in ubi_compare_lebs()
397 err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, len); in ubi_compare_lebs()
402 crc = crc32(UBI_CRC32_INIT, ubi->peb_buf, len); in ubi_compare_lebs()
413 mutex_unlock(&ubi->buf_mutex); in ubi_compare_lebs()
415 ubi_free_vid_hdr(ubi, vh); in ubi_compare_lebs()
425 mutex_unlock(&ubi->buf_mutex); in ubi_compare_lebs()
[all …]
Dupd.c54 static int set_update_marker(struct ubi_device *ubi, struct ubi_volume *vol) in set_update_marker() argument
62 ubi_assert(ubi->vtbl[vol->vol_id].upd_marker); in set_update_marker()
67 vtbl_rec = ubi->vtbl[vol->vol_id]; in set_update_marker()
70 mutex_lock(&ubi->device_mutex); in set_update_marker()
71 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in set_update_marker()
73 mutex_unlock(&ubi->device_mutex); in set_update_marker()
87 static int clear_update_marker(struct ubi_device *ubi, struct ubi_volume *vol, in clear_update_marker() argument
95 vtbl_rec = ubi->vtbl[vol->vol_id]; in clear_update_marker()
110 mutex_lock(&ubi->device_mutex); in clear_update_marker()
111 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in clear_update_marker()
[all …]
Ddebug.h24 void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len);
61 int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset,
65 int ubi_debugfs_init_dev(struct ubi_device *ubi);
66 void ubi_debugfs_exit_dev(struct ubi_device *ubi);
75 static inline int ubi_dbg_is_bgt_disabled(const struct ubi_device *ubi) in ubi_dbg_is_bgt_disabled() argument
77 return ubi->dbg.disable_bgt; in ubi_dbg_is_bgt_disabled()
86 static inline int ubi_dbg_is_bitflip(const struct ubi_device *ubi) in ubi_dbg_is_bitflip() argument
88 if (ubi->dbg.emulate_bitflips) in ubi_dbg_is_bitflip()
100 static inline int ubi_dbg_is_write_failure(const struct ubi_device *ubi) in ubi_dbg_is_write_failure() argument
102 if (ubi->dbg.emulate_io_failures) in ubi_dbg_is_write_failure()
[all …]
Dcdev.c62 spin_lock(&vol->ubi->volumes_lock); in get_exclusive()
74 spin_unlock(&vol->ubi->volumes_lock); in get_exclusive()
88 spin_lock(&vol->ubi->volumes_lock); in revoke_exclusive()
98 spin_unlock(&vol->ubi->volumes_lock); in revoke_exclusive()
134 vol->ubi->ubi_num, vol->vol_id, desc->mode); in vol_cdev_release()
144 vol->upd_received, vol->upd_bytes, vol->ubi->ubi_num, in vol_cdev_release()
196 struct ubi_device *ubi = desc->vol->ubi; in vol_cdev_fsync() local
200 err = ubi_sync(ubi->ubi_num); in vol_cdev_fsync()
211 struct ubi_device *ubi = vol->ubi; in vol_cdev_read() local
238 tbuf_size = ALIGN(count, ubi->min_io_size); in vol_cdev_read()
[all …]
Ddebug.c34 void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len) in ubi_dump_flash() argument
39 loff_t addr = (loff_t)pnum * ubi->peb_size + offset; in ubi_dump_flash()
44 err = mtd_read(ubi->mtd, addr, len, &read, buf); in ubi_dump_flash()
264 struct ubi_device *ubi; in dfs_file_read() local
269 ubi = ubi_get_device(ubi_num); in dfs_file_read()
270 if (!ubi) in dfs_file_read()
272 d = &ubi->dbg; in dfs_file_read()
299 ubi_put_device(ubi); in dfs_file_read()
309 struct ubi_device *ubi; in dfs_file_write() local
315 ubi = ubi_get_device(ubi_num); in dfs_file_write()
[all …]
DMakefile1 obj-$(CONFIG_MTD_UBI) += ubi.o
3 ubi-y += vtbl.o vmt.o upd.o build.o cdev.o kapi.o eba.o io.o wl.o attach.o
4 ubi-y += misc.o debug.o
5 ubi-$(CONFIG_MTD_UBI_FASTMAP) += fastmap.o
/drivers/mtd/
DMakefile35 obj-$(CONFIG_MTD_UBI) += ubi/
DKconfig323 source "drivers/mtd/ubi/Kconfig"