Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
btrfsprogs
0011-btrfs-progs-Introduce-function-to-initiali...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0011-btrfs-progs-Introduce-function-to-initialize-csum-tr.patch of Package btrfsprogs
From: Qu Wenruo <quwenruo@cn.fujitsu.com> Date: Fri, 29 Jan 2016 13:03:20 +0800 Subject: btrfs-progs: Introduce function to initialize csum tree Git-commit: 1b8851ec40f7e135c1ff58d8225d4a724a99b757 Patch-mainline: v4.6 References: bsc#1042369 Introduce new function, setup_temp_csum_tree(), to setup temporary csum tree for make_btrfs_v2(). Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com> --- utils.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/utils.c b/utils.c index 36209df..1e12f57 100644 --- a/utils.c +++ b/utils.c @@ -675,6 +675,28 @@ out: return ret; } +static int setup_temp_csum_tree(int fd, struct btrfs_mkfs_config *cfg, + u64 csum_bytenr) +{ + struct extent_buffer *buf = NULL; + int ret; + + buf = malloc(sizeof(*buf) + cfg->nodesize); + if (!buf) + return -ENOMEM; + ret = setup_temp_extent_buffer(buf, cfg, csum_bytenr, + BTRFS_CSUM_TREE_OBJECTID); + if (ret < 0) + goto out; + /* + * Temporary csum tree is completely empty. + */ + ret = write_temp_extent_buffer(fd, buf, csum_bytenr); +out: + free(buf); + return ret; +} + /* * Improved version of make_btrfs(). * @@ -773,6 +795,9 @@ static int make_convert_btrfs(int fd, struct btrfs_mkfs_config *cfg, if (ret < 0) goto out; ret = setup_temp_fs_tree(fd, cfg, fs_bytenr); + if (ret < 0) + goto out; + ret = setup_temp_csum_tree(fd, cfg, csum_bytenr); out: return ret; -- 2.12.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor