summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-05-22 15:18:19 +0530
committerVijay Bellur <vbellur@redhat.com>2013-06-20 01:44:37 -0700
commitcc9ca7d2b2f5c91d80265c28ca724cb233c2bd77 (patch)
tree493aad749299fce77fc79860206e0ba1532652c3 /libglusterfs
parentbb1d5e826f6c64092a03bf292e72fb314e2b4a2d (diff)
cluster/afr: Perform delayed changelog wakeups for anon fd
Problem: Nfs xlator never does open on a file for performing writes, afr does not perform changelog wakeup for this fd so operations which do metadata operations as soon as the data operations are completed perceive a delay of 'post-op-delay-secs'. Fix: Perform changelog wakeup on anon-fd if the fd with same pid is not present in inode-list. Note: This approach is a short-term fix. A proper fix needs a new domain for taking metadata locks so that data/metadata locks don't compete with each other. Change-Id: I253afb289eadf30c7951e56fb2c4840d7132f5e4 BUG: 966018 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/5066 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/fd.c17
-rw-r--r--libglusterfs/src/fd.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 2f4afc5e87a..36cc4d0561f 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -780,6 +780,23 @@ fd_anonymous (inode_t *inode)
return fd;
}
+fd_t*
+fd_lookup_anonymous (inode_t *inode)
+{
+ fd_t *fd = NULL;
+
+ if (!inode) {
+ gf_log_callingfn ("fd", GF_LOG_WARNING, "!inode");
+ return NULL;
+ }
+
+ LOCK (&inode->lock);
+ {
+ fd = __fd_lookup_anonymous (inode);
+ }
+ UNLOCK (&inode->lock);
+ return fd;
+}
gf_boolean_t
fd_is_anonymous (fd_t *fd)
diff --git a/libglusterfs/src/fd.h b/libglusterfs/src/fd.h
index 54290b1980b..c1b9157d882 100644
--- a/libglusterfs/src/fd.h
+++ b/libglusterfs/src/fd.h
@@ -134,6 +134,9 @@ fd_lookup (struct _inode *inode, pid_t pid);
fd_t *
fd_lookup_uint64 (struct _inode *inode, uint64_t pid);
+fd_t*
+fd_lookup_anonymous (inode_t *inode);
+
fd_t *
fd_anonymous (inode_t *inode);