diff options
author | Anand Avati <avati@gluster.com> | 2010-06-07 12:37:34 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-06-07 11:58:50 -0700 |
commit | 79241696fbdebe2583298f12cbaee068ce60c655 (patch) | |
tree | 42e60d351e328fa34f17242c6c3359a8c01e8fa3 /libglusterfs/src/inode.c | |
parent | c4ebd25a176d6d51d702b1009e261c3c27237a48 (diff) |
dynamic volume changes for graph replacement
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 971 (dynamic volume management)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
Diffstat (limited to 'libglusterfs/src/inode.c')
-rw-r--r-- | libglusterfs/src/inode.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 622857c1ab0..c5784595426 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -281,7 +281,7 @@ __inode_destroy (inode_t *inode) if (!inode->_ctx) goto noctx; - for (index = 0; index < inode->table->xl->ctx->xl_count; index++) { + for (index = 0; index < inode->table->xl->graph->xl_count; index++) { if (inode->_ctx[index].key) { xl = (xlator_t *)(long)inode->_ctx[index].key; old_THIS = THIS; @@ -474,8 +474,9 @@ __inode_create (inode_table_t *table) INIT_LIST_HEAD (&newi->dentry_list); newi->_ctx = GF_CALLOC (1, (sizeof (struct _inode_ctx) * - table->xl->ctx->xl_count), + table->xl->graph->xl_count), gf_common_mt_inode_ctx); + if (newi->_ctx == NULL) { gf_log ("inode", GF_LOG_ERROR, "out of memory"); LOCK_DESTROY (&newi->lock); @@ -1173,7 +1174,7 @@ __inode_ctx_put2 (inode_t *inode, xlator_t *xlator, uint64_t value1, int index = 0; int put_idx = -1; - for (index = 0; index < xlator->ctx->xl_count; index++) { + for (index = 0; index < xlator->graph->xl_count; index++) { if (!inode->_ctx[index].key) { if (put_idx == -1) put_idx = index; @@ -1225,12 +1226,12 @@ __inode_ctx_get2 (inode_t *inode, xlator_t *xlator, uint64_t *value1, int index = 0; int ret = 0; - for (index = 0; index < xlator->ctx->xl_count; index++) { + for (index = 0; index < xlator->graph->xl_count; index++) { if (inode->_ctx[index].xl_key == xlator) break; } - if (index == xlator->ctx->xl_count) { + if (index == xlator->graph->xl_count) { ret = -1; goto out; } @@ -1277,12 +1278,12 @@ inode_ctx_del2 (inode_t *inode, xlator_t *xlator, uint64_t *value1, LOCK (&inode->lock); { - for (index = 0; index < xlator->ctx->xl_count; index++) { + for (index = 0; index < xlator->graph->xl_count; index++) { if (inode->_ctx[index].xl_key == xlator) break; } - if (index == xlator->ctx->xl_count) { + if (index == xlator->graph->xl_count) { ret = -1; goto unlock; } @@ -1371,7 +1372,7 @@ inode_dump (inode_t *inode, char *prefix) if (!inode->_ctx) goto out; - for (i = 0; i < inode->table->xl->ctx->xl_count; i++) { + for (i = 0; i < inode->table->xl->graph->xl_count; i++) { if (inode->_ctx[i].key) { xl = (xlator_t *)(long)inode->_ctx[i].key; if (xl->dumpops && xl->dumpops->inodectx) |