Add Btrfs snapshot support for atomic sync and recovery consistency

This commit is contained in:
Andrea Mazzoleni 2026-04-21 15:19:25 +02:00
parent d2c1029017
commit cffd1ca15c
18 changed files with 1094 additions and 39 deletions

View file

@ -1165,6 +1165,25 @@ void pathcut(char* dst)
dst[0] = 0;
}
void pathup(char* dst)
{
size_t len = strlen(dst);
if (len == 0)
return;
/* if ending with slash, remove it */
if (dst[len - 1] == '/')
--len;
/* search previous / */
while (len > 0 && dst[len - 1] != '/')
--len;
/* cut everything after the slash (if there are no more slash, return the empty string) */
dst[len] = 0;
}
int pathcmp(const char* a, const char* b)
{
#ifdef _WIN32