summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs-fops.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-06-15 00:39:26 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-04 22:52:55 -0700
commit43cdbc3756bde8c4c95dd3c3a89c802ec204c847 (patch)
tree742c3993f1dbe7df1ca59913b9f137aea20621d5 /xlators/nfs/server/src/nfs-fops.c
parenta8ef67630c48dfec336cc2088ac78cb29074022c (diff)
nfs: Assign incremental lk owner to frames
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 960 (Disk space leakage and fs corruption after VMs are vmotion'ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=960
Diffstat (limited to 'xlators/nfs/server/src/nfs-fops.c')
-rw-r--r--xlators/nfs/server/src/nfs-fops.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs-fops.c b/xlators/nfs/server/src/nfs-fops.c
index e7505b5dcdd..512ece90ff8 100644
--- a/xlators/nfs/server/src/nfs-fops.c
+++ b/xlators/nfs/server/src/nfs-fops.c
@@ -83,6 +83,28 @@ nfs_fop_local_wipe (xlator_t *nfsx, struct nfs_fop_local *l)
return;
}
+pthread_mutex_t ctr = PTHREAD_MUTEX_INITIALIZER;
+unsigned int cval = 1;
+
+
+int
+nfs_frame_getctr ()
+{
+ int val = 0;
+
+ pthread_mutex_lock (&ctr);
+ {
+ if (cval == 0)
+ cval = 1;
+ val = cval;
+ cval++;
+ }
+ pthread_mutex_unlock (&ctr);
+
+ return val;
+}
+
+
call_frame_t *
nfs_create_frame (xlator_t *xl, nfs_user_t *nfu)
{
@@ -109,6 +131,7 @@ nfs_create_frame (xlator_t *xl, nfs_user_t *nfu)
gf_log (GF_NFS, GF_LOG_TRACE, "gid: %d", nfu->gids[x]);
frame->root->groups[y] = nfu->gids[x];
}
+ frame->root->lk_owner = nfs_frame_getctr ();
err:
return frame;