diff options
author | David Sterba <dsterba@suse.com> | 2016-09-07 16:22:33 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-10-03 11:33:15 +0200 |
commit | 1ed3426d3f74bbbfaab2b77991596644e2e6321d (patch) | |
tree | 8ecd429e5746c766fa84781d7a73a64afe75e24f /utils.c | |
parent | b80a4641e53c042c1fd22cdce561aec9d205838b (diff) |
btrfs-progs: use standard allocation functions in non-kenrel code
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1621,12 +1621,12 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, 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; @@ -1679,14 +1679,14 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, 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; } |