use new fsync parameter to replace_file and atomic_open_or_create

Depend on proxmox 0.15.0 and proxmox-openid 0.8.1

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-10-20 14:56:15 +02:00
parent 6b8329ee34
commit e0a19d3313
48 changed files with 73 additions and 57 deletions

View File

@ -345,7 +345,7 @@ fn save_changer_state_cache(
.owner(backup_user.uid)
.group(backup_user.gid);
replace_file(path, state.as_bytes(), options)
replace_file(path, state.as_bytes(), options, false)
}
fn delete_changer_state_cache(changer: &str) {

View File

@ -555,7 +555,7 @@ pub fn set_tape_device_state(
.owner(backup_user.uid)
.group(backup_user.gid);
replace_file(path, state.as_bytes(), options)
replace_file(path, state.as_bytes(), options, false)
}
/// Get the device state
@ -618,6 +618,7 @@ fn open_device_lock(device_path: &str) -> Result<std::fs::File, Error> {
OFlag::O_RDWR | OFlag::O_CLOEXEC | OFlag::O_APPEND,
&[],
options,
false,
)
}

View File

@ -117,7 +117,7 @@ impl VirtualTapeHandle {
let raw = serde_json::to_string_pretty(&serde_json::to_value(index)?)?;
let options = CreateOptions::new();
replace_file(&path, raw.as_bytes(), options)?;
replace_file(&path, raw.as_bytes(), options, false)?;
Ok(())
}
@ -157,7 +157,7 @@ impl VirtualTapeHandle {
let raw = serde_json::to_string_pretty(&serde_json::to_value(status)?)?;
let options = CreateOptions::new();
replace_file(&path, raw.as_bytes(), options)?;
replace_file(&path, raw.as_bytes(), options, false)?;
Ok(())
}

View File

@ -183,7 +183,7 @@ impl Inventory {
.group(backup_user.gid)
};
replace_file(&self.inventory_path, raw.as_bytes(), options)?;
replace_file(&self.inventory_path, raw.as_bytes(), options, true)?;
Ok(())
}

View File

@ -102,6 +102,7 @@ fn write_snapshot_cache(
cache_path,
data.as_bytes(),
options,
false,
)?;
Ok(list)