| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
|
| 6 |
/* create_ephemeral_snapshot - create a snapshot of the given directory. |
| 7 |
* |
| 8 |
* It will use a btrfs snapshot when available with fallback to traditional dir copy. It will set the global |
| 9 |
* and local lock files based on the passed runtime scope. On success the new directory path is returned via |
| 10 |
* `ret_new_path`. |
| 11 |
* |
| 12 |
* The caller is responsible for the cleanup of the directory, using `_cleanup_(rm_rf_subvolume_and_freep)` |
| 13 |
* is recommended. |
| 14 |
*/ |
| 15 |
int create_ephemeral_snapshot( |
| 16 |
const char *directory, |
| 17 |
RuntimeScope scope, |
| 18 |
bool read_only, |
| 19 |
LockFile *tree_global_lock, |
| 20 |
LockFile *tree_local_lock, |
| 21 |
char **ret_new_path); |