summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker
diff options
context:
space:
mode:
authorJunaid <junaid@gluster.com>2011-09-09 14:35:57 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-09 23:46:24 -0700
commit5efdbef0d74359122dbf76539e0975bea691456a (patch)
tree92114e73b0392d1a0921eeeade83e6a55d6a8de5 /xlators/features/marker
parenta0695e0524cc61d05156b66ebe3542870712daae (diff)
features/marker-quota: Prefix the function names with mq (marker-quota).
This is to fix to bug marker translator and quota translator cannot co-exist in same process. Change-Id: I9f132b663f03641f4f2c7e168df8400adbc5570f BUG: 3020 Reviewed-on: http://review.gluster.com/381 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/features/marker')
-rw-r--r--xlators/features/marker/src/marker-quota-helper.c48
-rw-r--r--xlators/features/marker/src/marker-quota-helper.h22
-rw-r--r--xlators/features/marker/src/marker-quota.c490
-rw-r--r--xlators/features/marker/src/marker-quota.h24
-rw-r--r--xlators/features/marker/src/marker.c36
5 files changed, 310 insertions, 310 deletions
diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c
index d701cb5a3..b487af4a9 100644
--- a/xlators/features/marker/src/marker-quota-helper.c
+++ b/xlators/features/marker/src/marker-quota-helper.c
@@ -28,7 +28,7 @@
#include "marker-mem-types.h"
int
-quota_loc_fill (loc_t *loc, inode_t *inode, inode_t *parent, char *path)
+mq_loc_fill (loc_t *loc, inode_t *inode, inode_t *parent, char *path)
{
int ret = -1;
@@ -69,7 +69,7 @@ out:
int32_t
-quota_inode_loc_fill (const char *parent_gfid, inode_t *inode, loc_t *loc)
+mq_inode_loc_fill (const char *parent_gfid, inode_t *inode, loc_t *loc)
{
char *resolvedpath = NULL;
inode_t *parent = NULL;
@@ -97,7 +97,7 @@ ignore_parent:
if (ret < 0)
goto err;
- ret = quota_loc_fill (loc, inode, parent, resolvedpath);
+ ret = mq_loc_fill (loc, inode, parent, resolvedpath);
if (ret < 0)
goto err;
@@ -112,7 +112,7 @@ err:
quota_inode_ctx_t *
-quota_alloc_inode_ctx ()
+mq_alloc_inode_ctx ()
{
int32_t ret = -1;
quota_inode_ctx_t *ctx = NULL;
@@ -131,7 +131,7 @@ out:
}
inode_contribution_t *
-get_contribution_node (inode_t *inode, quota_inode_ctx_t *ctx)
+mq_get_contribution_node (inode_t *inode, quota_inode_ctx_t *ctx)
{
inode_contribution_t *contri = NULL;
inode_contribution_t *temp = NULL;
@@ -151,8 +151,8 @@ out:
int32_t
-delete_contribution_node (dict_t *dict, char *key,
- inode_contribution_t *contribution)
+mq_delete_contribution_node (dict_t *dict, char *key,
+ inode_contribution_t *contribution)
{
if (dict_get (dict, key) != NULL)
goto out;
@@ -164,7 +164,7 @@ out:
inode_contribution_t *
-__add_new_contribution_node (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *loc)
+__mq_add_new_contribution_node (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *loc)
{
int32_t ret = 0;
inode_contribution_t *contribution = NULL;
@@ -194,7 +194,7 @@ out:
inode_contribution_t *
-add_new_contribution_node (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *loc)
+mq_add_new_contribution_node (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *loc)
{
inode_contribution_t *contribution = NULL;
@@ -206,7 +206,7 @@ add_new_contribution_node (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *loc)
LOCK (&ctx->lock);
{
- contribution = __add_new_contribution_node (this, ctx, loc);
+ contribution = __mq_add_new_contribution_node (this, ctx, loc);
}
UNLOCK (&ctx->lock);
@@ -215,8 +215,8 @@ add_new_contribution_node (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *loc)
int32_t
-dict_set_contribution (xlator_t *this, dict_t *dict,
- loc_t *loc)
+mq_dict_set_contribution (xlator_t *this, dict_t *dict,
+ loc_t *loc)
{
int32_t ret = -1;
char contri_key [512] = {0, };
@@ -246,8 +246,8 @@ out:
int32_t
-quota_inode_ctx_get (inode_t *inode, xlator_t *this,
- quota_inode_ctx_t **ctx)
+mq_inode_ctx_get (inode_t *inode, xlator_t *this,
+ quota_inode_ctx_t **ctx)
{
int32_t ret = -1;
uint64_t ctx_int = 0;
@@ -280,7 +280,7 @@ out:
quota_inode_ctx_t *
-__quota_inode_ctx_new (inode_t *inode, xlator_t *this)
+__mq_inode_ctx_new (inode_t *inode, xlator_t *this)
{
int32_t ret = -1;
quota_inode_ctx_t *quota_ctx = NULL;
@@ -296,7 +296,7 @@ __quota_inode_ctx_new (inode_t *inode, xlator_t *this)
LOCK (&inode->lock);
{
if (mark_ctx->quota_ctx == NULL) {
- quota_ctx = quota_alloc_inode_ctx ();
+ quota_ctx = mq_alloc_inode_ctx ();
if (quota_ctx == NULL) {
ret = -1;
goto unlock;
@@ -316,13 +316,13 @@ out:
quota_inode_ctx_t *
-quota_inode_ctx_new (inode_t * inode, xlator_t *this)
+mq_inode_ctx_new (inode_t * inode, xlator_t *this)
{
- return __quota_inode_ctx_new (inode, this);
+ return __mq_inode_ctx_new (inode, this);
}
quota_local_t *
-quota_local_new ()
+mq_local_new ()
{
int32_t ret = -1;
quota_local_t *local = NULL;
@@ -347,7 +347,7 @@ out:
}
quota_local_t *
-quota_local_ref (quota_local_t *local)
+mq_local_ref (quota_local_t *local)
{
LOCK (&local->lock);
{
@@ -360,7 +360,7 @@ quota_local_ref (quota_local_t *local)
int32_t
-quota_local_unref (xlator_t *this, quota_local_t *local)
+mq_local_unref (xlator_t *this, quota_local_t *local)
{
int32_t ref = 0;
if (local == NULL)
@@ -387,13 +387,13 @@ out:
inode_contribution_t *
-get_contribution_from_loc (xlator_t *this, loc_t *loc)
+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 = quota_inode_ctx_get (loc->inode, this, &ctx);
+ 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 "
@@ -404,7 +404,7 @@ get_contribution_from_loc (xlator_t *this, loc_t *loc)
goto err;
}
- contribution = get_contribution_node (loc->parent, ctx);
+ contribution = mq_get_contribution_node (loc->parent, ctx);
if (contribution == NULL) {
gf_log_callingfn (this->name, GF_LOG_WARNING,
"inode (ino:%"PRId64", gfid:%s, path:%s ) has"
diff --git a/xlators/features/marker/src/marker-quota-helper.h b/xlators/features/marker/src/marker-quota-helper.h
index 9e9e6c241..56080f0dc 100644
--- a/xlators/features/marker/src/marker-quota-helper.h
+++ b/xlators/features/marker/src/marker-quota-helper.h
@@ -48,36 +48,36 @@
} while (0)
inode_contribution_t *
-add_new_contribution_node (xlator_t *, quota_inode_ctx_t *, loc_t *);
+mq_add_new_contribution_node (xlator_t *, quota_inode_ctx_t *, loc_t *);
int32_t
-dict_set_contribution (xlator_t *, dict_t *, loc_t *);
+mq_dict_set_contribution (xlator_t *, dict_t *, loc_t *);
quota_inode_ctx_t *
-quota_inode_ctx_new (inode_t *, xlator_t *);
+mq_inode_ctx_new (inode_t *, xlator_t *);
int32_t
-quota_inode_ctx_get (inode_t *, xlator_t *, quota_inode_ctx_t **);
+mq_inode_ctx_get (inode_t *, xlator_t *, quota_inode_ctx_t **);
int32_t
-delete_contribution_node (dict_t *, char *, inode_contribution_t *);
+mq_delete_contribution_node (dict_t *, char *, inode_contribution_t *);
int32_t
-quota_inode_loc_fill (const char *, inode_t *, loc_t *);
+mq_inode_loc_fill (const char *, inode_t *, loc_t *);
quota_local_t *
-quota_local_new ();
+mq_local_new ();
quota_local_t *
-quota_local_ref (quota_local_t *);
+mq_local_ref (quota_local_t *);
int32_t
-quota_local_unref (xlator_t *, quota_local_t *);
+mq_local_unref (xlator_t *, quota_local_t *);
inode_contribution_t *
-get_contribution_node (inode_t *, quota_inode_ctx_t *);
+mq_get_contribution_node (inode_t *, quota_inode_ctx_t *);
inode_contribution_t *
-get_contribution_from_loc (xlator_t *this, loc_t *loc);
+mq_get_contribution_from_loc (xlator_t *this, loc_t *loc);
#endif
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index ebe205fc6..7bc912d7e 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -159,8 +159,8 @@ mq_assign_lk_owner (xlator_t *this, call_frame_t *frame)
int32_t
-loc_fill_from_name (xlator_t *this, loc_t *newloc, loc_t *oldloc,
- uint64_t ino, char *name)
+mq_loc_fill_from_name (xlator_t *this, loc_t *newloc, loc_t *oldloc,
+ uint64_t ino, char *name)
{
int32_t ret = -1;
int32_t len = 0;
@@ -208,8 +208,8 @@ out:
}
int32_t
-dirty_inode_updation_done (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno)
+mq_dirty_inode_updation_done (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno)
{
QUOTA_STACK_DESTROY (frame, this);
@@ -217,8 +217,8 @@ dirty_inode_updation_done (call_frame_t *frame, void *cookie, xlator_t *this,
}
int32_t
-release_lock_on_dirty_inode (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno)
+mq_release_lock_on_dirty_inode (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno)
{
struct gf_flock lock = {0, };
quota_local_t *local = NULL;
@@ -230,7 +230,7 @@ release_lock_on_dirty_inode (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
local->err = -1;
- dirty_inode_updation_done (frame, NULL, this, 0, 0);
+ mq_dirty_inode_updation_done (frame, NULL, this, 0, 0);
return 0;
}
@@ -248,7 +248,7 @@ release_lock_on_dirty_inode (call_frame_t *frame, void *cookie, xlator_t *this,
if (ret == -1) {
local->err = -1;
frame->local = NULL;
- dirty_inode_updation_done (frame, NULL, this, 0, 0);
+ mq_dirty_inode_updation_done (frame, NULL, this, 0, 0);
return 0;
}
@@ -259,7 +259,7 @@ release_lock_on_dirty_inode (call_frame_t *frame, void *cookie, xlator_t *this,
}
STACK_WIND (frame,
- dirty_inode_updation_done,
+ mq_dirty_inode_updation_done,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
this->name, &loc, F_SETLKW, &lock);
@@ -268,14 +268,14 @@ release_lock_on_dirty_inode (call_frame_t *frame, void *cookie, xlator_t *this,
return 0;
out:
- dirty_inode_updation_done (frame, NULL, this, -1, 0);
+ mq_dirty_inode_updation_done (frame, NULL, this, -1, 0);
return 0;
}
int32_t
-mark_inode_undirty (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *dict)
+mq_mark_inode_undirty (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict)
{
int32_t ret = -1;
int64_t *size = NULL;
@@ -309,7 +309,7 @@ wind:
if (ret)
goto err;
- STACK_WIND (frame, release_lock_on_dirty_inode,
+ STACK_WIND (frame, mq_release_lock_on_dirty_inode,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
&local->loc, newdict, 0);
@@ -319,7 +319,7 @@ err:
if (op_ret == -1 || ret == -1) {
local->err = -1;
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
}
if (newdict)
@@ -329,9 +329,9 @@ err:
}
int32_t
-update_size_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, dict_t *dict, struct iatt *postparent)
+mq_update_size_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *dict, struct iatt *postparent)
{
int32_t ret = -1;
dict_t *new_dict = NULL;
@@ -375,7 +375,7 @@ update_size_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
if (ret)
goto err;
- STACK_WIND (frame, mark_inode_undirty, FIRST_CHILD(this),
+ STACK_WIND (frame, mq_mark_inode_undirty, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->xattrop, &local->loc,
GF_XATTROP_ADD_ARRAY64, new_dict);
@@ -385,7 +385,7 @@ err:
if (op_ret == -1 || ret == -1) {
local->err = -1;
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
}
if (new_dict)
@@ -418,7 +418,7 @@ out:
}
int32_t
-get_dirty_inode_size (call_frame_t *frame, xlator_t *this)
+mq_get_dirty_inode_size (call_frame_t *frame, xlator_t *this)
{
int32_t ret = -1;
dict_t *dict = NULL;
@@ -436,7 +436,7 @@ get_dirty_inode_size (call_frame_t *frame, xlator_t *this)
if (ret)
goto err;
- STACK_WIND (frame, update_size_xattr, FIRST_CHILD(this),
+ STACK_WIND (frame, mq_update_size_xattr, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, &local->loc, dict);
ret =0;
@@ -444,7 +444,7 @@ err:
if (ret) {
local->err = -1;
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
}
if (dict)
@@ -454,15 +454,15 @@ err:
}
int32_t
-get_child_contribution (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- dict_t *dict,
- struct iatt *postparent)
+mq_get_child_contribution (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ inode_t *inode,
+ struct iatt *buf,
+ dict_t *dict,
+ struct iatt *postparent)
{
int32_t ret = -1;
int32_t val = 0;
@@ -482,7 +482,7 @@ get_child_contribution (call_frame_t *frame,
val = -2;
if (!mq_test_and_set_local_err (local, &val) &&
val != -2)
- release_lock_on_dirty_inode (local->frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (local->frame, NULL, this, 0, 0);
goto exit;
}
@@ -509,24 +509,24 @@ out:
UNLOCK (&local->lock);
if (val == 0) {
- quota_dirty_inode_readdir (local->frame, NULL, this,
+ mq_dirty_inode_readdir (local->frame, NULL, this,
0, 0, NULL);
}
- quota_local_unref (this, local);
+ mq_local_unref (this, local);
return 0;
exit:
- quota_local_unref (this, local);
+ mq_local_unref (this, local);
return 0;
}
int32_t
-quota_readdir_cbk (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- gf_dirent_t *entries)
+mq_readdir_cbk (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ gf_dirent_t *entries)
{
char contri_key [512] = {0, };
int32_t ret = 0;
@@ -539,18 +539,18 @@ quota_readdir_cbk (call_frame_t *frame,
call_frame_t *newframe = NULL;
loc_t loc = {0, };
- local = quota_local_ref (frame->local);
+ local = mq_local_ref (frame->local);
if (op_ret == -1) {
gf_log (this->name, GF_LOG_DEBUG,
"readdir failed %s", strerror (op_errno));
local->err = -1;
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
goto end;
} else if (op_ret == 0) {
- get_dirty_inode_size (frame, this);
+ mq_get_dirty_inode_size (frame, this);
goto end;
}
@@ -572,7 +572,7 @@ quota_readdir_cbk (call_frame_t *frame,
}
if (count == 0) {
- get_dirty_inode_size (frame, this);
+ mq_get_dirty_inode_size (frame, this);
goto end;
}
@@ -597,8 +597,8 @@ quota_readdir_cbk (call_frame_t *frame,
continue;
}
- ret = loc_fill_from_name (this, &loc, &local->loc,
- entry->d_ino, entry->d_name);
+ ret = mq_loc_fill_from_name (this, &loc, &local->loc,
+ entry->d_ino, entry->d_name);
if (ret < 0)
goto out;
@@ -619,7 +619,7 @@ quota_readdir_cbk (call_frame_t *frame,
if (ret == -1)
goto out;
- newframe->local = quota_local_ref (local);
+ newframe->local = mq_local_ref (local);
dict = dict_new ();
if (!dict) {
@@ -636,7 +636,7 @@ quota_readdir_cbk (call_frame_t *frame,
goto out;
STACK_WIND (newframe,
- get_child_contribution,
+ mq_get_child_contribution,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup,
&loc, dict);
@@ -659,7 +659,7 @@ quota_readdir_cbk (call_frame_t *frame,
if (newframe) {
newframe->local = NULL;
- quota_local_unref(this, local);
+ mq_local_unref(this, local);
QUOTA_STACK_DESTROY (newframe, this);
}
@@ -668,21 +668,21 @@ quota_readdir_cbk (call_frame_t *frame,
}
if (ret && val != -2) {
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
}
end:
- quota_local_unref (this, local);
+ mq_local_unref (this, local);
return 0;
}
int32_t
-quota_dirty_inode_readdir (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- fd_t *fd)
+mq_dirty_inode_readdir (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ fd_t *fd)
{
quota_local_t *local = NULL;
@@ -690,7 +690,7 @@ quota_dirty_inode_readdir (call_frame_t *frame,
if (op_ret == -1) {
local->err = -1;
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
return 0;
}
@@ -698,7 +698,7 @@ quota_dirty_inode_readdir (call_frame_t *frame,
local->fd = fd_ref (fd);
STACK_WIND (frame,
- quota_readdir_cbk,
+ mq_readdir_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->readdir,
local->fd, READDIR_BUF, local->d_off);
@@ -707,15 +707,15 @@ quota_dirty_inode_readdir (call_frame_t *frame,
}
int32_t
-check_if_still_dirty (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- inode_t *inode,
- struct iatt *buf,
- dict_t *dict,
- struct iatt *postparent)
+mq_check_if_still_dirty (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ inode_t *inode,
+ struct iatt *buf,
+ dict_t *dict,
+ struct iatt *postparent)
{
int8_t dirty = -1;
int32_t ret = -1;
@@ -741,7 +741,7 @@ check_if_still_dirty (call_frame_t *frame,
//the inode is not dirty anymore
if (dirty == 0) {
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
return 0;
}
@@ -751,7 +751,7 @@ check_if_still_dirty (call_frame_t *frame,
local->d_off = 0;
STACK_WIND(frame,
- quota_dirty_inode_readdir,
+ mq_dirty_inode_readdir,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->opendir,
&local->loc, fd);
@@ -761,7 +761,7 @@ check_if_still_dirty (call_frame_t *frame,
err:
if (op_ret == -1 || ret == -1) {
local->err = -1;
- release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode (frame, NULL, this, 0, 0);
}
if (fd != NULL) {
@@ -772,15 +772,15 @@ err:
}
int32_t
-get_dirty_xattr (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret, int32_t op_errno)
+mq_get_dirty_xattr (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno)
{
int32_t ret = -1;
dict_t *xattr_req = NULL;
quota_local_t *local = NULL;
if (op_ret == -1) {
- dirty_inode_updation_done (frame, NULL, this, 0, 0);
+ mq_dirty_inode_updation_done (frame, NULL, this, 0, 0);
return 0;
}
@@ -797,7 +797,7 @@ get_dirty_xattr (call_frame_t *frame, void *cookie,
goto err;
STACK_WIND (frame,
- check_if_still_dirty,
+ mq_check_if_still_dirty,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup,
&local->loc,
@@ -807,7 +807,7 @@ get_dirty_xattr (call_frame_t *frame, void *cookie,
err:
if (ret) {
local->err = -1;
- release_lock_on_dirty_inode(frame, NULL, this, 0, 0);
+ mq_release_lock_on_dirty_inode(frame, NULL, this, 0, 0);
}
if (xattr_req)
@@ -820,10 +820,10 @@ err:
* 0 other wise
*/
int32_t
-update_dirty_inode (xlator_t *this,
- loc_t *loc,
- quota_inode_ctx_t *ctx,
- inode_contribution_t *contribution)
+mq_update_dirty_inode (xlator_t *this,
+ loc_t *loc,
+ quota_inode_ctx_t *ctx,
+ inode_contribution_t *contribution)
{
int32_t ret = -1;
quota_local_t *local = NULL;
@@ -845,7 +845,7 @@ update_dirty_inode (xlator_t *this,
mq_assign_lk_owner (this, frame);
- local = quota_local_new ();
+ local = mq_local_new ();
if (local == NULL)
goto fr_destroy;
@@ -871,7 +871,7 @@ update_dirty_inode (xlator_t *this,
}
STACK_WIND (frame,
- get_dirty_xattr,
+ mq_get_dirty_xattr,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
this->name, &local->loc, F_SETLKW, &lock);
@@ -886,8 +886,8 @@ out:
int32_t
-quota_inode_creation_done (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno)
+mq_inode_creation_done (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno)
{
if (frame == NULL)
return 0;
@@ -899,9 +899,9 @@ quota_inode_creation_done (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t
-quota_xattr_creation_release_lock (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno)
+mq_xattr_creation_release_lock (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno)
{
struct gf_flock lock = {0, };
quota_local_t *local = NULL;
@@ -915,7 +915,7 @@ quota_xattr_creation_release_lock (call_frame_t *frame, void *cookie,
lock.l_pid = 0;
STACK_WIND (frame,
- quota_inode_creation_done,
+ mq_inode_creation_done,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
this->name, &local->loc,
@@ -926,8 +926,8 @@ quota_xattr_creation_release_lock (call_frame_t *frame, void *cookie,
int32_t
-create_dirty_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *dict)
+mq_create_dirty_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict)
{
int32_t ret = -1;
dict_t *newdict = NULL;
@@ -950,19 +950,19 @@ create_dirty_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
goto err;
}
- STACK_WIND (frame, quota_xattr_creation_release_lock,
+ STACK_WIND (frame, mq_xattr_creation_release_lock,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
&local->loc, newdict, 0);
} else {
- quota_xattr_creation_release_lock (frame, NULL, this, 0, 0);
+ mq_xattr_creation_release_lock (frame, NULL, this, 0, 0);
}
ret = 0;
err:
if (ret < 0) {
- quota_xattr_creation_release_lock (frame, NULL, this, 0, 0);
+ mq_xattr_creation_release_lock (frame, NULL, this, 0, 0);
}
if (newdict != NULL)
@@ -973,7 +973,7 @@ err:
int32_t
-quota_create_xattr (xlator_t *this, call_frame_t *frame)
+mq_create_xattr (xlator_t *this, call_frame_t *frame)
{
int32_t ret = 0;
int64_t *value = NULL;
@@ -989,12 +989,12 @@ quota_create_xattr (xlator_t *this, call_frame_t *frame)
local = frame->local;
- ret = quota_inode_ctx_get (local->loc.inode, this, &ctx);
+ ret = mq_inode_ctx_get (local->loc.inode, this, &ctx);
if (ret < 0) {
- ctx = quota_inode_ctx_new (local->loc.inode, this);
+ ctx = mq_inode_ctx_new (local->loc.inode, this);
if (ctx == NULL) {
gf_log (this->name, GF_LOG_WARNING,
- "quota_inode_ctx_new failed");
+ "mq_inode_ctx_new failed");
ret = -1;
goto out;
}
@@ -1012,7 +1012,7 @@ quota_create_xattr (xlator_t *this, call_frame_t *frame)
}
if (strcmp (local->loc.path, "/") != 0) {
- contri = add_new_contribution_node (this, ctx, &local->loc);
+ contri = mq_add_new_contribution_node (this, ctx, &local->loc);
if (contri == NULL)
goto err;
@@ -1024,7 +1024,7 @@ quota_create_xattr (xlator_t *this, call_frame_t *frame)
goto free_value;
}
- STACK_WIND (frame, create_dirty_xattr, FIRST_CHILD(this),
+ STACK_WIND (frame, mq_create_dirty_xattr, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->xattrop, &local->loc,
GF_XATTROP_ADD_ARRAY64, dict);
ret = 0;
@@ -1044,7 +1044,7 @@ err:
out:
if (ret < 0) {
- quota_xattr_creation_release_lock (frame, NULL, this, 0, 0);
+ mq_xattr_creation_release_lock (frame, NULL, this, 0, 0);
}
return 0;
@@ -1052,10 +1052,10 @@ out:
int32_t
-quota_check_n_set_inode_xattr (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret, int32_t op_errno,
- inode_t *inode, struct iatt *buf, dict_t *dict,
- struct iatt *postparent)
+mq_check_n_set_inode_xattr (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno,
+ inode_t *inode, struct iatt *buf, dict_t *dict,
+ struct iatt *postparent)
{
quota_local_t *local = NULL;
int64_t *size = NULL, *contri = NULL;
@@ -1089,18 +1089,18 @@ quota_check_n_set_inode_xattr (call_frame_t *frame, void *cookie,
}
out:
- quota_xattr_creation_release_lock (frame, NULL, this, 0, 0);
+ mq_xattr_creation_release_lock (frame, NULL, this, 0, 0);
return 0;
create_xattr:
- quota_create_xattr (this, frame);
+ mq_create_xattr (this, frame);
return 0;
}
int32_t
-quota_get_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno)
+mq_get_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno)
{
dict_t *xattr_req = NULL;
quota_local_t *local = NULL;
@@ -1117,13 +1117,13 @@ quota_get_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
goto err;
}
- ret = quota_req_xattr (this, &local->loc, xattr_req);
+ ret = mq_req_xattr (this, &local->loc, xattr_req);
if (ret < 0) {
gf_log (this->name, GF_LOG_WARNING, "cannot request xattr");
goto err;
}
- STACK_WIND (frame, quota_check_n_set_inode_xattr, FIRST_CHILD(this),
+ STACK_WIND (frame, mq_check_n_set_inode_xattr, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, &local->loc, xattr_req);
dict_unref (xattr_req);
@@ -1131,20 +1131,20 @@ quota_get_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
return 0;
err:
- quota_xattr_creation_release_lock (frame, NULL, this, 0, 0);
+ mq_xattr_creation_release_lock (frame, NULL, this, 0, 0);
if (xattr_req)
dict_unref (xattr_req);
return 0;
lock_err:
- quota_inode_creation_done (frame, NULL, this, 0, 0);
+ mq_inode_creation_done (frame, NULL, this, 0, 0);
return 0;
}
int32_t
-quota_set_inode_xattr (xlator_t *this, loc_t *loc)
+mq_set_inode_xattr (xlator_t *this, loc_t *loc)
{
struct gf_flock lock = {0, };
quota_local_t *local = NULL;
@@ -1157,7 +1157,7 @@ quota_set_inode_xattr (xlator_t *this, loc_t *loc)
goto err;
}
- local = quota_local_new ();
+ local = mq_local_new ();
if (local == NULL) {
goto err;
}
@@ -1177,7 +1177,7 @@ quota_set_inode_xattr (xlator_t *this, loc_t *loc)
lock.l_whence = SEEK_SET;
STACK_WIND (frame,
- quota_get_xattr,
+ mq_get_xattr,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
this->name, &local->loc, F_SETLKW, &lock);
@@ -1192,7 +1192,7 @@ err:
int32_t
-get_parent_inode_local (xlator_t *this, quota_local_t *local)
+mq_get_parent_inode_local (xlator_t *this, quota_local_t *local)
{
int32_t ret = -1;
quota_inode_ctx_t *ctx = NULL;
@@ -1211,8 +1211,8 @@ get_parent_inode_local (xlator_t *this, quota_local_t *local)
loc_wipe (&local->parent_loc);
- ret = quota_inode_loc_fill (NULL, local->loc.parent,
- &local->parent_loc);
+ ret = mq_inode_loc_fill (NULL, local->loc.parent,
+ &local->parent_loc);
if (ret < 0) {
gf_log_callingfn (this->name, GF_LOG_WARNING,
"failed to build parent loc of %s",
@@ -1220,7 +1220,7 @@ get_parent_inode_local (xlator_t *this, quota_local_t *local)
goto out;
}
- ret = quota_inode_ctx_get (local->loc.inode, this, &ctx);
+ ret = mq_inode_ctx_get (local->loc.inode, this, &ctx);
if (ret < 0) {
gf_log_callingfn (this->name, GF_LOG_WARNING,
"inode ctx get failed");
@@ -1245,12 +1245,12 @@ out:
int32_t
-xattr_updation_done (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *dict)
+mq_xattr_updation_done (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ dict_t *dict)
{
QUOTA_STACK_DESTROY (frame, this);
return 0;
@@ -1258,8 +1258,8 @@ xattr_updation_done (call_frame_t *frame,
int32_t
-quota_inodelk_cbk (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret, int32_t op_errno)
+mq_inodelk_cbk (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno)
{
int32_t ret = 0;
gf_boolean_t status = _gf_false;
@@ -1273,7 +1273,7 @@ quota_inodelk_cbk (call_frame_t *frame, void *cookie,
"unlocking failed on path (%s)(%s)",
local->parent_loc.path, strerror (op_errno));
}
- xattr_updation_done (frame, NULL, this, 0, 0, NULL);
+ mq_xattr_updation_done (frame, NULL, this, 0, 0, NULL);
return 0;
}
@@ -1283,20 +1283,20 @@ quota_inodelk_cbk (call_frame_t *frame, void *cookie,
if ((strcmp (local->parent_loc.path, "/") == 0)
|| (local->delta == 0)) {
- xattr_updation_done (frame, NULL, this, 0, 0, NULL);
+ mq_xattr_updation_done (frame, NULL, this, 0, 0, NULL);
} else {
- ret = get_parent_inode_local (this, local);
+ ret = mq_get_parent_inode_local (this, local);
if (ret < 0) {
- xattr_updation_done (frame, NULL, this, 0, 0, NULL);
+ mq_xattr_updation_done (frame, NULL, this, 0, 0, NULL);
goto out;
}
status = _gf_true;
ret = mq_test_and_set_ctx_updation_status (local->ctx, &status);
if (ret == 0 && status == _gf_false) {
- get_lock_on_parent (frame, this);
+ mq_get_lock_on_parent (frame, this);
} else {
- xattr_updation_done (frame, NULL, this, 0, 0, NULL);
+ mq_xattr_updation_done (frame, NULL, this, 0, 0, NULL);
}
}
out:
@@ -1306,9 +1306,9 @@ out:
//now release lock on the parent inode
int32_t
-quota_release_parent_lock (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno)
+mq_release_parent_lock (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno)
{
int32_t ret = 0;
quota_local_t *local = NULL;
@@ -1326,7 +1326,7 @@ quota_release_parent_lock (call_frame_t *frame, void *cookie,
strerror (local->err));
}
- ret = quota_inode_ctx_get (local->parent_loc.inode, this, &ctx);
+ ret = mq_inode_ctx_get (local->parent_loc.inode, this, &ctx);
if (ret < 0)
goto wind;
@@ -1350,7 +1350,7 @@ wind:
lock.l_pid = 0;
STACK_WIND (frame,
- quota_inodelk_cbk,
+ mq_inodelk_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
this->name, &local->parent_loc,
@@ -1358,19 +1358,19 @@ wind:
return 0;
err:
- xattr_updation_done (frame, NULL, this,
+ mq_xattr_updation_done (frame, NULL, this,
0, 0 , NULL);
return 0;
}
int32_t
-quota_mark_undirty (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *dict)
+mq_mark_undirty (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ dict_t *dict)
{
int32_t ret = -1;
int64_t *size = NULL;
@@ -1390,7 +1390,7 @@ quota_mark_undirty (call_frame_t *frame,
//update the size of the parent inode
if (dict != NULL) {
- ret = quota_inode_ctx_get (local->parent_loc.inode, this, &ctx);
+ ret = mq_inode_ctx_get (local->parent_loc.inode, this, &ctx);
if (ret < 0) {
op_errno = EINVAL;
goto err;
@@ -1425,7 +1425,7 @@ quota_mark_undirty (call_frame_t *frame,
goto err;
}
- STACK_WIND (frame, quota_release_parent_lock,
+ STACK_WIND (frame, mq_release_parent_lock,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
&local->parent_loc, newdict, 0);
@@ -1435,7 +1435,7 @@ err:
if (op_ret == -1 || ret == -1) {
local->err = op_errno;
- quota_release_parent_lock (frame, NULL, this, 0, 0);
+ mq_release_parent_lock (frame, NULL, this, 0, 0);
}
if (newdict)
@@ -1446,12 +1446,12 @@ err:
int32_t
-quota_update_parent_size (call_frame_t *frame,
- void *cookie,
- xlator_t *this,
- int32_t op_ret,
- int32_t op_errno,
- dict_t *dict)
+mq_update_parent_size (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ dict_t *dict)
{
int64_t *size = NULL;
int32_t ret = -1;
@@ -1484,7 +1484,7 @@ quota_update_parent_size (call_frame_t *frame,
goto err;
}
- ret = quota_inode_ctx_get (local->parent_loc.inode, this, &ctx);
+ ret = mq_inode_ctx_get (local->parent_loc.inode, this, &ctx);
if (ret < 0) {
op_errno = EINVAL;
goto err;
@@ -1508,7 +1508,7 @@ quota_update_parent_size (call_frame_t *frame,
}
STACK_WIND (frame,
- quota_mark_undirty,
+ mq_mark_undirty,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->xattrop,
&local->parent_loc,
@@ -1518,7 +1518,7 @@ quota_update_parent_size (call_frame_t *frame,
err:
if (op_ret == -1 || ret < 0) {
local->err = op_errno;
- quota_release_parent_lock (frame, NULL, this, 0, 0);
+ mq_release_parent_lock (frame, NULL, this, 0, 0);
}
if (newdict)
@@ -1528,11 +1528,11 @@ err:
}
int32_t
-quota_update_inode_contribution (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno, inode_t *inode,
- struct iatt *buf, dict_t *dict,
- struct iatt *postparent)
+mq_update_inode_contribution (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *dict,
+ struct iatt *postparent)
{
int32_t ret = -1;
int64_t *size = NULL, size_int = 0, contri_int = 0;
@@ -1606,7 +1606,7 @@ unlock:
local->delta = size_int - contri_int;
if (local->delta == 0) {
- quota_mark_undirty (frame, NULL, this, 0, 0, NULL);
+ mq_mark_undirty (frame, NULL, this, 0, 0, NULL);
return 0;
}
@@ -1629,7 +1629,7 @@ unlock:
}
STACK_WIND (frame,
- quota_update_parent_size,
+ mq_update_parent_size,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->xattrop,
&local->loc,
@@ -1641,7 +1641,7 @@ err:
if (op_ret == -1 || ret < 0) {
local->err = op_errno;
- quota_release_parent_lock (frame, NULL, this, 0, 0);
+ mq_release_parent_lock (frame, NULL, this, 0, 0);
}
if (newdict)
@@ -1651,9 +1651,9 @@ err:
}
int32_t
-quota_fetch_child_size_and_contri (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret,
- int32_t op_errno)
+mq_fetch_child_size_and_contri (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno)
{
int32_t ret = -1;
char contri_key [512] = {0, };
@@ -1677,7 +1677,7 @@ quota_fetch_child_size_and_contri (call_frame_t *frame, void *cookie,
gf_log (this->name, GF_LOG_DEBUG, "%s marked dirty", local->parent_loc.path);
//update parent ctx
- ret = quota_inode_ctx_get (local->parent_loc.inode, this, &ctx);
+ ret = mq_inode_ctx_get (local->parent_loc.inode, this, &ctx);
if (ret == -1) {
op_errno = EINVAL;
goto err;
@@ -1719,7 +1719,7 @@ quota_fetch_child_size_and_contri (call_frame_t *frame, void *cookie,
mq_set_ctx_updation_status (local->ctx, _gf_false);
- STACK_WIND (frame, quota_update_inode_contribution, FIRST_CHILD(this),
+ STACK_WIND (frame, mq_update_inode_contribution, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, &local->loc, newdict);
ret = 0;
@@ -1730,7 +1730,7 @@ err:
mq_set_ctx_updation_status (local->ctx, _gf_false);
- quota_release_parent_lock (frame, NULL, this, 0, 0);
+ mq_release_parent_lock (frame, NULL, this, 0, 0);
}
if (newdict)
@@ -1740,8 +1740,8 @@ err:
}
int32_t
-quota_markdirty (call_frame_t *frame, void *cookie,
- xlator_t *this, int32_t op_ret, int32_t op_errno)
+mq_markdirty (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret, int32_t op_errno)
{
int32_t ret = -1;
dict_t *dict = NULL;
@@ -1758,7 +1758,7 @@ quota_markdirty (call_frame_t *frame, void *cookie,
mq_set_ctx_updation_status (local->ctx, _gf_false);
- quota_inodelk_cbk (frame, NULL, this, 0, 0);
+ mq_inodelk_cbk (frame, NULL, this, 0, 0);
return 0;
}
@@ -1776,7 +1776,7 @@ quota_markdirty (call_frame_t *frame, void *cookie,
if (ret == -1)
goto err;
- STACK_WIND (frame, quota_fetch_child_size_and_contri,
+ STACK_WIND (frame, mq_fetch_child_size_and_contri,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
&local->parent_loc, dict, 0);
@@ -1788,7 +1788,7 @@ err:
mq_set_ctx_updation_status (local->ctx, _gf_false);
- quota_release_parent_lock (frame, NULL, this, 0, 0);
+ mq_release_parent_lock (frame, NULL, this, 0, 0);
}
if (dict)
@@ -1799,7 +1799,7 @@ err:
int32_t
-get_lock_on_parent (call_frame_t *frame, xlator_t *this)
+mq_get_lock_on_parent (call_frame_t *frame, xlator_t *this)
{
struct gf_flock lock = {0, };
quota_local_t *local = NULL;
@@ -1823,7 +1823,7 @@ get_lock_on_parent (call_frame_t *frame, xlator_t *this)
lock.l_whence = SEEK_SET;
STACK_WIND (frame,
- quota_markdirty,
+ mq_markdirty,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
this->name, &local->parent_loc, F_SETLKW, &lock);
@@ -1838,9 +1838,9 @@ fr_destroy:
int
-start_quota_txn (xlator_t *this, loc_t *loc,
- quota_inode_ctx_t *ctx,
- inode_contribution_t *contri)
+mq_start_quota_txn (xlator_t *this, loc_t *loc,
+ quota_inode_ctx_t *ctx,
+ inode_contribution_t *contri)
{
int32_t ret = -1;
call_frame_t *frame = NULL;
@@ -1852,7 +1852,7 @@ start_quota_txn (xlator_t *this, loc_t *loc,
mq_assign_lk_owner (this, frame);
- local = quota_local_new ();
+ local = mq_local_new ();
if (local == NULL)
goto fr_destroy;
@@ -1862,15 +1862,15 @@ start_quota_txn (xlator_t *this, loc_t *loc,
if (ret < 0)
goto fr_destroy;
- ret = quota_inode_loc_fill (NULL, local->loc.parent,
- &local->parent_loc);
+ ret = mq_inode_loc_fill (NULL, local->loc.parent,
+ &local->parent_loc);
if (ret < 0)
goto fr_destroy;
local->ctx = ctx;
local->contri = contri;
- ret = get_lock_on_parent (frame, this);
+ ret = mq_get_lock_on_parent (frame, this);
if (ret == -1)
goto err;
@@ -1886,7 +1886,7 @@ err:
int
-initiate_quota_txn (xlator_t *this, loc_t *loc)
+mq_initiate_quota_txn (xlator_t *this, loc_t *loc)
{
int32_t ret = -1;
gf_boolean_t status = _gf_false;
@@ -1897,7 +1897,7 @@ initiate_quota_txn (xlator_t *this, loc_t *loc)
GF_VALIDATE_OR_GOTO ("marker", loc, out);
GF_VALIDATE_OR_GOTO ("marker", loc->inode, out);
- ret = quota_inode_ctx_get (loc->inode, this, &ctx);
+ ret = mq_inode_ctx_get (loc->inode, this, &ctx);
if (ret == -1) {
gf_log (this->name, GF_LOG_WARNING,
"inode ctx get failed, aborting quota txn");
@@ -1905,7 +1905,7 @@ initiate_quota_txn (xlator_t *this, loc_t *loc)
goto out;
}
- contribution = get_contribution_node (loc->parent, ctx);
+ contribution = mq_get_contribution_node (loc->parent, ctx);
if (contribution == NULL)
goto out;
@@ -1919,7 +1919,7 @@ initiate_quota_txn (xlator_t *this, loc_t *loc)
goto out;
if (status == _gf_false) {
- start_quota_txn (this, loc, ctx, contribution);
+ mq_start_quota_txn (this, loc, ctx, contribution);
}
ret = 0;
@@ -1933,7 +1933,7 @@ out:
/* int64_t contribution) */
/* { */
/* if (size != contribution) { */
-/* initiate_quota_txn (this, loc); */
+/* mq_initiate_quota_txn (this, loc); */
/* } */
/* return 0; */
@@ -1941,10 +1941,10 @@ out:
int32_t
-inspect_directory_xattr (xlator_t *this,
- loc_t *loc,
- dict_t *dict,
- struct iatt buf)
+mq_inspect_directory_xattr (xlator_t *this,
+ loc_t *loc,
+ dict_t *dict,
+ struct iatt buf)
{
int32_t ret = 0;
int8_t dirty = -1;
@@ -1955,12 +1955,12 @@ inspect_directory_xattr (xlator_t *this,
quota_inode_ctx_t *ctx = NULL;
inode_contribution_t *contribution = NULL;
- ret = quota_inode_ctx_get (loc->inode, this, &ctx);
+ ret = mq_inode_ctx_get (loc->inode, this, &ctx);
if (ret < 0) {
- ctx = quota_inode_ctx_new (loc->inode, this);
+ ctx = mq_inode_ctx_new (loc->inode, this);
if (ctx == NULL) {
gf_log (this->name, GF_LOG_WARNING,
- "quota_inode_ctx_new failed");
+ "mq_inode_ctx_new failed");
ret = -1;
goto out;
}
@@ -1977,7 +1977,7 @@ inspect_directory_xattr (xlator_t *this,
if (strcmp (loc->path, "/") != 0) {
not_root = _gf_true;
- contribution = add_new_contribution_node (this, ctx, loc);
+ contribution = mq_add_new_contribution_node (this, ctx, loc);
if (contribution == NULL) {
gf_log (this->name, GF_LOG_DEBUG,
"cannot add a new contributio node");
@@ -2012,27 +2012,27 @@ inspect_directory_xattr (xlator_t *this,
" contri=%"PRId64, size_int, contri_int);
if (dirty) {
- ret = update_dirty_inode (this, loc, ctx, contribution);
+ ret = mq_update_dirty_inode (this, loc, ctx, contribution);
}
if ((!dirty || ret == 0) && (not_root == _gf_true) &&
(size_int != contri_int)) {
- initiate_quota_txn (this, loc);
+ mq_initiate_quota_txn (this, loc);
}
ret = 0;
out:
if (ret)
- quota_set_inode_xattr (this, loc);
+ mq_set_inode_xattr (this, loc);
return 0;
}
int32_t
-inspect_file_xattr (xlator_t *this,
- loc_t *loc,
- dict_t *dict,
- struct iatt buf)
+mq_inspect_file_xattr (xlator_t *this,
+ loc_t *loc,
+ dict_t *dict,
+ struct iatt buf)
{
int32_t ret = -1;
uint64_t contri_int = 0, size = 0;
@@ -2041,18 +2041,18 @@ inspect_file_xattr (xlator_t *this,
quota_inode_ctx_t *ctx = NULL;
inode_contribution_t *contribution = NULL;
- ret = quota_inode_ctx_get (loc->inode, this, &ctx);
+ ret = mq_inode_ctx_get (loc->inode, this, &ctx);
if (ret < 0) {
- ctx = quota_inode_ctx_new (loc->inode, this);
+ ctx = mq_inode_ctx_new (loc->inode, this);
if (ctx == NULL) {
gf_log (this->name, GF_LOG_WARNING,
- "quota_inode_ctx_new failed");
+ "mq_inode_ctx_new failed");
ret = -1;
goto out;
}
}
- contribution = add_new_contribution_node (this, ctx, loc);
+ contribution = mq_add_new_contribution_node (this, ctx, loc);
if (contribution == NULL)
goto out;
@@ -2084,10 +2084,10 @@ inspect_file_xattr (xlator_t *this,
"size=%"PRId64 " contri=%"PRId64, size, contri_int);
if (size != contri_int) {
- initiate_quota_txn (this, loc);
+ mq_initiate_quota_txn (this, loc);
}
} else
- initiate_quota_txn (this, loc);
+ mq_initiate_quota_txn (this, loc);
}
out:
@@ -2095,24 +2095,24 @@ out:
}
int32_t
-quota_xattr_state (xlator_t *this,
- loc_t *loc,
- dict_t *dict,
- struct iatt buf)
+mq_xattr_state (xlator_t *this,
+ loc_t *loc,
+ dict_t *dict,
+ struct iatt buf)
{
if (buf.ia_type == IA_IFREG ||
buf.ia_type == IA_IFLNK) {
- inspect_file_xattr (this, loc, dict, buf);
+ mq_inspect_file_xattr (this, loc, dict, buf);
} else if (buf.ia_type == IA_IFDIR)
- inspect_directory_xattr (this, loc, dict, buf);
+ mq_inspect_directory_xattr (this, loc, dict, buf);
return 0;
}
int32_t
-quota_req_xattr (xlator_t *this,
- loc_t *loc,
- dict_t *dict)
+mq_req_xattr (xlator_t *this,
+ loc_t *loc,
+ dict_t *dict)
{
int32_t ret = -1;
@@ -2124,7 +2124,7 @@ quota_req_xattr (xlator_t *this,
if (strcmp (loc->path, "/") == 0)
goto set_size;
- ret = dict_set_contribution (this, dict, loc);
+ ret = mq_dict_set_contribution (this, dict, loc);
if (ret == -1)
goto out;
@@ -2149,8 +2149,8 @@ out:
int32_t
-quota_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno)
+mq_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno)
{
QUOTA_STACK_DESTROY (frame, this);
@@ -2158,8 +2158,8 @@ quota_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
int32_t
-quota_inode_remove_done (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno)
+_mq_inode_remove_done (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno)
{
int32_t ret = 0;
char contri_key [512] = {0, };
@@ -2168,7 +2168,7 @@ quota_inode_remove_done (call_frame_t *frame, void *cookie, xlator_t *this,
local = (quota_local_t *) frame->local;
if (op_ret == -1 || local->err == -1) {
- quota_removexattr_cbk (frame, NULL, this, -1, 0);
+ mq_removexattr_cbk (frame, NULL, this, -1, 0);
return 0;
}
@@ -2177,23 +2177,23 @@ quota_inode_remove_done (call_frame_t *frame, void *cookie, xlator_t *this,
if (local->hl_count > 1) {
GET_CONTRI_KEY (contri_key, local->contri->gfid, ret);
- STACK_WIND (frame, quota_removexattr_cbk, FIRST_CHILD(this),
+ STACK_WIND (frame, mq_removexattr_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->removexattr,
&local->loc, contri_key);
ret = 0;
} else {
- quota_removexattr_cbk (frame, NULL, this, 0, 0);
+ mq_removexattr_cbk (frame, NULL, this, 0, 0);
}
if (strcmp (local->parent_loc.path, "/") != 0) {
- ret = get_parent_inode_local (this, local);
+ ret = mq_get_parent_inode_local (this, local);
if (ret < 0)
goto out;
- start_quota_txn (this, &local->loc, local->ctx, local->contri);
+ mq_start_quota_txn (this, &local->loc, local->ctx, local->contri);
}
out:
- quota_local_unref (this, local);
+ mq_local_unref (this, local);
return 0;
}
@@ -2212,7 +2212,7 @@ mq_inode_remove_done (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1)
local->err = -1;
- ret = quota_inode_ctx_get (local->parent_loc.inode, this, &ctx);
+ ret = mq_inode_ctx_get (local->parent_loc.inode, this, &ctx);
LOCK (&local->contri->lock);
{
@@ -2243,7 +2243,7 @@ mq_inode_remove_done (call_frame_t *frame, void *cookie, xlator_t *this,
lock.l_pid = 0;
STACK_WIND (frame,
- quota_inode_remove_done,
+ _mq_inode_remove_done,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->inodelk,
this->name, &local->parent_loc,
@@ -2300,7 +2300,7 @@ err:
}
int32_t
-reduce_parent_size (xlator_t *this, loc_t *loc, int64_t contri)
+mq_reduce_parent_size (xlator_t *this, loc_t *loc, int64_t contri)
{
int32_t ret = -1;
struct gf_flock lock = {0,};
@@ -2312,15 +2312,15 @@ reduce_parent_size (xlator_t *this, loc_t *loc, int64_t contri)
GF_VALIDATE_OR_GOTO ("marker", this, out);
GF_VALIDATE_OR_GOTO ("marker", loc, out);
- ret = quota_inode_ctx_get (loc->inode, this, &ctx);
+ ret = mq_inode_ctx_get (loc->inode, this, &ctx);
if (ret < 0)
goto out;
- contribution = get_contribution_node (loc->parent, ctx);
+ contribution = mq_get_contribution_node (loc->parent, ctx);
if (contribution == NULL)
goto out;
- local = quota_local_new ();
+ local = mq_local_new ();
if (local == NULL) {
ret = -1;
goto out;
@@ -2348,7 +2348,7 @@ reduce_parent_size (xlator_t *this, loc_t *loc, int64_t contri)
local->ctx = ctx;
local->contri = contribution;
- ret = quota_inode_loc_fill (NULL, loc->parent, &local->parent_loc);
+ ret = mq_inode_loc_fill (NULL, loc->parent, &local->parent_loc);
if (ret < 0)
goto out;
@@ -2384,7 +2384,7 @@ reduce_parent_size (xlator_t *this, loc_t *loc, int64_t contri)
out:
if (local != NULL)
- quota_local_unref (this, local);
+ mq_local_unref (this, local);
return ret;
}
@@ -2398,7 +2398,7 @@ init_quota_priv (xlator_t *this)
int32_t
-quota_rename_update_newpath (xlator_t *this, loc_t *loc)
+mq_rename_update_newpath (xlator_t *this, loc_t *loc)
{
int32_t ret = -1;
quota_inode_ctx_t *ctx = NULL;
@@ -2408,23 +2408,23 @@ quota_rename_update_newpath (xlator_t *this, loc_t *loc)
GF_VALIDATE_OR_GOTO ("marker", loc, out);
GF_VALIDATE_OR_GOTO ("marker", loc->inode, out);
- ret = quota_inode_ctx_get (loc->inode, this, &ctx);
+ ret = mq_inode_ctx_get (loc->inode, this, &ctx);
if (ret < 0)
goto out;
- contribution = add_new_contribution_node (this, ctx, loc);
+ contribution = mq_add_new_contribution_node (this, ctx, loc);
if (contribution == NULL) {
ret = -1;
goto out;
}
- initiate_quota_txn (this, loc);
+ mq_initiate_quota_txn (this, loc);
out:
return ret;
}
int32_t
-quota_forget (xlator_t *this, quota_inode_ctx_t *ctx)
+mq_forget (xlator_t *this, quota_inode_ctx_t *ctx)
{
inode_contribution_t *contri = NULL;
inode_contribution_t *next = NULL;
diff --git a/xlators/features/marker/src/marker-quota.h b/xlators/features/marker/src/marker-quota.h
index 9633533b3..7a90b28b7 100644
--- a/xlators/features/marker/src/marker-quota.h
+++ b/xlators/features/marker/src/marker-quota.h
@@ -42,7 +42,7 @@
_local = _frame->local; \
_frame->local = NULL; \
STACK_DESTROY (_frame->root); \
- quota_local_unref (_this, _local); \
+ mq_local_unref (_this, _local); \
} while (0)
@@ -127,36 +127,36 @@ struct quota_local {
typedef struct quota_local quota_local_t;
int32_t
-get_lock_on_parent (call_frame_t *, xlator_t *);
+mq_get_lock_on_parent (call_frame_t *, xlator_t *);
int32_t
-quota_req_xattr (xlator_t *, loc_t *, dict_t *);
+mq_req_xattr (xlator_t *, loc_t *, dict_t *);
int32_t
init_quota_priv (xlator_t *);
int32_t
-quota_xattr_state (xlator_t *, loc_t *, dict_t *, struct iatt);
+mq_xattr_state (xlator_t *, loc_t *, dict_t *, struct iatt);
int32_t
-quota_set_inode_xattr (xlator_t *, loc_t *);
+mq_set_inode_xattr (xlator_t *, loc_t *);
int
-initiate_quota_txn (xlator_t *, loc_t *);
+mq_initiate_quota_txn (xlator_t *, loc_t *);
int32_t
-quota_dirty_inode_readdir (call_frame_t *, void *, xlator_t *,
- int32_t, int32_t, fd_t *);
+mq_dirty_inode_readdir (call_frame_t *, void *, xlator_t *,
+ int32_t, int32_t, fd_t *);
int32_t
-reduce_parent_size (xlator_t *, loc_t *, int64_t);
+mq_reduce_parent_size (xlator_t *, loc_t *, int64_t);
int32_t
-quota_rename_update_newpath (xlator_t *, loc_t *);
+mq_rename_update_newpath (xlator_t *, loc_t *);
int32_t
-inspect_file_xattr (xlator_t *this, loc_t *loc, dict_t *dict, struct iatt buf);
+mq_inspect_file_xattr (xlator_t *this, loc_t *loc, dict_t *dict, struct iatt buf);
int32_t
-quota_forget (xlator_t *, quota_inode_ctx_t *);
+mq_forget (xlator_t *, quota_inode_ctx_t *);
#endif
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 2c60c3d50..5299d2254 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -468,7 +468,7 @@ marker_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- quota_set_inode_xattr (this, &local->loc);
+ mq_set_inode_xattr (this, &local->loc);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -539,7 +539,7 @@ marker_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- inspect_file_xattr (this, &local->loc, NULL, *buf);
+ mq_inspect_file_xattr (this, &local->loc, NULL, *buf);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -609,7 +609,7 @@ marker_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- initiate_quota_txn (this, &local->loc);
+ mq_initiate_quota_txn (this, &local->loc);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -684,7 +684,7 @@ marker_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- reduce_parent_size (this, &local->loc, -1);
+ mq_reduce_parent_size (this, &local->loc, -1);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -751,7 +751,7 @@ marker_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if ((priv->feature_enabled & GF_QUOTA) && (local->ia_nlink == 1))
- reduce_parent_size (this, &local->loc, -1);
+ mq_reduce_parent_size (this, &local->loc, -1);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -853,7 +853,7 @@ marker_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- initiate_quota_txn (this, &local->loc);
+ mq_initiate_quota_txn (this, &local->loc);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -930,10 +930,10 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this,
NULL, NULL, NULL);
}
- reduce_parent_size (this, &oplocal->loc, oplocal->contribution);
+ mq_reduce_parent_size (this, &oplocal->loc, oplocal->contribution);
if (local->loc.inode != NULL) {
- reduce_parent_size (this, &local->loc, local->contribution);
+ mq_reduce_parent_size (this, &local->loc, local->contribution);
}
newloc.inode = inode_ref (oplocal->loc.inode);
@@ -944,7 +944,7 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this,
newloc.parent = inode_ref (local->loc.parent);
newloc.ino = oplocal->loc.inode->ino;
- quota_rename_update_newpath (this, &newloc);
+ mq_rename_update_newpath (this, &newloc);
loc_wipe (&newloc);
@@ -1398,11 +1398,11 @@ marker_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
goto rename_wind;
}
- ret = quota_inode_loc_fill (NULL, newloc->parent, &local->parent_loc);
+ ret = mq_inode_loc_fill (NULL, newloc->parent, &local->parent_loc);
if (ret < 0)
goto err;
- ret = quota_inode_loc_fill (NULL, oldloc->parent, &oplocal->parent_loc);
+ ret = mq_inode_loc_fill (NULL, oldloc->parent, &oplocal->parent_loc);
if (ret < 0)
goto err;
@@ -1472,7 +1472,7 @@ marker_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- initiate_quota_txn (this, &local->loc);
+ mq_initiate_quota_txn (this, &local->loc);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -1540,7 +1540,7 @@ marker_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- initiate_quota_txn (this, &local->loc);
+ mq_initiate_quota_txn (this, &local->loc);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -1608,7 +1608,7 @@ marker_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA)
- inspect_file_xattr (this, &local->loc, NULL, *buf);
+ mq_inspect_file_xattr (this, &local->loc, NULL, *buf);
if (priv->feature_enabled & GF_XTIME)
marker_xtime_update_marks (this, local);
@@ -1677,7 +1677,7 @@ marker_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if ((priv->feature_enabled & GF_QUOTA) && (S_ISREG (local->mode))) {
- inspect_file_xattr (this, &local->loc, NULL, *buf);
+ mq_inspect_file_xattr (this, &local->loc, NULL, *buf);
}
if (priv->feature_enabled & GF_XTIME)
@@ -2140,7 +2140,7 @@ marker_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
priv = this->private;
if (priv->feature_enabled & GF_QUOTA) {
- quota_xattr_state (this, &local->loc, dict, *buf);
+ mq_xattr_state (this, &local->loc, dict, *buf);
}
out:
@@ -2171,7 +2171,7 @@ marker_lookup (call_frame_t *frame, xlator_t *this,
goto err;
if ((priv->feature_enabled & GF_QUOTA) && xattr_req)
- quota_req_xattr (this, loc, xattr_req);
+ mq_req_xattr (this, loc, xattr_req);
wind:
STACK_WIND (frame, marker_lookup_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, loc, xattr_req);
@@ -2442,7 +2442,7 @@ marker_forget (xlator_t *this, inode_t *inode)
goto out;
}
- quota_forget (this, ctx->quota_ctx);
+ mq_forget (this, ctx->quota_ctx);
GF_FREE (ctx);
out: