io.c (1e97be915697fff198e9922321066cf9b44ef4b9) io.c (c057960c4e33becb22d4741156203a4b0d4a3088)
1/*
2 * Block layer I/O functions
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 3460 unchanged lines hidden (view full) ---

3469 error_setg(errp, "Image format driver does not support resize");
3470 ret = -ENOTSUP;
3471 goto out;
3472 }
3473 if (ret < 0) {
3474 goto out;
3475 }
3476
1/*
2 * Block layer I/O functions
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 3460 unchanged lines hidden (view full) ---

3469 error_setg(errp, "Image format driver does not support resize");
3470 ret = -ENOTSUP;
3471 goto out;
3472 }
3473 if (ret < 0) {
3474 goto out;
3475 }
3476
3477 ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);
3477 ret = bdrv_refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);
3478 if (ret < 0) {
3479 error_setg_errno(errp, -ret, "Could not refresh total sector count");
3480 } else {
3481 offset = bs->total_sectors * BDRV_SECTOR_SIZE;
3482 }
3478 if (ret < 0) {
3479 error_setg_errno(errp, -ret, "Could not refresh total sector count");
3480 } else {
3481 offset = bs->total_sectors * BDRV_SECTOR_SIZE;
3482 }
3483 /* It's possible that truncation succeeded but refresh_total_sectors
3483 /*
3484 * It's possible that truncation succeeded but bdrv_refresh_total_sectors
3484 * failed, but the latter doesn't affect how we should finish the request.
3485 * failed, but the latter doesn't affect how we should finish the request.
3485 * Pass 0 as the last parameter so that dirty bitmaps etc. are handled. */
3486 * Pass 0 as the last parameter so that dirty bitmaps etc. are handled.
3487 */
3486 bdrv_co_write_req_finish(child, offset - new_bytes, new_bytes, &req, 0);
3487
3488out:
3489 tracked_request_end(&req);
3490 bdrv_dec_in_flight(bs);
3491
3492 return ret;
3493}

--- 84 unchanged lines hidden ---
3488 bdrv_co_write_req_finish(child, offset - new_bytes, new_bytes, &req, 0);
3489
3490out:
3491 tracked_request_end(&req);
3492 bdrv_dec_in_flight(bs);
3493
3494 return ret;
3495}

--- 84 unchanged lines hidden ---