Lines Matching refs:snod
232 struct ubifs_scan_node *snod, *tmp; in sort_nodes() local
237 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in sort_nodes()
238 ubifs_assert(c, snod->type == UBIFS_INO_NODE || in sort_nodes()
239 snod->type == UBIFS_DATA_NODE || in sort_nodes()
240 snod->type == UBIFS_DENT_NODE || in sort_nodes()
241 snod->type == UBIFS_XENT_NODE || in sort_nodes()
242 snod->type == UBIFS_TRUN_NODE || in sort_nodes()
243 snod->type == UBIFS_AUTH_NODE); in sort_nodes()
245 if (snod->type != UBIFS_INO_NODE && in sort_nodes()
246 snod->type != UBIFS_DATA_NODE && in sort_nodes()
247 snod->type != UBIFS_DENT_NODE && in sort_nodes()
248 snod->type != UBIFS_XENT_NODE) { in sort_nodes()
250 list_del(&snod->list); in sort_nodes()
251 kfree(snod); in sort_nodes()
255 ubifs_assert(c, key_type(c, &snod->key) == UBIFS_DATA_KEY || in sort_nodes()
256 key_type(c, &snod->key) == UBIFS_INO_KEY || in sort_nodes()
257 key_type(c, &snod->key) == UBIFS_DENT_KEY || in sort_nodes()
258 key_type(c, &snod->key) == UBIFS_XENT_KEY); in sort_nodes()
260 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum, in sort_nodes()
261 snod->offs, 0); in sort_nodes()
267 list_del(&snod->list); in sort_nodes()
268 kfree(snod); in sort_nodes()
272 if (snod->len < *min) in sort_nodes()
273 *min = snod->len; in sort_nodes()
275 if (key_type(c, &snod->key) != UBIFS_DATA_KEY) in sort_nodes()
276 list_move_tail(&snod->list, nondata); in sort_nodes()
304 struct ubifs_scan_node *snod, struct ubifs_wbuf *wbuf) in move_node() argument
309 err = ubifs_wbuf_write_nolock(wbuf, snod->node, snod->len); in move_node()
313 err = ubifs_tnc_replace(c, &snod->key, sleb->lnum, in move_node()
314 snod->offs, new_lnum, new_offs, in move_node()
315 snod->len); in move_node()
316 list_del(&snod->list); in move_node()
317 kfree(snod); in move_node()
354 struct ubifs_scan_node *snod, *tmp; in move_nodes() local
357 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in move_nodes()
360 if (snod->len > avail) in move_nodes()
368 snod->node, snod->len); in move_nodes()
372 err = move_node(c, sleb, snod, wbuf); in move_nodes()
379 list_for_each_entry_safe(snod, tmp, &nondata, list) { in move_nodes()
385 if (snod->len > avail) { in move_nodes()
393 if (key_type(c, &snod->key) == UBIFS_DENT_KEY || in move_nodes()
394 snod->len == UBIFS_INO_NODE_SZ) in move_nodes()
400 snod->node, snod->len); in move_nodes()
404 err = move_node(c, sleb, snod, wbuf); in move_nodes()
494 struct ubifs_scan_node *snod; in ubifs_garbage_collect_leb() local
543 snod = list_entry(sleb->nodes.next, struct ubifs_scan_node, list); in ubifs_garbage_collect_leb()
545 if (snod->type == UBIFS_IDX_NODE) { in ubifs_garbage_collect_leb()
550 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_garbage_collect_leb()
551 struct ubifs_idx_node *idx = snod->node; in ubifs_garbage_collect_leb()
554 ubifs_assert(c, snod->type == UBIFS_IDX_NODE); in ubifs_garbage_collect_leb()
555 key_read(c, ubifs_idx_key(c, idx), &snod->key); in ubifs_garbage_collect_leb()
556 err = ubifs_dirty_idx_node(c, &snod->key, level, lnum, in ubifs_garbage_collect_leb()
557 snod->offs); in ubifs_garbage_collect_leb()