Lines Matching refs:desc
90 void ubi_get_volume_info(struct ubi_volume_desc *desc, in ubi_get_volume_info() argument
93 ubi_do_get_volume_info(desc->vol->ubi, desc->vol, vi); in ubi_get_volume_info()
118 struct ubi_volume_desc *desc; in ubi_open_volume() local
143 desc = kmalloc(sizeof(struct ubi_volume_desc), GFP_KERNEL); in ubi_open_volume()
144 if (!desc) { in ubi_open_volume()
189 desc->vol = vol; in ubi_open_volume()
190 desc->mode = mode; in ubi_open_volume()
198 ubi_close_volume(desc); in ubi_open_volume()
210 return desc; in ubi_open_volume()
216 kfree(desc); in ubi_open_volume()
326 void ubi_close_volume(struct ubi_volume_desc *desc) in ubi_close_volume() argument
328 struct ubi_volume *vol = desc->vol; in ubi_close_volume()
332 ubi->ubi_num, vol->vol_id, desc->mode); in ubi_close_volume()
335 switch (desc->mode) { in ubi_close_volume()
352 kfree(desc); in ubi_close_volume()
369 static int leb_read_sanity_check(struct ubi_volume_desc *desc, int lnum, in leb_read_sanity_check() argument
372 struct ubi_volume *vol = desc->vol; in leb_read_sanity_check()
423 int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, in ubi_leb_read() argument
426 struct ubi_volume *vol = desc->vol; in ubi_leb_read()
432 err = leb_read_sanity_check(desc, lnum, offset, len); in ubi_leb_read()
463 int ubi_leb_read_sg(struct ubi_volume_desc *desc, int lnum, struct ubi_sgl *sgl, in ubi_leb_read_sg() argument
466 struct ubi_volume *vol = desc->vol; in ubi_leb_read_sg()
472 err = leb_read_sanity_check(desc, lnum, offset, len); in ubi_leb_read_sg()
514 int ubi_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, in ubi_leb_write() argument
517 struct ubi_volume *vol = desc->vol; in ubi_leb_write()
526 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_write()
559 int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, in ubi_leb_change() argument
562 struct ubi_volume *vol = desc->vol; in ubi_leb_change()
571 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_change()
600 int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum) in ubi_leb_erase() argument
602 struct ubi_volume *vol = desc->vol; in ubi_leb_erase()
608 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_erase()
661 int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum) in ubi_leb_unmap() argument
663 struct ubi_volume *vol = desc->vol; in ubi_leb_unmap()
668 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_unmap()
697 int ubi_leb_map(struct ubi_volume_desc *desc, int lnum) in ubi_leb_map() argument
699 struct ubi_volume *vol = desc->vol; in ubi_leb_map()
704 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME) in ubi_leb_map()
736 int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum) in ubi_is_mapped() argument
738 struct ubi_volume *vol = desc->vol; in ubi_is_mapped()