|
|
cb8e9e |
From 56092f9ab16a7606e549e0aba84a78ed6de0d397 Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Krutika Dhananjay <kdhananj@redhat.com>
|
|
|
cb8e9e |
Date: Wed, 24 Jun 2015 08:02:51 +0530
|
|
|
cb8e9e |
Subject: [PATCH 140/190] cluster/afr: Pick gfid from poststat during fresh lookup for read child calculation
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Backport of: http://review.gluster.org/11373
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: I669f7c7d02e1dbd276f3d4c9c7bd8c575517e1b7
|
|
|
cb8e9e |
BUG: 1223757
|
|
|
cb8e9e |
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/51654
|
|
|
cb8e9e |
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
cb8e9e |
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
libglusterfs/src/inode.c | 22 +++++++++
|
|
|
cb8e9e |
libglusterfs/src/inode.h | 3 +
|
|
|
cb8e9e |
xlators/cluster/afr/src/afr-common.c | 68 +++++++++++++++++-----------
|
|
|
cb8e9e |
xlators/cluster/afr/src/afr-dir-read.c | 7 +++-
|
|
|
cb8e9e |
xlators/cluster/afr/src/afr-dir-write.c | 6 +-
|
|
|
cb8e9e |
xlators/cluster/afr/src/afr-inode-write.c | 5 +-
|
|
|
cb8e9e |
xlators/cluster/afr/src/afr-read-txn.c | 4 +-
|
|
|
cb8e9e |
xlators/cluster/afr/src/afr.h | 19 ++++++---
|
|
|
cb8e9e |
8 files changed, 93 insertions(+), 41 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
|
|
|
cb8e9e |
index 7c54865..7d3215e 100644
|
|
|
cb8e9e |
--- a/libglusterfs/src/inode.c
|
|
|
cb8e9e |
+++ b/libglusterfs/src/inode.c
|
|
|
cb8e9e |
@@ -2126,6 +2126,28 @@ inode_ctx_reset0 (inode_t *inode, xlator_t *xlator, uint64_t *value1_p)
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+int
|
|
|
cb8e9e |
+inode_is_linked (inode_t *inode)
|
|
|
cb8e9e |
+{
|
|
|
cb8e9e |
+ int ret = 0;
|
|
|
cb8e9e |
+ inode_table_t *table = NULL;
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ if (!inode) {
|
|
|
cb8e9e |
+ gf_log_callingfn (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ "inode not found");
|
|
|
cb8e9e |
+ return 0;
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ table = inode->table;
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ pthread_mutex_lock (&table->lock);
|
|
|
cb8e9e |
+ {
|
|
|
cb8e9e |
+ ret = __is_inode_hashed (inode);
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
+ pthread_mutex_unlock (&table->lock);
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ return ret;
|
|
|
cb8e9e |
+}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
void
|
|
|
cb8e9e |
inode_dump (inode_t *inode, char *prefix)
|
|
|
cb8e9e |
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h
|
|
|
cb8e9e |
index 5081559..474dc39 100644
|
|
|
cb8e9e |
--- a/libglusterfs/src/inode.h
|
|
|
cb8e9e |
+++ b/libglusterfs/src/inode.h
|
|
|
cb8e9e |
@@ -269,4 +269,7 @@ inode_table_set_lru_limit (inode_table_t *table, uint32_t lru_limit);
|
|
|
cb8e9e |
void
|
|
|
cb8e9e |
inode_ctx_merge (fd_t *fd, inode_t *inode, inode_t *linked_inode);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+int
|
|
|
cb8e9e |
+inode_is_linked (inode_t *inode);
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
#endif /* _INODE_H */
|
|
|
cb8e9e |
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
|
|
|
cb8e9e |
index 410d31d..7150f0f 100644
|
|
|
cb8e9e |
--- a/xlators/cluster/afr/src/afr-common.c
|
|
|
cb8e9e |
+++ b/xlators/cluster/afr/src/afr-common.c
|
|
|
cb8e9e |
@@ -987,7 +987,7 @@ out:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
-afr_hash_child (inode_t *inode, int32_t child_count, int hashmode)
|
|
|
cb8e9e |
+afr_hash_child (afr_read_subvol_args_t *args, int32_t child_count, int hashmode)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
uuid_t gfid_copy = {0,};
|
|
|
cb8e9e |
pid_t pid;
|
|
|
cb8e9e |
@@ -996,11 +996,9 @@ afr_hash_child (inode_t *inode, int32_t child_count, int hashmode)
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- if (inode) {
|
|
|
cb8e9e |
- gf_uuid_copy (gfid_copy, inode->gfid);
|
|
|
cb8e9e |
- }
|
|
|
cb8e9e |
+ gf_uuid_copy (gfid_copy, args->gfid);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- if (hashmode > 1 && inode->ia_type != IA_IFDIR) {
|
|
|
cb8e9e |
+ if ((hashmode > 1) && (args->ia_type != IA_IFDIR)) {
|
|
|
cb8e9e |
/*
|
|
|
cb8e9e |
* Why getpid? Because it's one of the cheapest calls
|
|
|
cb8e9e |
* available - faster than gethostname etc. - and returns a
|
|
|
cb8e9e |
@@ -1021,32 +1019,41 @@ afr_hash_child (inode_t *inode, int32_t child_count, int hashmode)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
afr_read_subvol_select_by_policy (inode_t *inode, xlator_t *this,
|
|
|
cb8e9e |
- unsigned char *readable)
|
|
|
cb8e9e |
+ unsigned char *readable,
|
|
|
cb8e9e |
+ afr_read_subvol_args_t *args)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
- afr_private_t *priv = NULL;
|
|
|
cb8e9e |
- int read_subvol = -1;
|
|
|
cb8e9e |
- int i = 0;
|
|
|
cb8e9e |
+ int i = 0;
|
|
|
cb8e9e |
+ int read_subvol = -1;
|
|
|
cb8e9e |
+ afr_private_t *priv = NULL;
|
|
|
cb8e9e |
+ afr_read_subvol_args_t local_args = {0,};
|
|
|
cb8e9e |
|
|
|
cb8e9e |
priv = this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* first preference - explicitly specified or local subvolume */
|
|
|
cb8e9e |
if (priv->read_child >= 0 && readable[priv->read_child])
|
|
|
cb8e9e |
- return priv->read_child;
|
|
|
cb8e9e |
+ return priv->read_child;
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ if (inode_is_linked (inode)) {
|
|
|
cb8e9e |
+ gf_uuid_copy (local_args.gfid, inode->gfid);
|
|
|
cb8e9e |
+ local_args.ia_type = inode->ia_type;
|
|
|
cb8e9e |
+ } else if (args) {
|
|
|
cb8e9e |
+ local_args = *args;
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* second preference - use hashed mode */
|
|
|
cb8e9e |
- read_subvol = afr_hash_child (inode, priv->child_count,
|
|
|
cb8e9e |
- priv->hash_mode);
|
|
|
cb8e9e |
+ read_subvol = afr_hash_child (&local_args, priv->child_count,
|
|
|
cb8e9e |
+ priv->hash_mode);
|
|
|
cb8e9e |
if (read_subvol >= 0 && readable[read_subvol])
|
|
|
cb8e9e |
- return read_subvol;
|
|
|
cb8e9e |
+ return read_subvol;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
for (i = 0; i < priv->child_count; i++) {
|
|
|
cb8e9e |
- if (readable[i])
|
|
|
cb8e9e |
- return i;
|
|
|
cb8e9e |
+ if (readable[i])
|
|
|
cb8e9e |
+ return i;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- /* no readable subvolumes, either split brain or all subvols down */
|
|
|
cb8e9e |
+ /* no readable subvolumes, either split brain or all subvols down */
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- return -1;
|
|
|
cb8e9e |
+ return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1069,7 +1076,8 @@ afr_inode_read_subvol_type_get (inode_t *inode, xlator_t *this,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
afr_read_subvol_get (inode_t *inode, xlator_t *this, int *subvol_p,
|
|
|
cb8e9e |
- int *event_p, afr_transaction_type type)
|
|
|
cb8e9e |
+ int *event_p, afr_transaction_type type,
|
|
|
cb8e9e |
+ afr_read_subvol_args_t *args)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
afr_private_t *priv = NULL;
|
|
|
cb8e9e |
unsigned char *data_readable = NULL;
|
|
|
cb8e9e |
@@ -1096,10 +1104,10 @@ afr_read_subvol_get (inode_t *inode, xlator_t *this, int *subvol_p,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (AFR_COUNT (intersection, priv->child_count) > 0)
|
|
|
cb8e9e |
subvol = afr_read_subvol_select_by_policy (inode, this,
|
|
|
cb8e9e |
- intersection);
|
|
|
cb8e9e |
+ intersection, args);
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
subvol = afr_read_subvol_select_by_policy (inode, this,
|
|
|
cb8e9e |
- readable);
|
|
|
cb8e9e |
+ readable, args);
|
|
|
cb8e9e |
if (subvol_p)
|
|
|
cb8e9e |
*subvol_p = subvol;
|
|
|
cb8e9e |
if (event_p)
|
|
|
cb8e9e |
@@ -1413,7 +1421,8 @@ afr_get_parent_read_subvol (xlator_t *this, inode_t *parent,
|
|
|
cb8e9e |
priv = this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (parent)
|
|
|
cb8e9e |
- par_read_subvol = afr_data_subvol_get (parent, this, 0, 0);
|
|
|
cb8e9e |
+ par_read_subvol = afr_data_subvol_get (parent, this, 0, 0,
|
|
|
cb8e9e |
+ NULL);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
for (i = 0; i < priv->child_count; i++) {
|
|
|
cb8e9e |
if (!replies[i].valid)
|
|
|
cb8e9e |
@@ -1462,6 +1471,8 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
gf_boolean_t can_interpret = _gf_true;
|
|
|
cb8e9e |
inode_t *parent = NULL;
|
|
|
cb8e9e |
int spb_choice = -1;
|
|
|
cb8e9e |
+ ia_type_t ia_type = IA_INVAL;
|
|
|
cb8e9e |
+ afr_read_subvol_args_t args = {0,};
|
|
|
cb8e9e |
|
|
|
cb8e9e |
priv = this->private;
|
|
|
cb8e9e |
local = frame->local;
|
|
|
cb8e9e |
@@ -1509,6 +1520,7 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
if (read_subvol == -1 || !readable[read_subvol]) {
|
|
|
cb8e9e |
read_subvol = i;
|
|
|
cb8e9e |
gf_uuid_copy (read_gfid, replies[i].poststat.ia_gfid);
|
|
|
cb8e9e |
+ ia_type = replies[i].poststat.ia_type;
|
|
|
cb8e9e |
local->op_ret = 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1554,14 +1566,16 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
a response from all the UP subvolumes and all of them resolved
|
|
|
cb8e9e |
to the same GFID
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
+ gf_uuid_copy (args.gfid, read_gfid);
|
|
|
cb8e9e |
+ args.ia_type = ia_type;
|
|
|
cb8e9e |
if (afr_replies_interpret (frame, this, local->inode)) {
|
|
|
cb8e9e |
read_subvol = afr_data_subvol_get (local->inode, this,
|
|
|
cb8e9e |
- 0, 0);
|
|
|
cb8e9e |
+ 0, 0, &args);
|
|
|
cb8e9e |
afr_inode_read_subvol_reset (local->inode, this);
|
|
|
cb8e9e |
goto cant_interpret;
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
read_subvol = afr_data_subvol_get (local->inode, this,
|
|
|
cb8e9e |
- 0, 0);
|
|
|
cb8e9e |
+ 0, 0, &args);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
cant_interpret:
|
|
|
cb8e9e |
@@ -1979,7 +1993,7 @@ afr_discover_done (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
afr_replies_interpret (frame, this, local->inode);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- read_subvol = afr_data_subvol_get (local->inode, this, 0, 0);
|
|
|
cb8e9e |
+ read_subvol = afr_data_subvol_get (local->inode, this, 0, 0, NULL);
|
|
|
cb8e9e |
if (read_subvol == -1) {
|
|
|
cb8e9e |
gf_log (this->name, GF_LOG_WARNING, "no read subvols for %s",
|
|
|
cb8e9e |
local->loc.path);
|
|
|
cb8e9e |
@@ -2142,7 +2156,7 @@ afr_discover (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
afr_read_subvol_get (loc->inode, this, NULL, &event,
|
|
|
cb8e9e |
- AFR_DATA_TRANSACTION);
|
|
|
cb8e9e |
+ AFR_DATA_TRANSACTION, NULL);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (event != local->event_generation)
|
|
|
cb8e9e |
afr_inode_refresh (frame, this, loc->inode, afr_discover_do);
|
|
|
cb8e9e |
@@ -2288,7 +2302,7 @@ afr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
afr_read_subvol_get (loc->parent, this, NULL, &event,
|
|
|
cb8e9e |
- AFR_DATA_TRANSACTION);
|
|
|
cb8e9e |
+ AFR_DATA_TRANSACTION, NULL);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (event != local->event_generation)
|
|
|
cb8e9e |
afr_inode_refresh (frame, this, loc->parent, afr_lookup_do);
|
|
|
cb8e9e |
@@ -2608,7 +2622,7 @@ afr_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
local = frame->local;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- read_subvol = afr_data_subvol_get (local->inode, this, 0, 0);
|
|
|
cb8e9e |
+ read_subvol = afr_data_subvol_get (local->inode, this, 0, 0, NULL);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
LOCK (&frame->lock);
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
|
|
|
cb8e9e |
index 984ed9c..11f583e 100644
|
|
|
cb8e9e |
--- a/xlators/cluster/afr/src/afr-dir-read.c
|
|
|
cb8e9e |
+++ b/xlators/cluster/afr/src/afr-dir-read.c
|
|
|
cb8e9e |
@@ -153,7 +153,12 @@ afr_validate_read_subvol (inode_t *inode, xlator_t *this, int par_read_subvol)
|
|
|
cb8e9e |
if (!priv->consistent_metadata)
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- entry_read_subvol = afr_data_subvol_get (inode, this, 0, 0);
|
|
|
cb8e9e |
+ /* For an inode fetched through readdirp which is yet to be linked,
|
|
|
cb8e9e |
+ * inode ctx would not be initialised (yet). So this function returns
|
|
|
cb8e9e |
+ * -1 above due to gen being 0, which is why it is OK to pass NULL for
|
|
|
cb8e9e |
+ * read_subvol_args here.
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+ entry_read_subvol = afr_data_subvol_get (inode, this, 0, 0, NULL);
|
|
|
cb8e9e |
if (entry_read_subvol != par_read_subvol)
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
|
|
|
cb8e9e |
index 8a2c0e4..2891f36 100644
|
|
|
cb8e9e |
--- a/xlators/cluster/afr/src/afr-dir-write.c
|
|
|
cb8e9e |
+++ b/xlators/cluster/afr/src/afr-dir-write.c
|
|
|
cb8e9e |
@@ -95,14 +95,14 @@ __afr_dir_write_finalize (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
if (local->inode) {
|
|
|
cb8e9e |
afr_replies_interpret (frame, this, local->inode);
|
|
|
cb8e9e |
inode_read_subvol = afr_data_subvol_get (local->inode, this,
|
|
|
cb8e9e |
- NULL, NULL);
|
|
|
cb8e9e |
+ NULL, NULL, NULL);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
if (local->parent)
|
|
|
cb8e9e |
parent_read_subvol = afr_data_subvol_get (local->parent, this,
|
|
|
cb8e9e |
- NULL, NULL);
|
|
|
cb8e9e |
+ NULL, NULL, NULL);
|
|
|
cb8e9e |
if (local->parent2)
|
|
|
cb8e9e |
parent2_read_subvol = afr_data_subvol_get (local->parent2, this,
|
|
|
cb8e9e |
- NULL, NULL);
|
|
|
cb8e9e |
+ NULL, NULL, NULL);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
local->op_ret = -1;
|
|
|
cb8e9e |
local->op_errno = afr_final_errno (local, priv);
|
|
|
cb8e9e |
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
|
|
|
cb8e9e |
index ecd2b9d..5d32927 100644
|
|
|
cb8e9e |
--- a/xlators/cluster/afr/src/afr-inode-write.c
|
|
|
cb8e9e |
+++ b/xlators/cluster/afr/src/afr-inode-write.c
|
|
|
cb8e9e |
@@ -53,10 +53,11 @@ __afr_inode_write_finalize (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
if (local->inode) {
|
|
|
cb8e9e |
if (local->transaction.type == AFR_METADATA_TRANSACTION)
|
|
|
cb8e9e |
read_subvol = afr_metadata_subvol_get (local->inode, this,
|
|
|
cb8e9e |
- NULL, NULL);
|
|
|
cb8e9e |
+ NULL, NULL,
|
|
|
cb8e9e |
+ NULL);
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
read_subvol = afr_data_subvol_get (local->inode, this,
|
|
|
cb8e9e |
- NULL, NULL);
|
|
|
cb8e9e |
+ NULL, NULL, NULL);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
local->op_ret = -1;
|
|
|
cb8e9e |
diff --git a/xlators/cluster/afr/src/afr-read-txn.c b/xlators/cluster/afr/src/afr-read-txn.c
|
|
|
cb8e9e |
index 0ec1d91..6121108 100644
|
|
|
cb8e9e |
--- a/xlators/cluster/afr/src/afr-read-txn.c
|
|
|
cb8e9e |
+++ b/xlators/cluster/afr/src/afr-read-txn.c
|
|
|
cb8e9e |
@@ -90,7 +90,7 @@ afr_read_txn_refresh_done (call_frame_t *frame, xlator_t *this, int err)
|
|
|
cb8e9e |
memcpy (local->readable, local->child_up, priv->child_count);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
read_subvol = afr_read_subvol_select_by_policy (inode, this,
|
|
|
cb8e9e |
- local->readable);
|
|
|
cb8e9e |
+ local->readable, NULL);
|
|
|
cb8e9e |
if (read_subvol == -1)
|
|
|
cb8e9e |
AFR_READ_TXN_SET_ERROR_AND_GOTO (-1, EIO, -1, readfn);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -232,7 +232,7 @@ afr_read_txn (call_frame_t *frame, xlator_t *this, inode_t *inode,
|
|
|
cb8e9e |
goto refresh;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
read_subvol = afr_read_subvol_select_by_policy (inode, this,
|
|
|
cb8e9e |
- local->readable);
|
|
|
cb8e9e |
+ local->readable, NULL);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (read_subvol < 0 || read_subvol > priv->child_count) {
|
|
|
cb8e9e |
gf_msg (this->name, GF_LOG_WARNING, 0, AFR_MSG_SPLIT_BRAIN,
|
|
|
cb8e9e |
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
|
|
|
cb8e9e |
index 855d3a3..e6e7f3e 100644
|
|
|
cb8e9e |
--- a/xlators/cluster/afr/src/afr.h
|
|
|
cb8e9e |
+++ b/xlators/cluster/afr/src/afr.h
|
|
|
cb8e9e |
@@ -755,6 +755,11 @@ typedef struct afr_spbc_timeout {
|
|
|
cb8e9e |
int spb_child_index;
|
|
|
cb8e9e |
} afr_spbc_timeout_t;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+typedef struct afr_read_subvol_args {
|
|
|
cb8e9e |
+ ia_type_t ia_type;
|
|
|
cb8e9e |
+ uuid_t gfid;
|
|
|
cb8e9e |
+} afr_read_subvol_args_t;
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
/* did a call fail due to a child failing? */
|
|
|
cb8e9e |
#define child_went_down(op_ret, op_errno) (((op_ret) < 0) && \
|
|
|
cb8e9e |
((op_errno == ENOTCONN) || \
|
|
|
cb8e9e |
@@ -787,7 +792,8 @@ afr_inode_read_subvol_reset (inode_t *inode, xlator_t *this);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
afr_read_subvol_select_by_policy (inode_t *inode, xlator_t *this,
|
|
|
cb8e9e |
- unsigned char *readable);
|
|
|
cb8e9e |
+ unsigned char *readable,
|
|
|
cb8e9e |
+ afr_read_subvol_args_t *args);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
afr_inode_read_subvol_type_get (inode_t *inode, xlator_t *this,
|
|
|
cb8e9e |
@@ -795,13 +801,14 @@ afr_inode_read_subvol_type_get (inode_t *inode, xlator_t *this,
|
|
|
cb8e9e |
int type);
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
afr_read_subvol_get (inode_t *inode, xlator_t *this, int *subvol_p,
|
|
|
cb8e9e |
- int *event_p, afr_transaction_type type);
|
|
|
cb8e9e |
+ int *event_p, afr_transaction_type type,
|
|
|
cb8e9e |
+ afr_read_subvol_args_t *args);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
-#define afr_data_subvol_get(i, t, s, e) \
|
|
|
cb8e9e |
- afr_read_subvol_get(i, t, s, e, AFR_DATA_TRANSACTION)
|
|
|
cb8e9e |
+#define afr_data_subvol_get(i, t, s, e, a) \
|
|
|
cb8e9e |
+ afr_read_subvol_get(i, t, s, e, AFR_DATA_TRANSACTION, a)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
-#define afr_metadata_subvol_get(i, t, s, e) \
|
|
|
cb8e9e |
- afr_read_subvol_get(i, t, s, e, AFR_METADATA_TRANSACTION)
|
|
|
cb8e9e |
+#define afr_metadata_subvol_get(i, t, s, e, a) \
|
|
|
cb8e9e |
+ afr_read_subvol_get(i, t, s, e, AFR_METADATA_TRANSACTION, a)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
afr_inode_refresh (call_frame_t *frame, xlator_t *this, inode_t *inode,
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|