salvage: hook delete path through nwsalvage
All checks were successful
Source release / source-package (push) Successful in 55s

This commit is contained in:
ChatGPT
2026-05-31 11:35:17 +00:00
committed by Mario Fetka
parent 5fc5a5218f
commit 3fb45fd624
7 changed files with 1017 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
typedef int (*nwsalvage_ini_getter)(int entry, char *str,
size_t strsize, void *data);
@@ -145,5 +146,14 @@ int nwsalvage_write_metadata(const char *metadata_path,
const struct nwsalvage_deleted_entry *entry);
int nwsalvage_read_metadata(const char *metadata_path,
struct nwsalvage_metadata_entry *entry);
/*
* Capture a server-side delete before nw_unlink_node() would remove it.
* Returns 0 when the file was moved to the recycle repository and metadata
* was written. Returns 1 when salvage is disabled or the node is not
* salvageable and the caller should continue with the normal unlink path.
* Returns -1 on a real salvage failure; the caller should keep the live file.
*/
int nwsalvage_capture_node_delete(int volume, const char *unixname,
const struct stat *stb);
#endif