Lines Matching refs:av

192 	struct ubi_ainf_volume *av;  in add_vol()  local
197 av = rb_entry(parent, struct ubi_ainf_volume, rb); in add_vol()
199 if (vol_id > av->vol_id) in add_vol()
201 else if (vol_id < av->vol_id) in add_vol()
207 av = kmalloc(sizeof(struct ubi_ainf_volume), GFP_KERNEL); in add_vol()
208 if (!av) in add_vol()
211 av->highest_lnum = av->leb_count = av->used_ebs = 0; in add_vol()
212 av->vol_id = vol_id; in add_vol()
213 av->data_pad = data_pad; in add_vol()
214 av->last_data_size = last_eb_bytes; in add_vol()
215 av->compat = 0; in add_vol()
216 av->vol_type = vol_type; in add_vol()
217 av->root = RB_ROOT; in add_vol()
218 if (av->vol_type == UBI_STATIC_VOLUME) in add_vol()
219 av->used_ebs = used_ebs; in add_vol()
223 rb_link_node(&av->rb, parent, p); in add_vol()
224 rb_insert_color(&av->rb, &ai->volumes); in add_vol()
227 return av; in add_vol()
239 struct ubi_ainf_volume *av) in assign_aeb_to_av() argument
244 p = &av->root.rb_node; in assign_aeb_to_av()
261 av->leb_count++; in assign_aeb_to_av()
264 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
278 struct ubi_ainf_volume *av, struct ubi_vid_hdr *new_vh, in update_vol() argument
281 struct rb_node **p = &av->root.rb_node, *parent = NULL; in update_vol()
324 if (av->highest_lnum == be32_to_cpu(new_vh->lnum)) in update_vol()
325 av->last_data_size = in update_vol()
329 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
340 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
348 if (av->highest_lnum <= be32_to_cpu(new_vh->lnum)) { in update_vol()
349 av->highest_lnum = be32_to_cpu(new_vh->lnum); in update_vol()
350 av->last_data_size = be32_to_cpu(new_vh->data_size); in update_vol()
353 if (av->vol_type == UBI_STATIC_VOLUME) in update_vol()
354 av->used_ebs = be32_to_cpu(new_vh->used_ebs); in update_vol()
356 av->leb_count++; in update_vol()
359 rb_insert_color(&new_aeb->u.rb, &av->root); in update_vol()
377 struct ubi_ainf_volume *av, *tmp_av = NULL; in process_pool_aeb() local
404 av = tmp_av; in process_pool_aeb()
411 ubi_assert(be32_to_cpu(new_vh->vol_id) == av->vol_id); in process_pool_aeb()
413 return update_vol(ubi, ai, av, new_vh, new_aeb); in process_pool_aeb()
426 struct ubi_ainf_volume *av; in unmap_peb() local
431 av = rb_entry(node, struct ubi_ainf_volume, rb); in unmap_peb()
433 for (node2 = rb_first(&av->root); node2; in unmap_peb()
437 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
438 av->leb_count--; in unmap_peb()
583 struct ubi_ainf_volume *av; in count_fastmap_pebs() local
593 ubi_rb_for_each_entry(rb1, av, &ai->volumes, rb) in count_fastmap_pebs()
594 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
614 struct ubi_ainf_volume *av; in ubi_attach_fastmap() local
757 av = add_vol(ai, be32_to_cpu(fmvhdr->vol_id), in ubi_attach_fastmap()
763 if (!av) in ubi_attach_fastmap()
765 if (PTR_ERR(av) == -EINVAL) { in ubi_attach_fastmap()
808 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
809 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
811 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
814 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()