Vladimir Sementsov-Ogievskiy | d003e0a | 2021-08-24 11:38:27 +0300 | [diff] [blame] | 1 | /* |
| 2 | * copy-before-write filter driver |
| 3 | * |
| 4 | * The driver performs Copy-Before-Write (CBW) operation: it is injected above |
| 5 | * some node, and before each write it copies _old_ data to the target node. |
| 6 | * |
| 7 | * Copyright (c) 2018-2021 Virtuozzo International GmbH. |
| 8 | * |
| 9 | * Author: |
| 10 | * Sementsov-Ogievskiy Vladimir <vsementsov@virtuozzo.com> |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation; either version 2 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | */ |
| 25 | |
| 26 | #ifndef COPY_BEFORE_WRITE_H |
| 27 | #define COPY_BEFORE_WRITE_H |
| 28 | |
| 29 | #include "block/block_int.h" |
| 30 | #include "block/block-copy.h" |
| 31 | |
Emanuele Giuseppe Esposito | 377cc15 | 2022-03-03 10:16:08 -0500 | [diff] [blame] | 32 | /* |
| 33 | * Global state (GS) API. These functions run under the BQL. |
| 34 | * |
| 35 | * See include/block/block-global-state.h for more information about |
| 36 | * the GS API. |
| 37 | */ |
| 38 | |
Vladimir Sementsov-Ogievskiy | d003e0a | 2021-08-24 11:38:27 +0300 | [diff] [blame] | 39 | BlockDriverState *bdrv_cbw_append(BlockDriverState *source, |
| 40 | BlockDriverState *target, |
| 41 | const char *filter_node_name, |
Vladimir Sementsov-Ogievskiy | 0fd05c8 | 2024-03-13 18:28:21 +0300 | [diff] [blame] | 42 | bool discard_source, |
Fiona Ebner | 6252deb | 2024-07-11 14:09:15 +0200 | [diff] [blame] | 43 | uint64_t min_cluster_size, |
Vladimir Sementsov-Ogievskiy | d003e0a | 2021-08-24 11:38:27 +0300 | [diff] [blame] | 44 | BlockCopyState **bcs, |
| 45 | Error **errp); |
| 46 | void bdrv_cbw_drop(BlockDriverState *bs); |
| 47 | |
| 48 | #endif /* COPY_BEFORE_WRITE_H */ |