Lines Matching refs:item
23 #include "inode-item.h"
28 #include "dir-item.h"
29 #include "file-item.h"
370 * If the key is already in the destination tree the existing item is
371 * overwritten. If the existing item isn't big enough, it is extended.
374 * If the key isn't in the destination yet, a new item is inserted.
453 struct btrfs_inode_item *item;
457 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
459 nbytes = btrfs_inode_nbytes(path->nodes[0], item);
460 item = btrfs_item_ptr(eb, slot,
462 btrfs_set_inode_nbytes(eb, item, nbytes);
469 mode = btrfs_inode_mode(eb, item);
471 btrfs_set_inode_size(eb, item, 0);
474 struct btrfs_inode_item *item;
481 item = btrfs_item_ptr(eb, slot, struct btrfs_inode_item);
482 btrfs_set_inode_nbytes(eb, item, 0);
489 mode = btrfs_inode_mode(eb, item);
491 btrfs_set_inode_size(eb, item, 0);
501 /* make sure any existing item is the correct size */
636 struct btrfs_file_extent_item *item;
641 item = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
642 found_type = btrfs_file_extent_type(eb, item);
646 nbytes = btrfs_file_extent_num_bytes(eb, item);
653 if (btrfs_file_extent_disk_bytenr(eb, item) == 0)
656 size = btrfs_file_extent_ram_bytes(eb, item);
657 nbytes = btrfs_file_extent_ram_bytes(eb, item);
691 read_extent_buffer(eb, &cmp1, (unsigned long)item,
721 if (btrfs_file_extent_disk_bytenr(eb, item) == 0 &&
726 sizeof(*item));
732 (unsigned long)item, sizeof(*item));
734 ins.objectid = btrfs_file_extent_disk_bytenr(eb, item);
735 ins.offset = btrfs_file_extent_disk_num_bytes(eb, item);
737 offset = key->offset - btrfs_file_extent_offset(eb, item);
741 * file extent item copy and skip normal backref update,
748 btrfs_file_extent_disk_bytenr(eb, item),
749 btrfs_file_extent_disk_num_bytes(eb, item));
790 if (btrfs_file_extent_compression(eb, item)) {
795 btrfs_file_extent_offset(eb, item);
797 btrfs_file_extent_num_bytes(eb, item);
809 * extent item and partially referenced by another
810 * file extent item (like after using the clone or
828 * has a single csum item that covers the entire range
833 * After the first file extent item is replayed, the
834 * csum tree gets the following csum item:
840 * extent item, if we do not delete existing csum items
850 * end up looking at the second csum item only, which
924 * item
1013 * inode backreferences may have multiple refs in a single item,
1257 * Take an inode reference item from the log tree and iterate all names from the
1258 * inode reference item in the subvolume tree with the same key (if it exists).
1259 * For any name that is not in the inode reference item from the log tree, do a
1261 * reference item and both dir index keys).
1342 * replay one inode back reference item found in the log tree.
1406 * item to another.
1464 * Before we overwrite the inode reference item in the subvolume tree
1465 * with the item from the log tree, we must unlink all names from the
1467 * item, otherwise we end up with an inconsistent subvolume tree where
1469 * item with the same name.
1808 * take a single entry in a log directory item and replay it into
1811 * if a conflicting item exists in the subdirectory already,
1951 /* Replay one dir item from a BTRFS_DIR_INDEX_KEY key. */
1961 /* We only log dir index keys, which only contain a single dir item. */
2018 * directory is in a logged range item, but not actually in the log
2029 struct btrfs_dir_log_item *item;
2055 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
2057 found_end = btrfs_dir_log_end(path->nodes[0], item);
2067 /* check the next slot in the tree to see if it is a valid item */
2082 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
2084 found_end = btrfs_dir_log_end(path->nodes[0], item);
2094 * this looks for a given directory item in the log. If the directory
2095 * item is not in the log, the item is removed and the inode it points
2116 * by an older kernel that logged both dir index and dir item keys, all
2118 * safely ignore dir item keys (key type BTRFS_DIR_ITEM_KEY).
2162 * Unlike dir item keys, dir index keys can only have one name (entry) in
2304 * because we replay the deletes before we copy in the inode item
2380 * The second stage copies all the other item types from the log into
2763 * helper function to update the item for a given subvolumes log root
2774 /* insert root item on the first sync */
3307 * item.
3327 * Logging an inode always results in logging its inode item. So if we
3328 * did not find the item we know the inode was not logged for sure.
3355 * in the inode item or any other on-disk structure, so its value is lost
3382 * for dir item keys.
3393 * inode item because on log replay we update the field to reflect
3491 * creates a range item in the log for 'dirid'. first_offset and
3503 struct btrfs_dir_log_item *item;
3508 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item));
3519 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
3522 const u64 curr_end = btrfs_dir_log_end(path->nodes[0], item);
3532 btrfs_set_dir_log_end(path->nodes[0], item, last_offset);
3598 * to left. For example, the data for the second item ends at an offset
3599 * that matches the offset where the data for the first item starts, the
3600 * data for the third item ends at an offset that matches the offset
3614 * If for some unexpected reason the last item's index is not greater
3675 * Skip ranges of items that consist only of dir item keys created
3677 * dir index range item for that gap, so that index keys in that
3693 /* If we logged this dir index item before, we can skip it. */
3816 * happened. So the key range item we log (key type
3856 * we have a block from this transaction, log every item in it
3870 * look ahead to the next item and see if it is also
3892 * that next key. So the key range item we log (key type
3913 * all its dir items are from a past transaction, the last item
3914 * in the leaf is a dir item and there's no gap between that last
3915 * dir item and the first one on the next leaf (which did not
4038 * inode. max_key_type indicates the highest item type to remove.
4112 struct btrfs_inode_item *item,
4127 btrfs_set_token_inode_generation(&token, item, 0);
4128 btrfs_set_token_inode_size(&token, item, logged_isize);
4130 btrfs_set_token_inode_generation(&token, item,
4132 btrfs_set_token_inode_size(&token, item, inode->i_size);
4135 btrfs_set_token_inode_uid(&token, item, i_uid_read(inode));
4136 btrfs_set_token_inode_gid(&token, item, i_gid_read(inode));
4137 btrfs_set_token_inode_mode(&token, item, inode->i_mode);
4138 btrfs_set_token_inode_nlink(&token, item, inode->i_nlink);
4140 btrfs_set_token_timespec_sec(&token, &item->atime,
4142 btrfs_set_token_timespec_nsec(&token, &item->atime,
4145 btrfs_set_token_timespec_sec(&token, &item->mtime,
4147 btrfs_set_token_timespec_nsec(&token, &item->mtime,
4150 btrfs_set_token_timespec_sec(&token, &item->ctime,
4152 btrfs_set_token_timespec_nsec(&token, &item->ctime,
4161 * inode item in subvolume tree as needed (see overwrite_item()).
4164 btrfs_set_token_inode_sequence(&token, item, inode_peek_iversion(inode));
4165 btrfs_set_token_inode_transid(&token, item, trans->transid);
4166 btrfs_set_token_inode_rdev(&token, item, inode->i_rdev);
4169 btrfs_set_token_inode_flags(&token, item, flags);
4170 btrfs_set_token_inode_block_group(&token, item, 0);
4187 * same subvolume. Using btrfs_insert_empty_item() when the inode item
4198 * so the inode item is not in the log and we need to insert it.
4247 * Due to extent cloning, we might have logged a csum item that covers a
4249 * item for a larger subrange of the same extent or the entire range.
4953 struct btrfs_inode_item *item;
4955 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
4957 *size_ret = btrfs_inode_size(path->nodes[0], item);
5058 * that contains the inode item and references) we may end up not processing
5123 * an extent item and we are holding the inode lock, the
5356 * from the inode, leaving the logged inode item with a link count that does
5359 * link count in the inode item (see replay_one_buffer() and
5364 * BTRFS_DIR_INDEX_KEY) are added to fs/subvol tree and the logged inode item
5557 struct btrfs_inode_item *item;
5559 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
5561 if (S_ISDIR(btrfs_inode_mode(path->nodes[0], item)))
6009 * So find the first delayed item that was not yet logged (they are
6092 * this we log a single dir range item spanning several contiguous
6093 * dir items instead of logging one range item per dir index item.
6192 * item logging their range, so no need to add one or update an
6193 * existing one. Otherwise we have to log a dir range item.
6202 * then we want to reuse the previous range item and change its
6204 * leaf space usage, by avoiding adding a new range item.
6257 struct btrfs_delayed_item *item;
6270 list_for_each_entry(item, delayed_ins_list, log_list) {
6276 dir_item = (struct btrfs_dir_item *)item->data;
6430 * Before logging the inode item, cache the value returned by
6464 * Make sure the new inode item we write to the log has
6608 * updated inode item, etc, and syncs the log. The same logic
6611 * 2) When we log the inode with LOG_INODE_EXISTS, its inode item
6941 * track of which subitem we are processing for each item in
7071 * but the file inode does not have a matching BTRFS_INODE_REF_KEY item
7487 * the old name's dir index item is in the delayed items, so