summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs.c
diff options
context:
space:
mode:
authorshishir <shishirng@gluster.com>2011-07-26 12:56:54 +0530
committerAnand Avati <avati@gluster.com>2011-07-28 02:59:32 -0700
commitcf4501899ca75a6641a31cf7116d439dfb6dd4de (patch)
treece4b00c3719d66165bdc98f6558582485c5bb464 /xlators/nfs/server/src/nfs.c
parentfa979753d9fe27c6338a0d384d0f183ea716003d (diff)
NFS: Implement nfs_forget call
Make sure the inode_ctx is deleted nfs_release is not needed, as __nfs3_fdcache_remove_entry cleans up the ctx Change-Id: I690efa1eb1d4cd39cee258bb29692cc58ab9c380 BUG: 3250 Reviewed-on: http://review.gluster.com/103 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shehjar Tikoo <shehjart@gluster.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs.c')
-rw-r--r--xlators/nfs/server/src/nfs.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 2bc20d04e34..b4568f519cf 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -39,6 +39,7 @@
#include "mount3.h"
#include "nfs3.h"
#include "nfs-mem-types.h"
+#include "nfs3-helpers.h"
/* Every NFS version must call this function with the init function
* for its particular version.
@@ -728,7 +729,32 @@ fini (xlator_t *this)
return 0;
}
-struct xlator_cbks cbks = { };
+int32_t
+nfs_forget (xlator_t *this, inode_t *inode)
+{
+ int32_t ret = -1;
+ uint64_t ctx = 0;
+ struct inode_op_queue *inode_q = NULL;
+
+ if (!inode || !this)
+ return 0;
+ ret = inode_ctx_del (inode, this, &ctx);
+ if (!ret && ctx && !(IA_ISDIR (inode->ia_type))) {
+ inode_q = (struct inode_op_queue *) (long) ctx;
+ pthread_mutex_lock (&inode_q->qlock);
+ {
+ nfs3_flush_inode_queue (inode_q, NULL, 0);
+ }
+ pthread_mutex_unlock (&inode_q->qlock);
+ }
+
+ return 0;
+}
+
+struct xlator_cbks cbks = {
+ .forget = nfs_forget,
+};
+
struct xlator_fops fops = { };
/* TODO: If needed, per-volume options below can be extended to be export