summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/common.c
diff options
context:
space:
mode:
authorPavan Vilas Sondur <pavan@gluster.com>2009-12-03 14:51:11 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-03 12:45:14 -0800
commit26257254fb42c132ff2e0565655fdc382184d8af (patch)
tree0eff913f81c9596624f4d656dbd20fdcd95fef13 /xlators/features/locks/src/common.c
parent120b446967ef33701a31d0da23324177922a3d73 (diff)
features/locks: Release all locks of an fd when a client disconnects.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 336 (Use lock owner field from fuse in locks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=336
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r--xlators/features/locks/src/common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 58b95d20781..5c83f366ee8 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -425,7 +425,8 @@ out:
/* Create a new posix_lock_t */
posix_lock_t *
-new_posix_lock (struct flock *flock, transport_t *transport, pid_t client_pid, uint64_t owner)
+new_posix_lock (struct flock *flock, transport_t *transport, pid_t client_pid,
+ uint64_t owner, fd_t *fd)
{
posix_lock_t *lock = NULL;
@@ -443,6 +444,7 @@ new_posix_lock (struct flock *flock, transport_t *transport, pid_t client_pid, u
lock->fl_end = flock->l_start + flock->l_len - 1;
lock->transport = transport;
+ lock->fd = fd;
lock->client_pid = client_pid;
lock->owner = owner;
@@ -686,6 +688,7 @@ __insert_and_merge (pl_inode_t *pl_inode, posix_lock_t *lock)
sum->fl_type = lock->fl_type;
sum->transport = lock->transport;
+ sum->fd = lock->fd;
sum->client_pid = lock->client_pid;
sum->owner = lock->owner;
@@ -701,6 +704,7 @@ __insert_and_merge (pl_inode_t *pl_inode, posix_lock_t *lock)
sum->fl_type = conf->fl_type;
sum->transport = conf->transport;
+ sum->fd = conf->fd;
sum->client_pid = conf->client_pid;
sum->owner = conf->owner;