summaryrefslogtreecommitdiffstats
path: root/xlators/features/index
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-02-21 11:18:32 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-21 02:36:59 -0800
commit1979cee4716fdb95909654148eebb8b0b973f484 (patch)
treefc9fbaa8d65ad6de7ee6448494621de418ed4273 /xlators/features/index
parent39fb5051ffdf6a978537e8c50f05b7a0135f7075 (diff)
features/index: Add release, releasedir cbks
Change-Id: Ice45a0b4e953e270273aa4155a895d6ec033fda8 BUG: 763820 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/2780 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/features/index')
-rw-r--r--xlators/features/index/src/index.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
index 34b0ec8e77a..636c0f6da02 100644
--- a/xlators/features/index/src/index.c
+++ b/xlators/features/index/src/index.c
@@ -1094,6 +1094,43 @@ index_forget (xlator_t *this, inode_t *inode)
return 0;
}
+int32_t
+index_releasedir (xlator_t *this, fd_t *fd)
+{
+ index_fd_ctx_t *fctx = NULL;
+ uint64_t ctx = 0;
+ int ret = 0;
+
+ ret = fd_ctx_del (fd, this, &ctx);
+ if (ret < 0)
+ goto out;
+
+ fctx = (index_fd_ctx_t*) (long) ctx;
+ if (fctx->dir)
+ closedir (fctx->dir);
+
+ GF_FREE (fctx);
+out:
+ return 0;
+}
+
+int32_t
+index_release (xlator_t *this, fd_t *fd)
+{
+ index_fd_ctx_t *fctx = NULL;
+ uint64_t ctx = 0;
+ int ret = 0;
+
+ ret = fd_ctx_del (fd, this, &ctx);
+ if (ret < 0)
+ goto out;
+
+ fctx = (index_fd_ctx_t*) (long) ctx;
+ GF_FREE (fctx);
+out:
+ return 0;
+}
+
int
notify (xlator_t *this, int event, void *data, ...)
{
@@ -1117,7 +1154,9 @@ struct xlator_dumpops dumpops = {
};
struct xlator_cbks cbks = {
- .forget = index_forget,
+ .forget = index_forget,
+ .release = index_release,
+ .releasedir = index_releasedir
};
struct volume_options options[] = {