summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2013-09-17 23:07:57 -0700
committerGerrit Code Review <review@dev.gluster.org>2013-09-17 23:07:57 -0700
commit24e0063cb9cc910267375473e20ab278eae84e46 (patch)
treed11ade0d28609b40d785b73ad16ad8a1cf3f4dd1
parentc107ab3ef74a521bb467bf2be13f5fefcac56b6f (diff)
parent9eb84e8c7ae04d7c8aa2f686f1e741fb856d9343 (diff)
Merge "features/marker: check on gfid instead for pargfid while skipping contribution node creation for root" into upstream_on_quota
-rw-r--r--xlators/features/marker/src/marker-quota.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index bcec2969..26ad0fa5 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -1040,8 +1040,10 @@ mq_create_xattr (xlator_t *this, call_frame_t *frame)
}
if ((local->loc.path && strcmp (local->loc.path, "/") != 0)
- || (local->loc.parent && !__is_root_gfid (local->loc.parent->gfid))
- || (!__is_root_gfid (local->loc.pargfid))) {
+ || (local->loc.inode && !uuid_is_null (local->loc.inode->gfid) &&
+ !__is_root_gfid (local->loc.inode->gfid))
+ || (!uuid_is_null (local->loc.gfid)
+ && !__is_root_gfid (local->loc.gfid))) {
contri = mq_add_new_contribution_node (this, ctx, &local->loc);
if (contri == NULL)
goto err;
@@ -1111,11 +1113,11 @@ mq_check_n_set_inode_xattr (call_frame_t *frame, void *cookie,
//check contribution xattr if not root
if ((local->loc.path && strcmp (local->loc.path, "/") != 0)
- || (!uuid_is_null (local->loc.pargfid)
- && !__is_root_gfid (local->loc.pargfid))
- || (local->loc.parent
- && !uuid_is_null (local->loc.parent->gfid)
- && !__is_root_gfid (local->loc.parent->gfid))) {
+ || (!uuid_is_null (local->loc.gfid)
+ && !__is_root_gfid (local->loc.gfid))
+ || (local->loc.inode
+ && !uuid_is_null (local->loc.inode->gfid)
+ && !__is_root_gfid (local->loc.inode->gfid))) {
GET_CONTRI_KEY (contri_key, local->loc.parent->gfid, ret);
if (ret < 0)
goto out;
@@ -2044,10 +2046,10 @@ mq_initiate_quota_txn (xlator_t *this, loc_t *loc)
contribution = mq_get_contribution_node (loc->parent, ctx);
if (!contribution) {
if ((loc->path && strcmp (loc->path, "/"))
- || (!uuid_is_null (loc->pargfid)
- && !__is_root_gfid (loc->pargfid))
- || (loc->parent && !uuid_is_null (loc->parent->gfid)
- && !__is_root_gfid (loc->parent->gfid)))
+ || (!uuid_is_null (loc->gfid)
+ && !__is_root_gfid (loc->gfid))
+ || (loc->inode && !uuid_is_null (loc->inode->gfid)
+ && !__is_root_gfid (loc->inode->gfid)))
gf_log_callingfn (this->name, GF_LOG_TRACE,
"contribution node for the "
"path (%s) with parent (%s) "
@@ -2139,9 +2141,9 @@ mq_inspect_directory_xattr (xlator_t *this,
goto out;
if ((loc->path && strcmp (loc->path, "/") != 0)
- || (!uuid_is_null (loc->pargfid) && !__is_root_gfid (loc->pargfid))
- || (loc->parent && !uuid_is_null (loc->parent->gfid) &&
- !__is_root_gfid (loc->parent->gfid))) {
+ || (!uuid_is_null (loc->gfid) && !__is_root_gfid (loc->gfid))
+ || (loc->inode && !uuid_is_null (loc->inode->gfid) &&
+ !__is_root_gfid (loc->inode->gfid))) {
not_root = _gf_true;
GET_CONTRI_KEY (contri_key, contribution->gfid, ret);