Lines Matching refs:desc
96 void ubi_get_volume_info(struct ubi_volume_desc *desc, in ubi_get_volume_info() argument
99 ubi_do_get_volume_info(desc->vol->ubi, desc->vol, vi); in ubi_get_volume_info()
124 struct ubi_volume_desc *desc; in ubi_open_volume() local
149 desc = kmalloc(sizeof(struct ubi_volume_desc), GFP_KERNEL); in ubi_open_volume()
150 if (!desc) { in ubi_open_volume()
195 desc->vol = vol; in ubi_open_volume()
196 desc->mode = mode; in ubi_open_volume()
204 ubi_close_volume(desc); in ubi_open_volume()
216 return desc; in ubi_open_volume()
222 kfree(desc); in ubi_open_volume()
331 void ubi_close_volume(struct ubi_volume_desc *desc) in ubi_close_volume() argument
333 struct ubi_volume *vol = desc->vol; in ubi_close_volume()
337 ubi->ubi_num, vol->vol_id, desc->mode); in ubi_close_volume()
340 switch (desc->mode) { in ubi_close_volume()
357 kfree(desc); in ubi_close_volume()
374 static int leb_read_sanity_check(struct ubi_volume_desc *desc, int lnum, in leb_read_sanity_check() argument
377 struct ubi_volume *vol = desc->vol; in leb_read_sanity_check()
428 int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, in ubi_leb_read() argument
431 struct ubi_volume *vol = desc->vol; in ubi_leb_read()
437 err = leb_read_sanity_check(desc, lnum, offset, len); in ubi_leb_read()
468 int ubi_leb_read_sg(struct ubi_volume_desc *desc, int lnum, struct ubi_sgl *sgl, in ubi_leb_read_sg() argument
471 struct ubi_volume *vol = desc->vol; in ubi_leb_read_sg()
477 err = leb_read_sanity_check(desc, lnum, offset, len); in ubi_leb_read_sg()
520 int ubi_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, in ubi_leb_write() argument
523 struct ubi_volume *vol = desc->vol; in ubi_leb_write()
532 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_write()
565 int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, in ubi_leb_change() argument
568 struct ubi_volume *vol = desc->vol; in ubi_leb_change()
577 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_change()
606 int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum) in ubi_leb_erase() argument
608 struct ubi_volume *vol = desc->vol; in ubi_leb_erase()
614 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_erase()
667 int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum) in ubi_leb_unmap() argument
669 struct ubi_volume *vol = desc->vol; in ubi_leb_unmap()
674 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_unmap()
703 int ubi_leb_map(struct ubi_volume_desc *desc, int lnum) in ubi_leb_map() argument
705 struct ubi_volume *vol = desc->vol; in ubi_leb_map()
710 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_map()
742 int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum) in ubi_is_mapped() argument
744 struct ubi_volume *vol = desc->vol; in ubi_is_mapped()