num_stripes = multi->num_stripes;
physical = multi->stripes[0].physical;
- kfree(multi);
+ free(multi);
if (num_stripes != 1) {
error("num stripes for bytenr %llu is not 1", bytenr);
"mirror %d logical %llu physical %llu device %s\n",
mirror_num, (unsigned long long)bytenr,
(unsigned long long)eb->dev_bytenr, device->name);
- kfree(multi);
+ free(multi);
if (!copy || mirror_num == copy) {
ret = read_extent_from_disk(eb, 0, eb->len);
multi->stripes[0].physical,
device->name);
}
- kfree(multi);
+ free(multi);
multi = NULL;
cur_offset += cur_len;
}
map->stripes[i].dev = btrfs_find_device(root, devid,
uuid, NULL);
if (!map->stripes[i].dev) {
- kfree(map);
+ free(map);
return -EIO;
}
}
free(backref);
}
- kfree(rec);
+ free(rec);
}
FREE_EXTENT_CACHE_BASED_TREE(root_recs, free_root_record);
continue;
if (logical[nr] == offset) {
if (stripe_len >= bytes) {
- kfree(logical);
+ free(logical);
return 0;
}
bytes -= stripe_len;
} else if (logical[nr] < offset) {
if (logical[nr] + stripe_len >=
offset + bytes) {
- kfree(logical);
+ free(logical);
return 0;
}
bytes = (offset + bytes) -
offset,
logical[nr] - offset);
if (ret) {
- kfree(logical);
+ free(logical);
return ret;
}
}
}
- kfree(logical);
+ free(logical);
}
entry = btrfs_find_free_space(cache->free_space_ctl, offset, bytes);
if ((fd != -1) && !get_df(fd, &space_info_arg)) {
print_one_fs(&fs_info_arg, dev_info_arg,
space_info_arg, label, unit_mode);
- kfree(space_info_arg);
+ free(space_info_arg);
memset(label, 0, sizeof(label));
found = 1;
}
dev_fd = device->fd;
device->total_ios++;
dev_bytenr = multi->stripes[0].physical;
- kfree(multi);
+ free(multi);
if (size_left < length)
length = size_left;
device_total_bytes = (device_total_bytes / sectorsize) * sectorsize;
- device = kzalloc(sizeof(*device), GFP_NOFS);
+ device = calloc(1, sizeof(*device));
if (!device) {
ret = -ENOMEM;
goto out;
}
- buf = kzalloc(sectorsize, GFP_NOFS);
+ buf = calloc(1, sectorsize);
if (!buf) {
ret = -ENOMEM;
goto out;
ret = pwrite(fd, buf, sectorsize, BTRFS_SUPER_INFO_OFFSET);
BUG_ON(ret != sectorsize);
- kfree(buf);
+ free(buf);
list_add(&device->dev_list, &root->fs_info->fs_devices->devices);
device->fs_devices = root->fs_info->fs_devices;
return 0;
out:
- kfree(device);
- kfree(buf);
+ free(device);
+ free(buf);
return ret;
}