From 106f0e848a6ae3a04ee9d1c1752badf60767d039 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 10 Jul 2009 13:39:10 +0000 Subject: cleanup 'ctx' from inode and fd Removing unused 'dict_t *ctx' from both inode and fd structures. Signed-off-by: Anand V. Avati BUG: 128 (cleanup unwanted ctx dictionary in 'inode' and 'fd' structures.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=128 --- libglusterfs/src/fd.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'libglusterfs/src/fd.c') diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c index a5a63ebaadd..8f7616929c2 100644 --- a/libglusterfs/src/fd.c +++ b/libglusterfs/src/fd.c @@ -382,7 +382,6 @@ _fd_unref (fd_t *fd) static void fd_destroy (fd_t *fd) { - data_pair_t *pair = NULL; xlator_t *xl = NULL; int i = 0; @@ -399,26 +398,6 @@ fd_destroy (fd_t *fd) goto out; if (S_ISDIR (fd->inode->st_mode)) { - for (pair = fd->ctx->members_list; pair; pair = pair->next) { - /* notify all xlators which have a context */ - xl = xlator_search_by_name (fd->inode->table->xl, - pair->key); - - if (!xl) { - gf_log ("fd", GF_LOG_CRITICAL, - "fd(%p)->ctx has invalid key(%s)", - fd, pair->key); - continue; - } - if (xl->cbks->releasedir) { - xl->cbks->releasedir (xl, fd); - } else { - gf_log ("fd", GF_LOG_CRITICAL, - "xlator(%s) in fd(%p) no RELEASE cbk", - xl->name, fd); - } - - } for (i = 0; i < fd->inode->table->xl->ctx->xl_count; i++) { if (fd->_ctx[i].key) { xl = (xlator_t *)(long)fd->_ctx[i].key; @@ -427,25 +406,6 @@ fd_destroy (fd_t *fd) } } } else { - for (pair = fd->ctx->members_list; pair; pair = pair->next) { - /* notify all xlators which have a context */ - xl = xlator_search_by_name (fd->inode->table->xl, - pair->key); - - if (!xl) { - gf_log ("fd", GF_LOG_CRITICAL, - "fd(%p)->ctx has invalid key(%s)", - fd, pair->key); - continue; - } - if (xl->cbks->release) { - xl->cbks->release (xl, fd); - } else { - gf_log ("fd", GF_LOG_CRITICAL, - "xlator(%s) in fd(%p) no RELEASE cbk", - xl->name, fd); - } - } for (i = 0; i < fd->inode->table->xl->ctx->xl_count; i++) { if (fd->_ctx[i].key) { xl = (xlator_t *)(long)fd->_ctx[i].key; @@ -460,7 +420,6 @@ fd_destroy (fd_t *fd) FREE (fd->_ctx); inode_unref (fd->inode); fd->inode = (inode_t *)0xaaaaaaaa; - dict_destroy (fd->ctx); FREE (fd); out: @@ -525,7 +484,6 @@ fd_create (inode_t *inode, pid_t pid) fd->_ctx = CALLOC (1, (sizeof (struct _fd_ctx) * inode->table->xl->ctx->xl_count)); - fd->ctx = get_new_dict (); fd->inode = inode_ref (inode); fd->pid = pid; INIT_LIST_HEAD (&fd->inode_list); -- cgit