diff options
author | Amar Tumballi <amar@gluster.com> | 2009-10-18 14:05:40 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-18 12:39:13 -0700 |
commit | 11ddca1cd151479243fe23e579b76c5984f422c3 (patch) | |
tree | 04d7f60b390c44aafdf45be84673ade0826b0a82 /libglusterfs/src/inode.h | |
parent | 3d09fb99093a84a303edc443b68bdf9eb10096b4 (diff) |
inode_ctx_{get,put,del}2 API support
support for storing multiple values for a key in inode context - used for storing
inode and generation number pairs on the server in protocol/client inode ctx
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 315 (generation number support)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'libglusterfs/src/inode.h')
-rw-r--r-- | libglusterfs/src/inode.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index d1486ca3165..520df7dbcbe 100644 --- a/libglusterfs/src/inode.h +++ b/libglusterfs/src/inode.h @@ -73,11 +73,19 @@ struct _dentry { inode_t *parent; /* directory of the entry */ }; -//#define ZR_INODE_CTX_VALUE_LEN 2 struct _inode_ctx { - uint64_t key; - uint64_t value; - //uint64_t value[ZR_INODE_CTX_VALUE_LEN]; + union { + uint64_t key; + xlator_t *xl_key; + }; + union { + uint64_t value1; + void *ptr1; + }; + union { + uint64_t value2; + void *ptr2; + }; }; struct _inode { @@ -155,7 +163,7 @@ __inode_ctx_put (inode_t *inode, xlator_t *xlator, uint64_t value); int inode_ctx_put (inode_t *inode, xlator_t *xlator, uint64_t value); -int +int __inode_ctx_get (inode_t *inode, xlator_t *xlator, uint64_t *value); int @@ -164,4 +172,16 @@ inode_ctx_get (inode_t *inode, xlator_t *xlator, uint64_t *value); int inode_ctx_del (inode_t *inode, xlator_t *xlator, uint64_t *value); +int +inode_ctx_put2 (inode_t *inode, xlator_t *xlator, uint64_t value1, + uint64_t value2); + +int +inode_ctx_get2 (inode_t *inode, xlator_t *xlator, uint64_t *value1, + uint64_t *value2); + +int +inode_ctx_del2 (inode_t *inode, xlator_t *xlator, uint64_t *value1, + uint64_t *value2); + #endif /* _INODE_H */ |