diff options
| author | Amar Tumballi <amarts@redhat.com> | 2012-11-13 01:14:43 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2012-12-19 23:35:29 -0800 | 
| commit | 000e65d7af7be31236e060064fb3b4a332e78cf3 (patch) | |
| tree | ff9e3ca119d8c43b9a12402fe1de84d8142f105a /xlators/protocol/server/src/server-rpc-fops.c | |
| parent | e5a19e2ab587175c91fde0f0c33319dcbff73018 (diff) | |
core: remove all the 'inner' functions in codebase
* move 'dict_keys_join()' from api/glfs_fops.c to libglusterfs/dict.c
  - also added an argument which is treated as a filter function if
    required, currently useful for fuse.
* now 'make CFLAGS="-std=gnu99 -pedantic" 2>&1 | grep nested' gives
  no output.
Change-Id: I4e18496fbd93ae1d3942026ef4931889cba015e8
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 875913
Reviewed-on: http://review.gluster.org/4187
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server-rpc-fops.c')
| -rw-r--r-- | xlators/protocol/server/src/server-rpc-fops.c | 76 | 
1 files changed, 51 insertions, 25 deletions
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c index 286befc4e..f44ced41d 100644 --- a/xlators/protocol/server/src/server-rpc-fops.c +++ b/xlators/protocol/server/src/server-rpc-fops.c @@ -890,6 +890,24 @@ out:          return 0;  } +/* print every key */ +static int +_gf_server_log_setxattr_failure (dict_t *d, char *k, data_t *v, +                                 void *tmp) +{ +        server_state_t *state = NULL; +        call_frame_t   *frame = NULL; + +        frame = tmp; +        state = CALL_STATE(frame); + +        gf_log (THIS->name, GF_LOG_INFO, +                "%"PRId64": SETXATTR %s (%s) ==> %s", +                frame->root->unique, state->loc.path, +                uuid_utoa (state->resolve.gfid), k); +        return 0; +} +  int  server_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                       int32_t op_ret, int32_t op_errno, dict_t *xdata) @@ -905,19 +923,14 @@ server_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                                      rsp.xdata.xdata_len, op_errno, out);          if (op_ret == -1) { -                /* print every key */ -                int _log_setxattr_failure (dict_t *d, char *k, data_t *v, -                                           void *tmp) -                { -                        gf_log (this->name, ((op_errno == ENOTSUP) ? -                                             GF_LOG_DEBUG : GF_LOG_INFO), -                                "%"PRId64": SETXATTR %s (%s) ==> %s (%s)", -                                frame->root->unique, state->loc.path, -                                uuid_utoa (state->resolve.gfid), k, -                                strerror (op_errno)); -                        return 0; -                } -                dict_foreach (state->dict, _log_setxattr_failure, NULL); +                if (op_errno != ENOTSUP) +                        dict_foreach (state->dict, +                                      _gf_server_log_setxattr_failure, +                                      frame); + +                gf_log (THIS->name, ((op_errno == ENOTSUP) ? +                                     GF_LOG_DEBUG : GF_LOG_INFO), +                        "%s", strerror (op_errno));                  goto out;          } @@ -933,6 +946,24 @@ out:          return 0;  } +/* print every key here */ +static int +_gf_server_log_fsetxattr_failure (dict_t *d, char *k, data_t *v, +                                 void *tmp) +{ +        call_frame_t   *frame = NULL; +        server_state_t *state = NULL; + +        frame = tmp; +        state = CALL_STATE(frame); + +        gf_log (THIS->name, GF_LOG_INFO, +                "%"PRId64": FSETXATTR %"PRId64" (%s) ==> %s", +                frame->root->unique, state->resolve.fd_no, +                uuid_utoa (state->resolve.gfid), k); + +        return 0; +}  int  server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, @@ -949,19 +980,14 @@ server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                                      rsp.xdata.xdata_len, op_errno, out);          if (op_ret == -1) { -                /* print every key here */ -                int _log_setxattr_failure (dict_t *d, char *k, data_t *v, -                                           void *tmp) -                { -                        gf_log (this->name, ((op_errno == ENOTSUP) ? -                                             GF_LOG_DEBUG : GF_LOG_INFO), -                                "%"PRId64": FSETXATTR %"PRId64" (%s) ==> %s (%s)", -                                frame->root->unique, state->resolve.fd_no, -                                uuid_utoa (state->resolve.gfid), k, -                                strerror (op_errno)); -                        return 0; +                if (op_errno != ENOTSUP) { +                        dict_foreach (state->dict, +                                      _gf_server_log_fsetxattr_failure, +                                      frame);                  } -                dict_foreach (state->dict, _log_setxattr_failure, NULL); +                gf_log (THIS->name, ((op_errno == ENOTSUP) ? +                                     GF_LOG_DEBUG : GF_LOG_INFO), +                        "%s", strerror (op_errno));                  goto out;          }  | 
