Lines Matching refs:av

186 	struct ubi_ainf_volume *av;  in add_vol()  local
191 av = rb_entry(parent, struct ubi_ainf_volume, rb); in add_vol()
193 if (vol_id > av->vol_id) in add_vol()
199 av = kmalloc(sizeof(struct ubi_ainf_volume), GFP_KERNEL); in add_vol()
200 if (!av) in add_vol()
203 av->highest_lnum = av->leb_count = av->used_ebs = 0; in add_vol()
204 av->vol_id = vol_id; in add_vol()
205 av->data_pad = data_pad; in add_vol()
206 av->last_data_size = last_eb_bytes; in add_vol()
207 av->compat = 0; in add_vol()
208 av->vol_type = vol_type; in add_vol()
209 av->root = RB_ROOT; in add_vol()
210 if (av->vol_type == UBI_STATIC_VOLUME) in add_vol()
211 av->used_ebs = used_ebs; in add_vol()
215 rb_link_node(&av->rb, parent, p); in add_vol()
216 rb_insert_color(&av->rb, &ai->volumes); in add_vol()
219 return av; in add_vol()
231 struct ubi_ainf_volume *av) in assign_aeb_to_av() argument
236 p = &av->root.rb_node; in assign_aeb_to_av()
253 av->leb_count++; in assign_aeb_to_av()
256 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
270 struct ubi_ainf_volume *av, struct ubi_vid_hdr *new_vh, in update_vol() argument
273 struct rb_node **p = &av->root.rb_node, *parent = NULL; in update_vol()
316 if (av->highest_lnum == be32_to_cpu(new_vh->lnum)) in update_vol()
317 av->last_data_size = \ in update_vol()
321 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
332 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
340 if (av->highest_lnum <= be32_to_cpu(new_vh->lnum)) { in update_vol()
341 av->highest_lnum = be32_to_cpu(new_vh->lnum); in update_vol()
342 av->last_data_size = be32_to_cpu(new_vh->data_size); in update_vol()
345 if (av->vol_type == UBI_STATIC_VOLUME) in update_vol()
346 av->used_ebs = be32_to_cpu(new_vh->used_ebs); in update_vol()
348 av->leb_count++; in update_vol()
351 rb_insert_color(&new_aeb->u.rb, &av->root); in update_vol()
369 struct ubi_ainf_volume *av, *tmp_av = NULL; in process_pool_aeb() local
396 av = tmp_av; in process_pool_aeb()
403 ubi_assert(be32_to_cpu(new_vh->vol_id) == av->vol_id); in process_pool_aeb()
405 return update_vol(ubi, ai, av, new_vh, new_aeb); in process_pool_aeb()
418 struct ubi_ainf_volume *av; in unmap_peb() local
423 av = rb_entry(node, struct ubi_ainf_volume, rb); in unmap_peb()
425 for (node2 = rb_first(&av->root); node2; in unmap_peb()
429 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
430 av->leb_count--; in unmap_peb()
569 struct ubi_ainf_volume *av; in count_fastmap_pebs() local
579 ubi_rb_for_each_entry(rb1, av, &ai->volumes, rb) in count_fastmap_pebs()
580 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
600 struct ubi_ainf_volume *av; in ubi_attach_fastmap() local
743 av = add_vol(ai, be32_to_cpu(fmvhdr->vol_id), in ubi_attach_fastmap()
749 if (!av) in ubi_attach_fastmap()
789 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
790 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
792 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
795 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()