objectstore: store object data within subfolder

Instead of storing the (tree) data directly at the root of the
object specific directory, move it into a `data/tree` subfolder.
This prepares for two things:
1) the `tree` folder will allow us to add another folder next to
   it to store metadata.
2) storing both, `tree` and the future metadata folder in a
   common subfolder, prepares for the future integration
   with the new caching layer (`FsCache`).
This commit is contained in:
Christian Kellner 2022-11-23 23:56:09 +01:00
parent f04ea2bab2
commit 917c5bb2f5
2 changed files with 10 additions and 8 deletions

View file

@ -20,7 +20,7 @@ def store_path(store: objectstore.ObjectStore, ref: str, path: str) -> bool:
obj = store.resolve_ref(ref)
if not obj or not os.path.exists(obj):
return False
return os.path.exists(os.path.join(obj, path))
return os.path.exists(os.path.join(obj, "data", "tree", path))
@unittest.skipUnless(test.TestBase.can_bind_mount(), "root-only")