u64 parent;
u64 owner;
u64 flags;
+ u64 ptr;
int ret;
int i;
int nritems;
btrfs_item_key_to_cpu(buf, &first_key, 0);
level = btrfs_header_level(buf);
for (i = 0; i < nritems; i++) {
- u64 ptr = btrfs_node_blockptr(buf, i);
- u32 size = btrfs_level_size(root, level - 1);
+ ptr = btrfs_node_blockptr(buf, i);
+ size = btrfs_level_size(root, level - 1);
btrfs_node_key_to_cpu(buf, &key, i);
ret = add_extent_rec(extent_cache, &key,
ptr, size, 0, 0, 1, 0, 1, 0,
ret = err;
if (trans) {
- int err;
-
err = btrfs_commit_transaction(trans, root);
if (!ret)
ret = err;
static int cmd_dev_stats(int argc, char **argv)
{
- char *path;
+ char *dev_path;
struct btrfs_ioctl_fs_info_args fi_args;
struct btrfs_ioctl_dev_info_args *di_args = NULL;
int ret;
return 1;
}
- path = argv[optind];
+ dev_path = argv[optind];
- fdmnt = open_path_or_dev_mnt(path, &dirstream);
+ fdmnt = open_path_or_dev_mnt(dev_path, &dirstream);
if (fdmnt < 0) {
- fprintf(stderr, "ERROR: can't access '%s'\n", path);
+ fprintf(stderr, "ERROR: can't access '%s'\n", dev_path);
return 12;
}
- ret = get_fs_info(path, &fi_args, &di_args);
+ ret = get_fs_info(dev_path, &fi_args, &di_args);
if (ret) {
fprintf(stderr, "ERROR: getting dev info for devstats failed: "
"%s\n", strerror(-ret));
}
static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
- const char *output_rootdir, const char *dir,
+ const char *output_rootdir, const char *in_dir,
const regex_t *mreg)
{
struct btrfs_path *path;
if (loops++ >= 1024) {
printf("We have looped trying to restore files in %s "
"too many times to be making progress, "
- "stopping\n", dir);
+ "stopping\n", in_dir);
break;
}
btrfs_dir_item_key_to_cpu(leaf, dir_item, &location);
/* full path from root of btrfs being restored */
- snprintf(fs_name, 4096, "%s/%s", dir, filename);
+ snprintf(fs_name, 4096, "%s/%s", in_dir, filename);
if (mreg && REG_NOMATCH == regexec(mreg, fs_name, 0, NULL, 0))
goto next;
}
if (verbose)
- printf("Done searching %s\n", dir);
+ printf("Done searching %s\n", in_dir);
btrfs_free_path(path);
return 0;
}
BUG_ON(slot < 0);
if (slot != nritems) {
- int i;
unsigned int old_data = btrfs_item_end_nr(leaf, slot);
if (old_data < data_end) {
nritems = btrfs_header_nritems(leaf);
if (slot + nr != nritems) {
- int i;
int data_end = leaf_data_end(root, leaf);
memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) +
BTRFS_BLOCK_GROUP_RAID6)) {
if (raid_map) {
- int i, rot;
+ int rot;
u64 tmp;
u64 raid56_full_stripe_start;
u64 full_stripe_len = nr_data_stripes(map) * map->stripe_len;