struct btrfs_inode_item *item,
struct inode *inode, int log_inode_only)
{
- btrfs_set_inode_uid(leaf, item, inode->i_uid);
- btrfs_set_inode_gid(leaf, item, inode->i_gid);
+ btrfs_set_inode_uid(leaf, item, i_uid_read(inode));
+ btrfs_set_inode_gid(leaf, item, i_gid_read(inode));
btrfs_set_inode_mode(leaf, item, inode->i_mode);
btrfs_set_inode_nlink(leaf, item, inode->i_nlink);
struct btrfs_path *dst_path, struct log_args *args)
{
struct btrfs_root *log = root->log_root;
- struct btrfs_file_extent_item *fi;
struct btrfs_key key;
u64 start = em->mod_start;
u64 search_start = start;
}
} while (key.offset > start);
- fi = btrfs_item_ptr(path->nodes[0], path->slots[0],
- struct btrfs_file_extent_item);
- num_bytes = btrfs_file_extent_num_bytes(path->nodes[0],
- fi);
+ num_bytes = btrfs_file_extent_length(path);
if (key.offset + num_bytes <= start) {
btrfs_release_path(path);
return -ENOENT;
args->src = path->nodes[0];
next_slot:
btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
- fi = btrfs_item_ptr(args->src, path->slots[0],
- struct btrfs_file_extent_item);
+ num_bytes = btrfs_file_extent_length(path);
if (args->nr &&
args->start_slot + args->nr == path->slots[0]) {
args->nr++;
}
nritems = btrfs_header_nritems(path->nodes[0]);
path->slots[0]++;
- num_bytes = btrfs_file_extent_num_bytes(args->src, fi);
if (len < num_bytes) {
/* I _think_ this is ok, envision we write to a
* preallocated space that is adjacent to a previously
ret = btrfs_truncate_inode_items(trans, log,
inode, 0, 0);
} else {
- fast_search = true;
+ if (inode_only == LOG_INODE_ALL)
+ fast_search = true;
max_key.type = BTRFS_XATTR_ITEM_KEY;
ret = drop_objectid_items(trans, log, path, ino,
BTRFS_XATTR_ITEM_KEY);