summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/common.h
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2016-04-22 15:20:39 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-06-03 03:06:31 -0700
commit19b8c09709c7aeecb84eafb02de797a49a004638 (patch)
tree75732b74043843898c6b2c94152a55f5bf6d1b1c /xlators/features/locks/src/common.h
parent03d523504230c336cf585159266e147945f31153 (diff)
posix/lock: implement meta-lock/unlock functionality
problem : The lock state needs to be protected when rebalance is reading the lock state on the source. Otherwise there will be locks left unmigrated. Hence, to synchronize incoming lock requests with lock-migration, meta lock is needed. Any new lock request will be queued if there is an active meta-lock and with sucessful lock migration, will be unwound with EREMOTE, so that dht module can wind the request to the correct destination. On a successful lock migration, "pl_inode->migrated" flag is enabled. Hence, any further request would be unwound with EREMOTE and will be redirected to new destination. More details can be found here: https://github.com/gluster/glusterfs-specs/blob/master/accepted/Lock-Migration.md design discussion: https://www.gluster.org/pipermail/gluster-devel/2016-January/048088.html Change-Id: Ief033d5652b5ca4ba6f499110a521cae283d6aba BUG: 1331720 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/14251 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/common.h')
-rw-r--r--xlators/features/locks/src/common.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h
index 44f5a8484c5..5486f9b8314 100644
--- a/xlators/features/locks/src/common.h
+++ b/xlators/features/locks/src/common.h
@@ -35,7 +35,8 @@
posix_lock_t *
new_posix_lock (struct gf_flock *flock, client_t *client, pid_t client_pid,
- gf_lkowner_t *owner, fd_t *fd, uint32_t lk_flags);
+ gf_lkowner_t *owner, fd_t *fd, uint32_t lk_flags,
+ int can_block);
pl_inode_t *
pl_inode_get (xlator_t *this, inode_t *inode);
@@ -155,4 +156,9 @@ check_entrylk_on_basename (xlator_t *this, inode_t *parent, char *basename);
void __pl_inodelk_unref (pl_inode_lock_t *lock);
void __pl_entrylk_unref (pl_entry_lock_t *lock);
+int
+pl_metalock_is_active (pl_inode_t *pl_inode);
+
+int
+__pl_queue_lock (pl_inode_t *pl_inode, posix_lock_t *reqlock, int can_block);
#endif /* __COMMON_H__ */