diff options
Diffstat (limited to 'xlators/features/marker/src/marker-quota-helper.c')
-rw-r--r-- | xlators/features/marker/src/marker-quota-helper.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c index 4aba599e12e..c2268bf5b98 100644 --- a/xlators/features/marker/src/marker-quota-helper.c +++ b/xlators/features/marker/src/marker-quota-helper.c @@ -65,9 +65,13 @@ out: int32_t mq_inode_loc_fill (const char *parent_gfid, inode_t *inode, loc_t *loc) { - char *resolvedpath = NULL; - inode_t *parent = NULL; - int ret = -1; + char *resolvedpath = NULL; + inode_t *parent = NULL; + quota_inode_ctx_t *ctx = NULL; + xlator_t *this = NULL; + int ret = -1; + + this = THIS; if ((!inode) || (!loc)) return ret; @@ -101,6 +105,17 @@ ignore_parent: if (ret < 0) goto err; + ret = mq_inode_ctx_get (inode, this, &ctx); + if (ret < 0 || ctx == NULL) + ctx = mq_inode_ctx_new (inode, this); + if (ctx == NULL) { + gf_log (this->name, GF_LOG_WARNING, "mq_inode_ctx_new " + "failed for %s", uuid_utoa (inode->gfid)); + ret = -1; + goto err; + } + ret = 0; + err: if (parent) inode_unref (parent); |