diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-08-02 13:14:25 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-08-03 02:01:52 -0700 |
commit | ed4b76ba9c545f577287c0e70ae3cc853a0d5f3f (patch) | |
tree | deffb91a0cee620ac7fcc8c7914dbca73668574e /xlators/nfs/server/src | |
parent | 66205114267ec659b4ad8084c7e9497009529c61 (diff) |
core: reduce the usage of global variables
* move all the 'logging' related global variables into ctx
* make gf_fop_list a 'const' global array, hence no init(),
no edits.
* make sure ctx is allocated without any dependancy on
memory-accounting infrastructure, so it can be the first
one to get allocated
* globals_init() should happen with ctx as argument
not yet fixed below in this patchset:
* anything with 'THIS' related globals
* anything related to compat_errno related globals as its
one time init'd and not changed later on.
* statedump related globals
Change-Id: Iab8fc30d4bfdbded6741d66ff1ed670fdc7b7ad2
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 764890
Reviewed-on: http://review.gluster.com/3767
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src')
-rw-r--r-- | xlators/nfs/server/src/nfs3-helpers.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index e2c16ef0e95..253fe075410 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -1619,7 +1619,7 @@ nfs3_log_common_call (uint32_t xid, char *op, struct nfs3_fh *fh) { char fhstr[1024]; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, fhstr); @@ -1634,7 +1634,7 @@ nfs3_log_fh_entry_call (uint32_t xid, char *op, struct nfs3_fh *fh, { char fhstr[1024]; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, fhstr); gf_log (GF_NFS3, GF_LOG_DEBUG, "XID: %x, %s: args: %s, name: %s", xid, @@ -1649,7 +1649,7 @@ nfs3_log_rename_call (uint32_t xid, struct nfs3_fh *src, char *sname, char sfhstr[1024]; char dfhstr[1024]; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (src, sfhstr); nfs3_fh_to_str (dst, dfhstr); @@ -1670,7 +1670,7 @@ nfs3_log_create_call (uint32_t xid, struct nfs3_fh *fh, char *name, char unchkd[] = "UNCHECKED"; char guarded[] = "GUARDED"; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, fhstr); if (mode == EXCLUSIVE) @@ -1695,7 +1695,7 @@ nfs3_log_mknod_call (uint32_t xid, struct nfs3_fh *fh, char *name, int type) char sock[] = "SOCK"; char fifo[] = "FIFO"; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, fhstr); if (type == NF3CHR) @@ -1718,7 +1718,7 @@ nfs3_log_symlink_call (uint32_t xid, struct nfs3_fh *fh, char *name, char *tgt) { char fhstr[1024]; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, fhstr); gf_log (GF_NFS3, GF_LOG_DEBUG, "XID: %x, SYMLINK: args: %s, name: %s," @@ -1733,7 +1733,7 @@ nfs3_log_link_call (uint32_t xid, struct nfs3_fh *fh, char *name, char dfhstr[1024]; char tfhstr[1024]; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, dfhstr); nfs3_fh_to_str (tgt, tfhstr); @@ -1748,7 +1748,7 @@ nfs3_log_rw_call (uint32_t xid, char *op, struct nfs3_fh *fh, offset3 offt, { char fhstr[1024]; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, fhstr); if (stablewrite == -1) @@ -3383,7 +3383,7 @@ nfs3_log_common_res (uint32_t xid, int op, nfsstat3 stat, int pstat) char errstr[1024]; int ll = nfs3_loglevel (op, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, nfs3op_strings[op].str, stat, pstat, errstr); gf_log (GF_NFS3, ll, "%s", errstr); @@ -3395,7 +3395,7 @@ nfs3_log_readlink_res (uint32_t xid, nfsstat3 stat, int pstat, char *linkpath) char errstr[1024]; int ll = nfs3_loglevel (NFS3_READLINK, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, "READLINK", stat, pstat, errstr); @@ -3412,7 +3412,7 @@ nfs3_log_read_res (uint32_t xid, nfsstat3 stat, int pstat, count3 count, int ll = GF_LOG_DEBUG; ll = nfs3_loglevel (NFS3_READ, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, "READ", stat, pstat, errstr); if (vec) @@ -3432,7 +3432,7 @@ nfs3_log_write_res (uint32_t xid, nfsstat3 stat, int pstat, count3 count, char errstr[1024]; int ll = nfs3_loglevel (NFS3_WRITE, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, "WRITE", stat, pstat, errstr); @@ -3450,7 +3450,7 @@ nfs3_log_newfh_res (uint32_t xid, int op, nfsstat3 stat, int pstat, char fhstr[1024]; int ll = nfs3_loglevel (op, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, nfs3op_strings[op].str, stat, pstat, errstr); nfs3_fh_to_str (newfh, fhstr); @@ -3466,7 +3466,7 @@ nfs3_log_readdir_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf, char errstr[1024]; int ll = nfs3_loglevel (NFS3_READDIR, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, "READDIR", stat, pstat, errstr); gf_log (GF_NFS3, ll, "%s, count: %"PRIu32", cverf: %"PRIu64 @@ -3481,7 +3481,7 @@ nfs3_log_readdirp_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf, char errstr[1024]; int ll = nfs3_loglevel (NFS3_READDIRP, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, "READDIRPLUS", stat, pstat, errstr); gf_log (GF_NFS3, ll, "%s, dircount: %"PRIu32", maxcount: %" @@ -3496,7 +3496,7 @@ nfs3_log_commit_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t wverf) char errstr[1024]; int ll = nfs3_loglevel (NFS3_COMMIT, stat); - if (gf_log_loglevel < ll) + if (THIS->ctx->log.loglevel < ll) return; nfs3_stat_to_errstr (xid, "COMMIT", stat, pstat, errstr); gf_log (GF_NFS3, ll, "%s, wverf: %"PRIu64, errstr, wverf); @@ -3509,7 +3509,7 @@ nfs3_log_readdir_call (uint32_t xid, struct nfs3_fh *fh, count3 dircount, { char fhstr[1024]; - if (gf_log_loglevel < GF_LOG_DEBUG) + if (THIS->ctx->log.loglevel < GF_LOG_DEBUG) return; nfs3_fh_to_str (fh, fhstr); |