[pbs-devel] [RFC proxmox-backup 2/4] datastore: allow to specify sub-directory for index file listing
Christian Ebner
c.ebner at proxmox.com
Fri Apr 18 11:55:03 CEST 2025
On 4/18/25 11:38, Thomas Lamprecht wrote:
> Am 16.04.25 um 16:18 schrieb Christian Ebner:
>> Extend the list_index_files helper to allow passing a sub-directory
>> to it. This will be used to fetch only index files from the `.trash`
>> directory, ignored by regular listing since hidden folders are not
>> considered.
>>
>> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
>> ---
>> pbs-datastore/src/datastore.rs | 13 ++++++++++---
>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
>> index 3fde8b871..97b78f000 100644
>> --- a/pbs-datastore/src/datastore.rs
>> +++ b/pbs-datastore/src/datastore.rs
>> @@ -972,8 +972,15 @@ impl DataStore {
>> /// The filesystem is walked recursevly to detect index files based on their archive type based
>> /// on the filename. This however excludes the chunks folder, hidden files and does not follow
>> /// symlinks.
>> - fn list_index_files(&self) -> Result<HashSet<PathBuf>, Error> {
>> - let base = self.base_path();
>> + /// If a subdirectory is provided, only that is scanned for index files.
>> + fn list_index_files(&self, subdir: Option<PathBuf>) -> Result<HashSet<PathBuf>, Error> {
>
> it might be a tiny bit nicer to add a new list_index_files_from_path
> that shares the implementation with this one here. While it's not pub
> and there is only one use size, it's still minimally nicer to have this
> encoded in the method name, at least when reading the call site and
> wondering what None means here.
Okay, will adapt this accordingly, thanks!
More information about the pbs-devel
mailing list