Mercurial > nomad > old-fuse
changeset 95:17a1cd072c43
objstore: implement getroot wrapper
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sat, 17 Oct 2015 11:32:45 -0400 |
parents | 1235adf7e449 |
children | e76e3ee73fb5 |
files | src/objstore/include/nomad/objstore.h src/objstore/objstore.c |
diffstat | 2 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/objstore/include/nomad/objstore.h Sat Oct 17 10:39:07 2015 -0400 +++ b/src/objstore/include/nomad/objstore.h Sat Oct 17 11:32:45 2015 -0400 @@ -47,4 +47,7 @@ enum objstore_mode mode); extern struct objstore *objstore_store_load(struct nuuid *uuid, const char *path); +/* store operations */ +extern int objstore_getroot(struct objstore *store, struct nobjhndl *hndl); + #endif
--- a/src/objstore/objstore.c Sat Oct 17 10:39:07 2015 -0400 +++ b/src/objstore/objstore.c Sat Oct 17 11:32:45 2015 -0400 @@ -112,3 +112,14 @@ { return ERR_PTR(ENOTSUP); } + +int objstore_getroot(struct objstore *store, struct nobjhndl *hndl) +{ + if (!hndl) + return EINVAL; + + if (!store || !store->def->store_ops || !store->def->store_ops->getroot) + return EINVAL; + + return store->def->store_ops->getroot(store, hndl); +}