Mercurial > nomad > old-fuse
changeset 81:3a22f0c7b3f6
the "object handle" should be a common concept
We are going to be using the concept of an object handle all over the place
- not just deep within the object store code.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Fri, 16 Oct 2015 22:04:17 -0400 |
parents | 28d23cea9a1c |
children | 871edff2615a |
files | src/common/include/nomad/types.h src/objstore/include/nomad/objstore_impl.h src/objstore/mem/main.c |
diffstat | 3 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/common/include/nomad/types.h Fri Oct 16 21:52:34 2015 -0400 +++ b/src/common/include/nomad/types.h Fri Oct 16 22:04:17 2015 -0400 @@ -41,6 +41,12 @@ uint64_t uniq; /* dataset-local id */ }; +/* object handle: a specific version of an object */ +struct nobjhndl { + struct noid oid; + struct nvclock *clock; +}; + /* uuid */ struct nuuid { uint8_t raw[16];
--- a/src/objstore/include/nomad/objstore_impl.h Fri Oct 16 21:52:34 2015 -0400 +++ b/src/objstore/include/nomad/objstore_impl.h Fri Oct 16 22:04:17 2015 -0400 @@ -25,15 +25,10 @@ #include <nomad/objstore.h> -struct objhndl { - struct noid noid; - struct nvclock *clock; -}; - struct objstore_ops { int (*create)(struct objstore *store); int (*load)(struct objstore *store); - int (*getroot)(struct objstore *store, struct objhndl *hndl); + int (*getroot)(struct objstore *store, struct nobjhndl *hndl); }; struct obj_ops {
--- a/src/objstore/mem/main.c Fri Oct 16 21:52:34 2015 -0400 +++ b/src/objstore/mem/main.c Fri Oct 16 22:04:17 2015 -0400 @@ -135,7 +135,7 @@ return 0; } -static int mem_store_getroot(struct objstore *store, struct objhndl *hndl) +static int mem_store_getroot(struct objstore *store, struct nobjhndl *hndl) { struct memstore *ms; @@ -144,7 +144,7 @@ ms = store->private; - hndl->noid = ms->root->oid; + hndl->oid = ms->root->oid; hndl->clock = nvclock_dup(ms->root->ver); if (!hndl->clock)