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