Lines Matching full:av

187 	struct ubi_ainf_volume *av;  in add_vol()  local
192 av = rb_entry(parent, struct ubi_ainf_volume, rb); in add_vol()
194 if (vol_id > av->vol_id) in add_vol()
196 else if (vol_id < av->vol_id) in add_vol()
202 av = kmalloc(sizeof(struct ubi_ainf_volume), GFP_KERNEL); in add_vol()
203 if (!av) in add_vol()
206 av->highest_lnum = av->leb_count = av->used_ebs = 0; in add_vol()
207 av->vol_id = vol_id; in add_vol()
208 av->data_pad = data_pad; in add_vol()
209 av->last_data_size = last_eb_bytes; in add_vol()
210 av->compat = 0; in add_vol()
211 av->vol_type = vol_type; in add_vol()
212 av->root = RB_ROOT; in add_vol()
213 if (av->vol_type == UBI_STATIC_VOLUME) in add_vol()
214 av->used_ebs = used_ebs; in add_vol()
218 rb_link_node(&av->rb, parent, p); in add_vol()
219 rb_insert_color(&av->rb, &ai->volumes); in add_vol()
222 return av; in add_vol()
230 * @av: target scan volume
234 struct ubi_ainf_volume *av) in assign_aeb_to_av() argument
239 p = &av->root.rb_node; in assign_aeb_to_av()
256 av->leb_count++; in assign_aeb_to_av()
259 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
266 * @av: the volume this LEB belongs to
273 struct ubi_ainf_volume *av, struct ubi_vid_hdr *new_vh, in update_vol() argument
276 struct rb_node **p = &av->root.rb_node, *parent = NULL; in update_vol()
319 if (av->highest_lnum == be32_to_cpu(new_vh->lnum)) in update_vol()
320 av->last_data_size = in update_vol()
324 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
335 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
343 if (av->highest_lnum <= be32_to_cpu(new_vh->lnum)) { in update_vol()
344 av->highest_lnum = be32_to_cpu(new_vh->lnum); in update_vol()
345 av->last_data_size = be32_to_cpu(new_vh->data_size); in update_vol()
348 if (av->vol_type == UBI_STATIC_VOLUME) in update_vol()
349 av->used_ebs = be32_to_cpu(new_vh->used_ebs); in update_vol()
351 av->leb_count++; in update_vol()
354 rb_insert_color(&new_aeb->u.rb, &av->root); in update_vol()
372 struct ubi_ainf_volume *av, *tmp_av = NULL; in process_pool_aeb() local
399 av = tmp_av; in process_pool_aeb()
406 ubi_assert(be32_to_cpu(new_vh->vol_id) == av->vol_id); in process_pool_aeb()
408 return update_vol(ubi, ai, av, new_vh, new_aeb); in process_pool_aeb()
421 struct ubi_ainf_volume *av; in unmap_peb() local
426 av = rb_entry(node, struct ubi_ainf_volume, rb); in unmap_peb()
428 for (node2 = rb_first(&av->root); node2; in unmap_peb()
432 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
433 av->leb_count--; in unmap_peb()
578 struct ubi_ainf_volume *av; in count_fastmap_pebs() local
588 ubi_rb_for_each_entry(rb1, av, &ai->volumes, rb) in count_fastmap_pebs()
589 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
609 struct ubi_ainf_volume *av; in ubi_attach_fastmap() local
752 av = add_vol(ai, be32_to_cpu(fmvhdr->vol_id), in ubi_attach_fastmap()
758 if (!av) in ubi_attach_fastmap()
760 if (PTR_ERR(av) == -EINVAL) { in ubi_attach_fastmap()
803 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
804 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
806 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
809 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()