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>
This commit is contained in:
parent
a0695e0524
commit
5efdbef0d7
@ -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"
|
||||
|
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user