Lines Matching refs:av
178 struct ubi_ainf_volume *av; in add_vol() local
180 av = ubi_add_av(ai, vol_id); in add_vol()
181 if (IS_ERR(av)) in add_vol()
182 return av; in add_vol()
184 av->data_pad = data_pad; in add_vol()
185 av->last_data_size = last_eb_bytes; in add_vol()
186 av->compat = 0; in add_vol()
187 av->vol_type = vol_type; in add_vol()
188 if (av->vol_type == UBI_STATIC_VOLUME) in add_vol()
189 av->used_ebs = used_ebs; in add_vol()
192 return av; in add_vol()
204 struct ubi_ainf_volume *av) in assign_aeb_to_av() argument
207 struct rb_node **p = &av->root.rb_node, *parent = NULL; in assign_aeb_to_av()
225 av->leb_count++; in assign_aeb_to_av()
228 rb_insert_color(&aeb->u.rb, &av->root); in assign_aeb_to_av()
242 struct ubi_ainf_volume *av, struct ubi_vid_hdr *new_vh, in update_vol() argument
245 struct rb_node **p = &av->root.rb_node, *parent = NULL; in update_vol()
285 if (av->highest_lnum == be32_to_cpu(new_vh->lnum)) in update_vol()
286 av->last_data_size = in update_vol()
290 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
302 av->vol_id, aeb->lnum, new_aeb->pnum); in update_vol()
310 if (av->highest_lnum <= be32_to_cpu(new_vh->lnum)) { in update_vol()
311 av->highest_lnum = be32_to_cpu(new_vh->lnum); in update_vol()
312 av->last_data_size = be32_to_cpu(new_vh->data_size); in update_vol()
315 if (av->vol_type == UBI_STATIC_VOLUME) in update_vol()
316 av->used_ebs = be32_to_cpu(new_vh->used_ebs); in update_vol()
318 av->leb_count++; in update_vol()
321 rb_insert_color(&new_aeb->u.rb, &av->root); in update_vol()
340 struct ubi_ainf_volume *av; in process_pool_aeb() local
349 av = ubi_find_av(ai, vol_id); in process_pool_aeb()
350 if (!av) { in process_pool_aeb()
356 ubi_assert(vol_id == av->vol_id); in process_pool_aeb()
358 return update_vol(ubi, ai, av, new_vh, new_aeb); in process_pool_aeb()
371 struct ubi_ainf_volume *av; in unmap_peb() local
375 ubi_rb_for_each_entry(node, av, &ai->volumes, rb) { in unmap_peb()
376 ubi_rb_for_each_entry(node2, aeb, &av->root, u.rb) { in unmap_peb()
378 rb_erase(&aeb->u.rb, &av->root); in unmap_peb()
379 av->leb_count--; in unmap_peb()
521 struct ubi_ainf_volume *av; in count_fastmap_pebs() local
531 ubi_rb_for_each_entry(rb1, av, &ai->volumes, rb) in count_fastmap_pebs()
532 ubi_rb_for_each_entry(rb2, aeb, &av->root, u.rb) in count_fastmap_pebs()
552 struct ubi_ainf_volume *av; in ubi_attach_fastmap() local
703 av = add_vol(ai, be32_to_cpu(fmvhdr->vol_id), in ubi_attach_fastmap()
709 if (IS_ERR(av)) { in ubi_attach_fastmap()
710 if (PTR_ERR(av) == -EEXIST) in ubi_attach_fastmap()
754 if (av->highest_lnum <= aeb->lnum) in ubi_attach_fastmap()
755 av->highest_lnum = aeb->lnum; in ubi_attach_fastmap()
757 assign_aeb_to_av(ai, aeb, av); in ubi_attach_fastmap()
760 aeb->pnum, aeb->lnum, av->vol_id); in ubi_attach_fastmap()