Lines Matching refs:item
318 struct btrfs_delayed_item *item; in btrfs_alloc_delayed_item() local
319 item = kmalloc(sizeof(*item) + data_len, GFP_NOFS); in btrfs_alloc_delayed_item()
320 if (item) { in btrfs_alloc_delayed_item()
321 item->data_len = data_len; in btrfs_alloc_delayed_item()
322 item->ins_or_del = 0; in btrfs_alloc_delayed_item()
323 item->bytes_reserved = 0; in btrfs_alloc_delayed_item()
324 item->delayed_node = NULL; in btrfs_alloc_delayed_item()
325 refcount_set(&item->refs, 1); in btrfs_alloc_delayed_item()
327 return item; in btrfs_alloc_delayed_item()
406 struct btrfs_delayed_item *item; in __btrfs_add_delayed_item() local
421 item = rb_entry(parent_node, struct btrfs_delayed_item, in __btrfs_add_delayed_item()
424 cmp = btrfs_comp_cpu_keys(&item->key, &ins->key); in __btrfs_add_delayed_item()
451 struct btrfs_delayed_item *item) in __btrfs_add_delayed_insertion_item() argument
453 return __btrfs_add_delayed_item(node, item, in __btrfs_add_delayed_insertion_item()
458 struct btrfs_delayed_item *item) in __btrfs_add_delayed_deletion_item() argument
460 return __btrfs_add_delayed_item(node, item, in __btrfs_add_delayed_deletion_item()
499 static void btrfs_release_delayed_item(struct btrfs_delayed_item *item) in btrfs_release_delayed_item() argument
501 if (item) { in btrfs_release_delayed_item()
502 __btrfs_remove_delayed_item(item); in btrfs_release_delayed_item()
503 if (refcount_dec_and_test(&item->refs)) in btrfs_release_delayed_item()
504 kfree(item); in btrfs_release_delayed_item()
512 struct btrfs_delayed_item *item = NULL; in __btrfs_first_delayed_insertion_item() local
516 item = rb_entry(p, struct btrfs_delayed_item, rb_node); in __btrfs_first_delayed_insertion_item()
518 return item; in __btrfs_first_delayed_insertion_item()
525 struct btrfs_delayed_item *item = NULL; in __btrfs_first_delayed_deletion_item() local
529 item = rb_entry(p, struct btrfs_delayed_item, rb_node); in __btrfs_first_delayed_deletion_item()
531 return item; in __btrfs_first_delayed_deletion_item()
535 struct btrfs_delayed_item *item) in __btrfs_next_delayed_item() argument
540 p = rb_next(&item->rb_node); in __btrfs_next_delayed_item()
549 struct btrfs_delayed_item *item) in btrfs_delayed_item_reserve_metadata() argument
573 item->key.objectid, in btrfs_delayed_item_reserve_metadata()
575 item->bytes_reserved = num_bytes; in btrfs_delayed_item_reserve_metadata()
582 struct btrfs_delayed_item *item) in btrfs_delayed_item_release_metadata() argument
587 if (!item->bytes_reserved) in btrfs_delayed_item_release_metadata()
596 item->key.objectid, item->bytes_reserved, in btrfs_delayed_item_release_metadata()
598 btrfs_block_rsv_release(fs_info, rsv, item->bytes_reserved, NULL); in btrfs_delayed_item_release_metadata()
793 struct btrfs_delayed_item *item) in btrfs_batch_delete_items() argument
811 next = item; in btrfs_batch_delete_items()
1421 struct btrfs_delayed_item *item; in btrfs_delete_delayed_insertion_item() local
1424 item = __btrfs_lookup_delayed_insertion_item(node, key); in btrfs_delete_delayed_insertion_item()
1425 if (!item) { in btrfs_delete_delayed_insertion_item()
1430 btrfs_delayed_item_release_metadata(node->root, item); in btrfs_delete_delayed_insertion_item()
1431 btrfs_release_delayed_item(item); in btrfs_delete_delayed_insertion_item()
1440 struct btrfs_delayed_item *item; in btrfs_delete_delayed_dir_index() local
1457 item = btrfs_alloc_delayed_item(0); in btrfs_delete_delayed_dir_index()
1458 if (!item) { in btrfs_delete_delayed_dir_index()
1463 item->key = item_key; in btrfs_delete_delayed_dir_index()
1465 ret = btrfs_delayed_item_reserve_metadata(trans, dir->root, item); in btrfs_delete_delayed_dir_index()
1473 btrfs_release_delayed_item(item); in btrfs_delete_delayed_dir_index()
1478 ret = __btrfs_add_delayed_deletion_item(node, item); in btrfs_delete_delayed_dir_index()
1484 btrfs_delayed_item_release_metadata(dir->root, item); in btrfs_delete_delayed_dir_index()
1485 btrfs_release_delayed_item(item); in btrfs_delete_delayed_dir_index()
1521 struct btrfs_delayed_item *item; in btrfs_readdir_get_delayed_items() local
1535 item = __btrfs_first_delayed_insertion_item(delayed_node); in btrfs_readdir_get_delayed_items()
1536 while (item && item->key.offset <= last_index) { in btrfs_readdir_get_delayed_items()
1537 refcount_inc(&item->refs); in btrfs_readdir_get_delayed_items()
1538 list_add_tail(&item->readdir_list, ins_list); in btrfs_readdir_get_delayed_items()
1539 item = __btrfs_next_delayed_item(item); in btrfs_readdir_get_delayed_items()
1542 item = __btrfs_first_delayed_deletion_item(delayed_node); in btrfs_readdir_get_delayed_items()
1543 while (item && item->key.offset <= last_index) { in btrfs_readdir_get_delayed_items()
1544 refcount_inc(&item->refs); in btrfs_readdir_get_delayed_items()
1545 list_add_tail(&item->readdir_list, del_list); in btrfs_readdir_get_delayed_items()
1546 item = __btrfs_next_delayed_item(item); in btrfs_readdir_get_delayed_items()