From 11ddca1cd151479243fe23e579b76c5984f422c3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 18 Oct 2009 14:05:40 +0000 Subject: 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 BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315 --- libglusterfs/src/inode.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'libglusterfs/src/inode.h') diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index d1486ca31..520df7dbc 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 */ -- cgit