Lines Matching refs:r
191 static int trun_remove_range(struct ubifs_info *c, struct replay_entry *r) in trun_remove_range() argument
197 min_blk = r->new_size / UBIFS_BLOCK_SIZE; in trun_remove_range()
198 if (r->new_size & (UBIFS_BLOCK_SIZE - 1)) in trun_remove_range()
201 max_blk = r->old_size / UBIFS_BLOCK_SIZE; in trun_remove_range()
202 if ((r->old_size & (UBIFS_BLOCK_SIZE - 1)) == 0) in trun_remove_range()
205 ino = key_inum(c, &r->key); in trun_remove_range()
220 static int apply_replay_entry(struct ubifs_info *c, struct replay_entry *r) in apply_replay_entry() argument
224 dbg_mntk(&r->key, "LEB %d:%d len %d deletion %d sqnum %llu key ", in apply_replay_entry()
225 r->lnum, r->offs, r->len, r->deletion, r->sqnum); in apply_replay_entry()
228 c->replay_sqnum = r->sqnum; in apply_replay_entry()
230 if (is_hash_key(c, &r->key)) { in apply_replay_entry()
231 if (r->deletion) in apply_replay_entry()
232 err = ubifs_tnc_remove_nm(c, &r->key, &r->nm); in apply_replay_entry()
234 err = ubifs_tnc_add_nm(c, &r->key, r->lnum, r->offs, in apply_replay_entry()
235 r->len, &r->nm); in apply_replay_entry()
237 if (r->deletion) in apply_replay_entry()
238 switch (key_type(c, &r->key)) { in apply_replay_entry()
241 ino_t inum = key_inum(c, &r->key); in apply_replay_entry()
247 err = trun_remove_range(c, r); in apply_replay_entry()
250 err = ubifs_tnc_remove(c, &r->key); in apply_replay_entry()
254 err = ubifs_tnc_add(c, &r->key, r->lnum, r->offs, in apply_replay_entry()
255 r->len); in apply_replay_entry()
260 err = ubifs_recover_size_accum(c, &r->key, r->deletion, in apply_replay_entry()
261 r->new_size); in apply_replay_entry()
303 struct replay_entry *r; in apply_replay_list() local
308 list_for_each_entry(r, &c->replay_list, list) { in apply_replay_list()
311 err = apply_replay_entry(c, r); in apply_replay_list()
327 struct replay_entry *r, *tmp; in destroy_replay_list() local
329 list_for_each_entry_safe(r, tmp, &c->replay_list, list) { in destroy_replay_list()
330 if (is_hash_key(c, &r->key)) in destroy_replay_list()
331 kfree(r->nm.name); in destroy_replay_list()
332 list_del(&r->list); in destroy_replay_list()
333 kfree(r); in destroy_replay_list()
362 struct replay_entry *r; in insert_node() local
369 r = kzalloc(sizeof(struct replay_entry), GFP_KERNEL); in insert_node()
370 if (!r) in insert_node()
375 r->lnum = lnum; in insert_node()
376 r->offs = offs; in insert_node()
377 r->len = len; in insert_node()
378 r->deletion = !!deletion; in insert_node()
379 r->sqnum = sqnum; in insert_node()
380 key_copy(c, key, &r->key); in insert_node()
381 r->old_size = old_size; in insert_node()
382 r->new_size = new_size; in insert_node()
384 list_add_tail(&r->list, &c->replay_list); in insert_node()
409 struct replay_entry *r; in insert_dent() local
416 r = kzalloc(sizeof(struct replay_entry), GFP_KERNEL); in insert_dent()
417 if (!r) in insert_dent()
422 kfree(r); in insert_dent()
428 r->lnum = lnum; in insert_dent()
429 r->offs = offs; in insert_dent()
430 r->len = len; in insert_dent()
431 r->deletion = !!deletion; in insert_dent()
432 r->sqnum = sqnum; in insert_dent()
433 key_copy(c, key, &r->key); in insert_dent()
434 r->nm.len = nlen; in insert_dent()
437 r->nm.name = nbuf; in insert_dent()
439 list_add_tail(&r->list, &c->replay_list); in insert_dent()