Lines Matching refs:err
83 int err, gc_lnum = c->gc_lnum; in switch_gc_head() local
91 err = ubifs_wbuf_sync_nolock(wbuf); in switch_gc_head()
92 if (err) in switch_gc_head()
93 return err; in switch_gc_head()
99 err = ubifs_leb_unmap(c, gc_lnum); in switch_gc_head()
100 if (err) in switch_gc_head()
101 return err; in switch_gc_head()
103 err = ubifs_wbuf_sync_nolock(wbuf); in switch_gc_head()
104 if (err) in switch_gc_head()
105 return err; in switch_gc_head()
107 err = ubifs_add_bud_to_log(c, GCHD, gc_lnum, 0); in switch_gc_head()
108 if (err) in switch_gc_head()
109 return err; in switch_gc_head()
112 err = ubifs_wbuf_seek_nolock(wbuf, gc_lnum, 0); in switch_gc_head()
113 return err; in switch_gc_head()
250 int err; in sort_nodes() local
278 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum, in sort_nodes()
280 if (err < 0) in sort_nodes()
281 return err; in sort_nodes()
283 if (!err) { in sort_nodes()
301 err = dbg_check_data_nodes_order(c, &sleb->nodes); in sort_nodes()
302 if (err) in sort_nodes()
303 return err; in sort_nodes()
304 err = dbg_check_nondata_nodes_order(c, nondata); in sort_nodes()
305 if (err) in sort_nodes()
306 return err; in sort_nodes()
324 int err, new_lnum = wbuf->lnum, new_offs = wbuf->offs + wbuf->used; in move_node() local
327 err = ubifs_wbuf_write_nolock(wbuf, snod->node, snod->len); in move_node()
328 if (err) in move_node()
329 return err; in move_node()
331 err = ubifs_tnc_replace(c, &snod->key, sleb->lnum, in move_node()
336 return err; in move_node()
351 int err, min; in move_nodes() local
360 err = switch_gc_head(c); in move_nodes()
361 if (err) in move_nodes()
362 return err; in move_nodes()
365 err = sort_nodes(c, sleb, &nondata, &min); in move_nodes()
366 if (err) in move_nodes()
384 err = move_node(c, sleb, snod, wbuf); in move_nodes()
385 if (err) in move_nodes()
409 err = move_node(c, sleb, snod, wbuf); in move_nodes()
410 if (err) in move_nodes()
421 err = switch_gc_head(c); in move_nodes()
422 if (err) in move_nodes()
430 return err; in move_nodes()
448 int err, i; in gc_sync_wbufs() local
453 err = ubifs_wbuf_sync(&c->jheads[i].wbuf); in gc_sync_wbufs()
454 if (err) in gc_sync_wbufs()
455 return err; in gc_sync_wbufs()
474 int err = 0, lnum = lp->lnum; in ubifs_garbage_collect_leb() local
492 err = gc_sync_wbufs(c); in ubifs_garbage_collect_leb()
493 if (err) in ubifs_garbage_collect_leb()
494 return err; in ubifs_garbage_collect_leb()
495 err = ubifs_change_one_lp(c, lp->lnum, c->leb_size, in ubifs_garbage_collect_leb()
497 if (err) in ubifs_garbage_collect_leb()
498 return err; in ubifs_garbage_collect_leb()
500 err = ubifs_leb_unmap(c, lp->lnum); in ubifs_garbage_collect_leb()
501 if (err) in ubifs_garbage_collect_leb()
502 return err; in ubifs_garbage_collect_leb()
534 err = ubifs_dirty_idx_node(c, &snod->key, level, lnum, in ubifs_garbage_collect_leb()
536 if (err) in ubifs_garbage_collect_leb()
542 err = -ENOMEM; in ubifs_garbage_collect_leb()
556 err = ubifs_change_one_lp(c, lnum, c->leb_size, 0, 0, in ubifs_garbage_collect_leb()
558 if (err) in ubifs_garbage_collect_leb()
560 err = LEB_FREED_IDX; in ubifs_garbage_collect_leb()
565 err = move_nodes(c, sleb); in ubifs_garbage_collect_leb()
566 if (err) in ubifs_garbage_collect_leb()
569 err = gc_sync_wbufs(c); in ubifs_garbage_collect_leb()
570 if (err) in ubifs_garbage_collect_leb()
573 err = ubifs_change_one_lp(c, lnum, c->leb_size, 0, 0, 0, 0); in ubifs_garbage_collect_leb()
574 if (err) in ubifs_garbage_collect_leb()
585 err = LEB_RETAINED; in ubifs_garbage_collect_leb()
587 err = ubifs_wbuf_sync_nolock(wbuf); in ubifs_garbage_collect_leb()
588 if (err) in ubifs_garbage_collect_leb()
591 err = ubifs_leb_unmap(c, lnum); in ubifs_garbage_collect_leb()
592 if (err) in ubifs_garbage_collect_leb()
595 err = LEB_FREED; in ubifs_garbage_collect_leb()
601 return err; in ubifs_garbage_collect_leb()
650 int i, err, ret, min_space = c->dead_wm; in ubifs_garbage_collect() local
734 err = ubifs_return_leb(c, lp.lnum); in ubifs_garbage_collect()
735 if (err) in ubifs_garbage_collect()
736 ret = err; in ubifs_garbage_collect()
808 err = ubifs_wbuf_sync_nolock(wbuf); in ubifs_garbage_collect()
809 if (!err) in ubifs_garbage_collect()
810 err = ubifs_leb_unmap(c, c->gc_lnum); in ubifs_garbage_collect()
811 if (err) { in ubifs_garbage_collect()
812 ret = err; in ubifs_garbage_collect()
844 int err = 0, flags; in ubifs_gc_start_commit() local
855 err = PTR_ERR(lp); in ubifs_gc_start_commit()
862 err = ubifs_leb_unmap(c, lp->lnum); in ubifs_gc_start_commit()
863 if (err) in ubifs_gc_start_commit()
867 err = PTR_ERR(lp); in ubifs_gc_start_commit()
882 err = PTR_ERR(lp); in ubifs_gc_start_commit()
889 err = -ENOMEM; in ubifs_gc_start_commit()
898 err = PTR_ERR(lp); in ubifs_gc_start_commit()
910 return err; in ubifs_gc_start_commit()
923 int err = 0; in ubifs_gc_end_commit() local
930 err = ubifs_leb_unmap(c, idx_gc->lnum); in ubifs_gc_end_commit()
931 if (err) in ubifs_gc_end_commit()
933 err = ubifs_change_one_lp(c, idx_gc->lnum, LPROPS_NC, in ubifs_gc_end_commit()
935 if (err) in ubifs_gc_end_commit()
942 return err; in ubifs_gc_end_commit()