Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
btrfsprogs.356
2008-btrfs-convert-factor-out-block-iteration-c...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2008-btrfs-convert-factor-out-block-iteration-callback.patch of Package btrfsprogs.356
From: Jeff Mahoney <jeffm@suse.com> Subject: btrfs-convert: factor out block iteration callback block_iterate_proc uses the libext2fs error return codes when it doesn't need them to return the error. We can push this out to __block_iterate_proc and allow the reiserfs converter to share the code. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- btrfs-convert.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -516,7 +516,7 @@ static int record_file_blocks(struct blk static int block_iterate_proc(u64 disk_block, u64 file_block, struct blk_iterate_data *idata) { - int ret; + int ret = 0; int sb_region; int do_barrier; struct btrfs_root *root = idata->root; @@ -558,19 +558,23 @@ static int block_iterate_proc(u64 disk_b idata->boundary = bytenr / root->sectorsize; } idata->num_blocks++; - return 0; fail: - idata->errcode = ret; - return BLOCK_ABORT; + return ret; } static int __block_iterate_proc(ext2_filsys fs, blk_t *blocknr, e2_blkcnt_t blockcnt, blk_t ref_block, int ref_offset, void *priv_data) { + int ret; struct blk_iterate_data *idata; idata = (struct blk_iterate_data *)priv_data; - return block_iterate_proc(*blocknr, blockcnt, idata); + ret = block_iterate_proc(*blocknr, blockcnt, idata); + if (ret) { + idata->errcode = ret; + return BLOCK_ABORT; + } + return 0; } /* @@ -1206,10 +1210,8 @@ static int create_image_file_range(struc if (!convert_test_block(cxt, block)) continue; ret = block_iterate_proc(block, block, &data); - if (ret & BLOCK_ABORT) { - ret = data.errcode; + if (ret < 0) goto fail; - } } if (data.num_blocks > 0) { ret = record_file_blocks(&data, data.first_block, @@ -1952,10 +1954,8 @@ static int relocate_one_reference(struct ret = block_iterate_proc(new_pos / sectorsize, cur_offset / sectorsize, &data); - if (ret & BLOCK_ABORT) { - ret = data.errcode; + if (ret < 0) goto fail; - } cur_offset += sectorsize; bytenr += sectorsize;
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