diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2013-08-08 16:34:07 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2013-08-12 00:48:15 +0530 |
commit | c27f3d051efc19a05c95b6e26e783ee27da722a3 (patch) | |
tree | 46aef98f047ea83da8a566e2f717ca007d8a5364 | |
parent | 0bcdd3e3a632ffa5359a8d9ee74b364ca3af6bbe (diff) |
features/quota: minor fixes to enforcer
* send size query to quotad only if limit is set on that inode.
* don't check for loc->parent while querying size from quotad, since
its a nameless lookup
Change-Id: I10dc2f9d1e40875382040b53cb4ee5f6d9a27133
BUG: 969461
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r-- | xlators/features/quota/src/quota-enforcer-client.c | 15 | ||||
-rw-r--r-- | xlators/features/quota/src/quota.c | 2 |
2 files changed, 5 insertions, 12 deletions
diff --git a/xlators/features/quota/src/quota-enforcer-client.c b/xlators/features/quota/src/quota-enforcer-client.c index 9dcd8dc5..99bfc163 100644 --- a/xlators/features/quota/src/quota-enforcer-client.c +++ b/xlators/features/quota/src/quota-enforcer-client.c @@ -226,17 +226,10 @@ quota_enforcer_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, if (!(loc && loc->inode)) goto unwind; - if (loc->parent) { - if (!uuid_is_null (loc->parent->gfid)) - memcpy (req.pargfid, loc->parent->gfid, 16); - else - memcpy (req.pargfid, loc->pargfid, 16); - } else { - if (!uuid_is_null (loc->inode->gfid)) - memcpy (req.gfid, loc->inode->gfid, 16); - else - memcpy (req.gfid, loc->gfid, 16); - } + if (!uuid_is_null (loc->inode->gfid)) + memcpy (req.gfid, loc->inode->gfid, 16); + else + memcpy (req.gfid, loc->gfid, 16); if (xdata) { GF_PROTOCOL_DICT_SERIALIZE (this, xdata, diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 85ee3718..0f335283 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -426,7 +426,7 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, } do { - if (ctx != NULL) { + if (ctx != NULL && (ctx->hard_lim > 0 || ctx->soft_lim > 0)) { wouldbe_size = ctx->size + delta; LOCK (&ctx->lock); |