diff options
Diffstat (limited to 'xlators/performance/quick-read/src')
| -rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 35 | 
1 files changed, 35 insertions, 0 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 2c54b559e7c..5c6bfc9c3be 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -18,6 +18,7 @@  */  #include "quick-read.h" +#include "statedump.h"  int32_t  qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, @@ -2127,6 +2128,36 @@ qr_forget (xlator_t *this, inode_t *inode)          return 0;  } +int +qr_priv_dump (xlator_t *this) +{ +        qr_conf_t       *conf = NULL; +        char            key[GF_DUMP_MAX_BUF_LEN]; +        char            key_prefix[GF_DUMP_MAX_BUF_LEN]; + +        if (!this) +                return -1; + +        conf = this->private; +        if (!conf) { +                gf_log (this->name, GF_LOG_WARNING, +                        "conf null in xlator"); +                return -1; +        } + +        gf_proc_dump_build_key (key_prefix, +                                "xlator.performance.quick-read", +                                "priv"); + +        gf_proc_dump_add_section (key_prefix); + +        gf_proc_dump_build_key (key, key_prefix, "max_file_size"); +        gf_proc_dump_write (key, "%d", conf->max_file_size); +        gf_proc_dump_build_key (key, key_prefix, "cache_timeout"); +        gf_proc_dump_write (key, "%d", conf->cache_timeout); + +        return 0; +}  int32_t   init (xlator_t *this) @@ -2227,6 +2258,10 @@ struct xlator_cbks cbks = {          .release = qr_release,   }; +struct xlator_dumpops dumpops = { +        .priv      =  qr_priv_dump, +}; +  struct volume_options options[] = {          { .key  = {"cache-timeout"},             .type = GF_OPTION_TYPE_INT,  | 
