• Home
  • Raw
  • Download

Lines Matching refs:r

106 static int set_bud_lprops(struct ubifs_info *c, struct replay_entry *r)  in set_bud_lprops()  argument
113 lp = ubifs_lpt_lookup_dirty(c, r->lnum); in set_bud_lprops()
120 if (r->offs == 0 && (lp->free != c->leb_size || lp->dirty != 0)) { in set_bud_lprops()
139 dbg_mnt("bud LEB %d was GC'd (%d free, %d dirty)", r->lnum, in set_bud_lprops()
141 dbg_gc("bud LEB %d was GC'd (%d free, %d dirty)", r->lnum, in set_bud_lprops()
153 "replay: %d free %d dirty", r->lnum, lp->free, in set_bud_lprops()
154 lp->dirty, r->free, r->dirty); in set_bud_lprops()
156 lp = ubifs_change_lp(c, lp, r->free, dirty + r->dirty, in set_bud_lprops()
172 static int trun_remove_range(struct ubifs_info *c, struct replay_entry *r) in trun_remove_range() argument
178 min_blk = r->new_size / UBIFS_BLOCK_SIZE; in trun_remove_range()
179 if (r->new_size & (UBIFS_BLOCK_SIZE - 1)) in trun_remove_range()
182 max_blk = r->old_size / UBIFS_BLOCK_SIZE; in trun_remove_range()
183 if ((r->old_size & (UBIFS_BLOCK_SIZE - 1)) == 0) in trun_remove_range()
186 ino = key_inum(c, &r->key); in trun_remove_range()
201 static int apply_replay_entry(struct ubifs_info *c, struct replay_entry *r) in apply_replay_entry() argument
203 int err, deletion = ((r->flags & REPLAY_DELETION) != 0); in apply_replay_entry()
205 dbg_mnt("LEB %d:%d len %d flgs %d sqnum %llu %s", r->lnum, in apply_replay_entry()
206 r->offs, r->len, r->flags, r->sqnum, DBGKEY(&r->key)); in apply_replay_entry()
209 c->replay_sqnum = r->sqnum; in apply_replay_entry()
211 if (r->flags & REPLAY_REF) in apply_replay_entry()
212 err = set_bud_lprops(c, r); in apply_replay_entry()
213 else if (is_hash_key(c, &r->key)) { in apply_replay_entry()
215 err = ubifs_tnc_remove_nm(c, &r->key, &r->nm); in apply_replay_entry()
217 err = ubifs_tnc_add_nm(c, &r->key, r->lnum, r->offs, in apply_replay_entry()
218 r->len, &r->nm); in apply_replay_entry()
221 switch (key_type(c, &r->key)) { in apply_replay_entry()
224 ino_t inum = key_inum(c, &r->key); in apply_replay_entry()
230 err = trun_remove_range(c, r); in apply_replay_entry()
233 err = ubifs_tnc_remove(c, &r->key); in apply_replay_entry()
237 err = ubifs_tnc_add(c, &r->key, r->lnum, r->offs, in apply_replay_entry()
238 r->len); in apply_replay_entry()
243 err = ubifs_recover_size_accum(c, &r->key, deletion, in apply_replay_entry()
244 r->new_size); in apply_replay_entry()
259 struct replay_entry *r; in destroy_replay_tree() local
269 r = rb_entry(this, struct replay_entry, rb); in destroy_replay_tree()
272 if (this->rb_left == &r->rb) in destroy_replay_tree()
277 if (is_hash_key(c, &r->key)) in destroy_replay_tree()
278 kfree(r->nm.name); in destroy_replay_tree()
279 kfree(r); in destroy_replay_tree()
297 struct replay_entry *r; in apply_replay_tree() local
302 r = rb_entry(this, struct replay_entry, rb); in apply_replay_tree()
303 err = apply_replay_entry(c, r); in apply_replay_tree()
337 struct replay_entry *r; in insert_node() local
345 r = rb_entry(parent, struct replay_entry, rb); in insert_node()
346 if (sqnum < r->sqnum) { in insert_node()
349 } else if (sqnum > r->sqnum) { in insert_node()
357 r = kzalloc(sizeof(struct replay_entry), GFP_KERNEL); in insert_node()
358 if (!r) in insert_node()
363 r->lnum = lnum; in insert_node()
364 r->offs = offs; in insert_node()
365 r->len = len; in insert_node()
366 r->sqnum = sqnum; in insert_node()
367 r->flags = (deletion ? REPLAY_DELETION : 0); in insert_node()
368 r->old_size = old_size; in insert_node()
369 r->new_size = new_size; in insert_node()
370 key_copy(c, key, &r->key); in insert_node()
372 rb_link_node(&r->rb, parent, p); in insert_node()
373 rb_insert_color(&r->rb, &c->replay_tree); in insert_node()
402 struct replay_entry *r; in insert_dent() local
411 r = rb_entry(parent, struct replay_entry, rb); in insert_dent()
412 if (sqnum < r->sqnum) { in insert_dent()
416 if (sqnum > r->sqnum) { in insert_dent()
424 r = kzalloc(sizeof(struct replay_entry), GFP_KERNEL); in insert_dent()
425 if (!r) in insert_dent()
429 kfree(r); in insert_dent()
435 r->lnum = lnum; in insert_dent()
436 r->offs = offs; in insert_dent()
437 r->len = len; in insert_dent()
438 r->sqnum = sqnum; in insert_dent()
439 r->nm.len = nlen; in insert_dent()
442 r->nm.name = nbuf; in insert_dent()
443 r->flags = (deletion ? REPLAY_DELETION : 0); in insert_dent()
444 key_copy(c, key, &r->key); in insert_dent()
447 rb_link_node(&r->rb, parent, p); in insert_dent()
448 rb_insert_color(&r->rb, &c->replay_tree); in insert_dent()
665 struct replay_entry *r; in insert_ref_node() local
670 r = rb_entry(parent, struct replay_entry, rb); in insert_ref_node()
671 if (sqnum < r->sqnum) { in insert_ref_node()
674 } else if (sqnum > r->sqnum) { in insert_ref_node()
682 r = kzalloc(sizeof(struct replay_entry), GFP_KERNEL); in insert_ref_node()
683 if (!r) in insert_ref_node()
686 r->lnum = lnum; in insert_ref_node()
687 r->offs = offs; in insert_ref_node()
688 r->sqnum = sqnum; in insert_ref_node()
689 r->flags = REPLAY_REF; in insert_ref_node()
690 r->free = free; in insert_ref_node()
691 r->dirty = dirty; in insert_ref_node()
693 rb_link_node(&r->rb, parent, p); in insert_ref_node()
694 rb_insert_color(&r->rb, &c->replay_tree); in insert_ref_node()