MCPcopy
hub / github.com/borgbackup/borg / _create_filesystem

Method _create_filesystem

src/borg/fuse.py:304–324  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

302 self.archive_root_dir = {} # archive ID --> directory name
303
304 def _create_filesystem(self):
305 self._create_dir(parent=1) # first call, create root dir (inode == 1)
306 self.versions_index = FuseVersionsIndex()
307 archives = self._manifest.archives.list_considering(self._args)
308 name_counter = Counter(a.name for a in archives)
309 duplicate_names = {a.name for a in archives if name_counter[a.name] > 1}
310 for archive in archives:
311 name = f"{archive.name}"
312 if name in duplicate_names:
313 name += f"-{bin_to_hex(archive.id):.8}"
314 self.archive_root_dir[archive.id] = name
315 for archive in archives:
316 if self.versions:
317 # process archives immediately
318 self._process_archive(archive.id)
319 else:
320 # lazily load archives, create archive placeholder inode
321 archive_inode = self._create_dir(parent=1, mtime=int(archive.ts.timestamp() * 1e9))
322 name = self.archive_root_dir[archive.id]
323 self.contents[1][os.fsencode(name)] = archive_inode
324 self.pending_archives[archive_inode] = archive
325
326 def get_item(self, inode):
327 item = self._inode_cache.get(inode)

Callers 1

mountMethod · 0.45

Calls 4

_create_dirMethod · 0.95
_process_archiveMethod · 0.95
bin_to_hexFunction · 0.85
list_consideringMethod · 0.80

Tested by

no test coverage detected