From 26257254fb42c132ff2e0565655fdc382184d8af Mon Sep 17 00:00:00 2001 From: Pavan Vilas Sondur Date: Thu, 3 Dec 2009 14:51:11 +0000 Subject: features/locks: Release all locks of an fd when a client disconnects. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Anand V. Avati BUG: 336 (Use lock owner field from fuse in locks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=336 --- xlators/features/locks/src/common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xlators/features/locks/src/common.c') diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index 58b95d207..5c83f366e 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; -- cgit