goto err;
}
- ret = split_leaf(trans, root, &key, path, ins_len, 1);
+ ret = split_leaf(trans, root, &key, path, ins_len, true);
if (ret)
goto err;
/* the disk copy procedure reuses the scrub code */
ret = btrfs_scrub_dev(fs_info, src_device->devid, 0,
btrfs_device_get_total_bytes(src_device),
- &dev_replace->scrub_progress, 0, 1);
+ &dev_replace->scrub_progress, false, true);
ret = btrfs_dev_replace_finishing(fs_info, ret);
if (ret == -EINPROGRESS)
ret = btrfs_scrub_dev(fs_info, dev_replace->srcdev->devid,
dev_replace->committed_cursor_left,
btrfs_device_get_total_bytes(dev_replace->srcdev),
- &dev_replace->scrub_progress, 0, 1);
+ &dev_replace->scrub_progress, false, true);
ret = btrfs_dev_replace_finishing(fs_info, ret);
WARN_ON(ret && ret != -ECANCELED);
*delalloc_start_ret = start;
delalloc_len = btrfs_count_range_bits(&inode->io_tree,
delalloc_start_ret, end,
- len, EXTENT_DELALLOC, 1,
- cached_state);
+ len, EXTENT_DELALLOC,
+ true, cached_state);
} else {
spin_unlock(&inode->lock);
}
*/
btrfs_lock_extent(io_tree, start, end, &cached_state);
count = btrfs_count_range_bits(io_tree, &range_start, end, range_bytes,
- EXTENT_NORESERVE, 0, NULL);
+ EXTENT_NORESERVE, false, NULL);
if (count > 0 || is_space_ino || is_reloc_ino) {
u64 bytes = count;
struct btrfs_fs_info *fs_info = inode->root->fs_info;
}
} else {
ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), name,
- 0, BTRFS_I(inode)->dir_index);
+ false, BTRFS_I(inode)->dir_index);
if (unlikely(ret)) {
btrfs_abort_transaction(trans, ret);
goto discard;
inode_set_ctime_current(inode);
ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode),
- &fname.disk_name, 1, index);
+ &fname.disk_name, true, index);
if (ret)
goto fail;
}
ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode),
- new_name, 0, old_idx);
+ new_name, false, old_idx);
if (unlikely(ret)) {
btrfs_abort_transaction(trans, ret);
goto out_fail;
}
ret = btrfs_add_link(trans, BTRFS_I(old_dir), BTRFS_I(new_inode),
- old_name, 0, new_idx);
+ old_name, false, new_idx);
if (unlikely(ret)) {
btrfs_abort_transaction(trans, ret);
goto out_fail;
}
ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode),
- &new_fname.disk_name, 0, index);
+ &new_fname.disk_name, false, index);
if (unlikely(ret)) {
btrfs_abort_transaction(trans, ret);
goto out_fail;
ret = btrfs_scrub_dev(fs_info, sa->devid, sa->start, sa->end,
&sa->progress, sa->flags & BTRFS_SCRUB_READONLY,
- 0);
+ false);
/*
* Copy scrub args to user space even if btrfs_scrub_dev() returned an
}
}
-#define UPDATE_NEW 0
-#define UPDATE_OLD 1
/*
* Walk all of the roots that points to the bytenr and adjust their refcnts.
*/
seq = fs_info->qgroup_seq;
/* Update old refcnts using old_roots */
- qgroup_update_refcnt(fs_info, old_roots, &qgroups, seq, UPDATE_OLD);
+ qgroup_update_refcnt(fs_info, old_roots, &qgroups, seq, true);
/* Update new refcnts using new_roots */
- qgroup_update_refcnt(fs_info, new_roots, &qgroups, seq, UPDATE_NEW);
+ qgroup_update_refcnt(fs_info, new_roots, &qgroups, seq, false);
qgroup_update_counters(fs_info, &qgroups, nr_old_roots, nr_new_roots,
num_bytes, seq);
*/
btrfs_lock_extent(&dst->io_tree, dst_loff, end, &cached_state);
ret = btrfs_clone(&src->vfs_inode, &dst->vfs_inode, loff, len,
- ALIGN(len, bs), dst_loff, 1);
+ ALIGN(len, bs), dst_loff, true);
btrfs_unlock_extent(&dst->io_tree, dst_loff, end, &cached_state);
btrfs_btree_balance_dirty(fs_info);
*/
end = destoff + len - 1;
btrfs_lock_extent(&BTRFS_I(inode)->io_tree, destoff, end, &cached_state);
- ret = btrfs_clone(src, inode, off, olen, len, destoff, 0);
+ ret = btrfs_clone(src, inode, off, olen, len, destoff, false);
btrfs_unlock_extent(&BTRFS_I(inode)->io_tree, destoff, end, &cached_state);
if (ret < 0)
return ret;
sctx->right_path = right_path;
sctx->cmp_key = key;
- ret = finish_inode_if_needed(sctx, 0);
+ ret = finish_inode_if_needed(sctx, false);
if (ret < 0)
return ret;
}
out_finish:
- return finish_inode_if_needed(sctx, 1);
+ return finish_inode_if_needed(sctx, true);
}
static int replace_node_with_clone(struct btrfs_path *path, int level)
ret = btrfs_compare_trees(sctx->send_root, sctx->parent_root, sctx);
if (ret < 0)
goto out;
- ret = finish_inode_if_needed(sctx, 1);
+ ret = finish_inode_if_needed(sctx, true);
if (ret < 0)
goto out;
} else {
return 0;
mutex_lock(&fs_info->reloc_mutex);
- ret = record_root_in_trans(trans, root, 0);
+ ret = record_root_in_trans(trans, root, false);
mutex_unlock(&fs_info->reloc_mutex);
return ret;
* recorded root will never be updated again, causing an outdated root
* item.
*/
- ret = record_root_in_trans(trans, src, 1);
+ ret = record_root_in_trans(trans, src, true);
if (ret)
return ret;
* Or it won't be committed again onto disk after later
* insert_dir_item()
*/
- return record_root_in_trans(trans, parent, 1);
+ return record_root_in_trans(trans, parent, true);
}
/*
trans->transid,
trans->bytes_reserved, 1);
parent_root = parent_inode->root;
- ret = record_root_in_trans(trans, parent_root, 0);
+ ret = record_root_in_trans(trans, parent_root, false);
if (unlikely(ret))
goto fail;
cur_time = current_time(&parent_inode->vfs_inode);
goto fail;
}
- ret = record_root_in_trans(trans, root, 0);
+ ret = record_root_in_trans(trans, root, false);
if (unlikely(ret)) {
btrfs_abort_transaction(trans, ret);
goto fail;
}
/* insert our name */
- ret = btrfs_add_link(trans, dir, inode, &name, 0, ref_index);
+ ret = btrfs_add_link(trans, dir, inode, &name, false, ref_index);
if (ret) {
btrfs_abort_log_replay(wc, ret,
"failed to add link for inode %llu in dir %llu ref_index %llu name %.*s root %llu",
return PTR_ERR(dir);
}
- ret = btrfs_add_link(trans, dir, inode, name, 1, index);
+ ret = btrfs_add_link(trans, dir, inode, name, true, index);
/* FIXME, put inode into FIXUP list */