summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker-quota-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/marker/src/marker-quota-helper.c')
-rw-r--r--xlators/features/marker/src/marker-quota-helper.c95
1 files changed, 1 insertions, 94 deletions
diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c
index 694493c778c..ecd85d67b2b 100644
--- a/xlators/features/marker/src/marker-quota-helper.c
+++ b/xlators/features/marker/src/marker-quota-helper.c
@@ -7,7 +7,7 @@
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
-#include "locking.h"
+#include <glusterfs/locking.h>
#include "marker-quota.h"
#include "marker-common.h"
#include "marker-quota-helper.h"
@@ -378,96 +378,3 @@ mq_inode_ctx_new(inode_t *inode, xlator_t *this)
{
return __mq_inode_ctx_new(inode, this);
}
-
-quota_local_t *
-mq_local_new()
-{
- quota_local_t *local = NULL;
-
- local = mem_get0(THIS->local_pool);
- if (!local)
- goto out;
-
- local->ref = 1;
- LOCK_INIT(&local->lock);
-
- local->ctx = NULL;
- local->contri = NULL;
-
-out:
- return local;
-}
-
-quota_local_t *
-mq_local_ref(quota_local_t *local)
-{
- LOCK(&local->lock);
- {
- local->ref++;
- }
- UNLOCK(&local->lock);
-
- return local;
-}
-
-int32_t
-mq_local_unref(xlator_t *this, quota_local_t *local)
-{
- int32_t ref = 0;
- if (local == NULL)
- goto out;
-
- QUOTA_SAFE_DECREMENT(&local->lock, local->ref, ref);
-
- if (ref != 0)
- goto out;
-
- if (local->fd != NULL)
- fd_unref(local->fd);
-
- if (local->contri)
- GF_REF_PUT(local->contri);
-
- if (local->xdata)
- dict_unref(local->xdata);
-
- loc_wipe(&local->loc);
-
- loc_wipe(&local->parent_loc);
-
- LOCK_DESTROY(&local->lock);
-
- mem_put(local);
-out:
- return 0;
-}
-
-inode_contribution_t *
-mq_get_contribution_from_loc(xlator_t *this, loc_t *loc)
-{
- int32_t ret = 0;
- quota_inode_ctx_t *ctx = NULL;
- inode_contribution_t *contribution = NULL;
-
- ret = mq_inode_ctx_get(loc->inode, this, &ctx);
- if (ret < 0) {
- gf_log_callingfn(this->name, GF_LOG_WARNING,
- "cannot get marker-quota context from inode "
- "(gfid:%s, path:%s)",
- uuid_utoa(loc->inode->gfid), loc->path);
- goto err;
- }
-
- contribution = mq_get_contribution_node(loc->parent, ctx);
- if (contribution == NULL) {
- gf_log_callingfn(this->name, GF_LOG_WARNING,
- "inode (gfid:%s, path:%s) has "
- "no contribution towards parent (gfid:%s)",
- uuid_utoa(loc->inode->gfid), loc->path,
- uuid_utoa(loc->parent->gfid));
- goto err;
- }
-
-err:
- return contribution;
-}