diff options
| author | Amar Tumballi <amarts@redhat.com> | 2019-05-29 17:54:45 +0530 | 
|---|---|---|
| committer | Xavi Hernandez <xhernandez@redhat.com> | 2019-05-30 07:35:21 +0000 | 
| commit | 002f4736cd470c20f427d8c25916abb4b95c9240 (patch) | |
| tree | b2968d6a7a3db6c9b74faa0a1e746351f0bf7736 | |
| parent | 71caf1423fe5f0eed652210f8158c95fc8a10219 (diff) | |
marker: remove some unused functions
After basic analysis, found that these methods were not being
used at all.
updates: bz#1693692
Change-Id: If9cfa1ab189e6e7b56230c4e1d8e11f9694a9a65
Signed-off-by: Amar Tumballi <amarts@redhat.com>
| -rw-r--r-- | xlators/features/marker/src/marker-common.c | 7 | ||||
| -rw-r--r-- | xlators/features/marker/src/marker-common.h | 2 | ||||
| -rw-r--r-- | xlators/features/marker/src/marker-quota-helper.c | 93 | ||||
| -rw-r--r-- | xlators/features/marker/src/marker-quota-helper.h | 12 | ||||
| -rw-r--r-- | xlators/features/marker/src/marker-quota.c | 8 | ||||
| -rw-r--r-- | xlators/features/marker/src/marker-quota.h | 9 | ||||
| -rw-r--r-- | xlators/features/marker/src/marker.c | 25 | 
7 files changed, 8 insertions, 148 deletions
diff --git a/xlators/features/marker/src/marker-common.c b/xlators/features/marker/src/marker-common.c index 4989efb13d6..9c9047005d6 100644 --- a/xlators/features/marker/src/marker-common.c +++ b/xlators/features/marker/src/marker-common.c @@ -55,10 +55,3 @@ unlock:      return ret;  } - -int -marker_filter_quota_xattr(dict_t *dict, char *key, data_t *value, void *data) -{ -    dict_del(dict, key); -    return 0; -} diff --git a/xlators/features/marker/src/marker-common.h b/xlators/features/marker/src/marker-common.h index 1b15561ec0b..7f8cffe7d35 100644 --- a/xlators/features/marker/src/marker-common.h +++ b/xlators/features/marker/src/marker-common.h @@ -16,6 +16,4 @@  int32_t  marker_force_inode_ctx_get(inode_t *, xlator_t *, marker_inode_ctx_t **); -int -marker_filter_quota_xattr(dict_t *, char *, data_t *, void *);  #endif diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c index 6edb285b180..ecd85d67b2b 100644 --- a/xlators/features/marker/src/marker-quota-helper.c +++ b/xlators/features/marker/src/marker-quota-helper.c @@ -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; -} diff --git a/xlators/features/marker/src/marker-quota-helper.h b/xlators/features/marker/src/marker-quota-helper.h index 99723def1b9..d4091dd2180 100644 --- a/xlators/features/marker/src/marker-quota-helper.h +++ b/xlators/features/marker/src/marker-quota-helper.h @@ -57,22 +57,10 @@ mq_delete_contribution_node(dict_t *, char *, inode_contribution_t *);  int32_t  mq_inode_loc_fill(const char *, inode_t *, loc_t *); -quota_local_t * -mq_local_new(); - -quota_local_t * -mq_local_ref(quota_local_t *); - -int32_t -mq_local_unref(xlator_t *, quota_local_t *); -  inode_contribution_t *  mq_contri_init(inode_t *inode);  inode_contribution_t *  mq_get_contribution_node(inode_t *, quota_inode_ctx_t *); -inode_contribution_t * -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 dcf03e2f94f..31584f5446b 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -853,12 +853,6 @@ out:  }  int32_t -mq_get_size(xlator_t *this, loc_t *loc, quota_meta_t *size) -{ -    return _mq_get_metadata(this, loc, NULL, size, 0); -} - -int32_t  mq_get_delta(xlator_t *this, loc_t *loc, quota_meta_t *delta,               quota_inode_ctx_t *ctx, inode_contribution_t *contribution)  { @@ -1944,7 +1938,7 @@ mq_update_dirty_inode_task(void *opaque)      /* Inculde for self */      contri_sum.dir_count++; -    ret = mq_get_size(this, loc, &size); +    ret = _mq_get_metadata(this, loc, NULL, &size, 0);      if (ret < 0)          goto out; diff --git a/xlators/features/marker/src/marker-quota.h b/xlators/features/marker/src/marker-quota.h index e6271d77084..4bbf6878b22 100644 --- a/xlators/features/marker/src/marker-quota.h +++ b/xlators/features/marker/src/marker-quota.h @@ -23,15 +23,6 @@  #define QUOTA_KEY_MAX 512  #define READDIR_BUF 4096 -#define QUOTA_STACK_DESTROY(_frame, _this)                                     \ -    do {                                                                       \ -        quota_local_t *_local = NULL;                                          \ -        _local = _frame->local;                                                \ -        _frame->local = NULL;                                                  \ -        STACK_DESTROY(_frame->root);                                           \ -        mq_local_unref(_this, _local);                                         \ -    } while (0) -  #define QUOTA_ALLOC(var, type, ret)                                            \      do {                                                                       \          ret = 0;                                                               \ diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index b6ce42a025e..1375ccc498c 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -242,24 +242,19 @@ out:      return ret;  } -int32_t +void  marker_error_handler(xlator_t *this, marker_local_t *local, int32_t op_errno)  { -    marker_conf_t *priv = NULL; -    const char *path = NULL; - -    priv = (marker_conf_t *)this->private; -    path = local ? (local->loc.path ? local->loc.path -                                    : uuid_utoa(local->loc.gfid)) -                 : "<nul>"; +    marker_conf_t *priv = (marker_conf_t *)this->private; +    const char *path = local ? ((local->loc.path) ? local->loc.path +                                                  : uuid_utoa(local->loc.gfid)) +                             : "<nul>";      gf_log(this->name, GF_LOG_CRITICAL,             "Indexing gone corrupt at %s (reason: %s)."             " Geo-replication slave content needs to be revalidated",             path, strerror(op_errno));      sys_unlink(priv->timestamp_file); - -    return 0;  }  int32_t @@ -567,24 +562,21 @@ marker_specific_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,                               int32_t op_ret, int32_t op_errno, dict_t *xdata)  {      int32_t ret = 0; -    int32_t done = 0; +    int32_t done = 1;      marker_local_t *local = NULL;      local = (marker_local_t *)frame->local;      if (op_ret == -1 && op_errno == ENOSPC) {          marker_error_handler(this, local, op_errno); -        done = 1;          goto out;      }      if (local) {          if (local->loc.path && strcmp(local->loc.path, "/") == 0) { -            done = 1;              goto out;          }          if (__is_root_gfid(local->loc.gfid)) { -            done = 1;              goto out;          }      } @@ -595,14 +587,11 @@ marker_specific_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,          gf_log(this->name, GF_LOG_DEBUG,                 "Error occurred "                 "while traversing to the parent, stopping marker"); - -        done = 1; -          goto out;      }      marker_start_setxattr(frame, this); - +    done = 0;  out:      if (done) {          marker_setxattr_done(frame);  | 
