From 727c933a62e6b436c0aabcf80b6cd67620ee5429 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 23 Aug 2009 22:37:02 +0000 Subject: performance/stat-prefetch: implement release callbacks. Signed-off-by: Anand V. Avati BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221 --- .../performance/stat-prefetch/src/stat-prefetch.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 6bbedf08c0e..4a25c8e45db 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1756,6 +1756,24 @@ sp_forget (xlator_t *this, inode_t *inode) } +int32_t +sp_release (xlator_t *this, fd_t *fd) +{ + sp_fd_ctx_t *fd_ctx = NULL; + uint64_t value = 0; + int32_t ret = 0; + + ret = fd_ctx_del (fd, this, &value); + if (!ret) { + fd_ctx = (void *)(long) value; + sp_fd_ctx_free (fd_ctx); + } + + return 0; +} + + + int32_t init (xlator_t *this) { @@ -1817,5 +1835,7 @@ struct xlator_mops mops = { }; struct xlator_cbks cbks = { - .forget = sp_forget, + .forget = sp_forget, + .release = sp_release, + .releasedir = sp_release }; -- cgit