diff options
Diffstat (limited to 'xlators/performance/io-threads')
| -rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 31 | ||||
| -rw-r--r-- | xlators/performance/io-threads/src/io-threads.h | 8 | 
2 files changed, 31 insertions, 8 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 06ad0c2aae5..7f9dc5f82a8 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -278,6 +278,9 @@ iot_get_pri_meaning (iot_pri_t pri)          case IOT_PRI_MAX:                  name = "invalid";                  break; +        case IOT_PRI_UNSPEC: +                name = "unspecified"; +                break;          }          return name;  } @@ -610,6 +613,34 @@ int  iot_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,                const char *name, dict_t *xdata)  { +        iot_conf_t *conf = NULL; +        dict_t     *depths = NULL; +        int i = 0; + +        conf = this->private; + +        if (conf && name && strcmp (name, IO_THREADS_QUEUE_SIZE_KEY) == 0) { +                // We explicitly do not want a reference count +                // for this dict in this translator +                depths = get_new_dict (); +                if (!depths) +                        goto unwind_special_getxattr; + +                for (i = 0; i < IOT_PRI_MAX; i++) { +                        if (dict_set_int32 (depths, +                                            (char *)fop_pri_to_string (i), +                                            conf->queue_sizes[i]) != 0) { +                                dict_destroy (depths); +                                depths = NULL; +                                goto unwind_special_getxattr; +                        } +                } + +unwind_special_getxattr: +                STACK_UNWIND_STRICT (getxattr, frame, 0, 0, depths, xdata); +                return 0; +        } +          IOT_FOP (getxattr, frame, this, loc, name, xdata);          return 0;  } diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h index 673e1967617..011d4a00f7f 100644 --- a/xlators/performance/io-threads/src/io-threads.h +++ b/xlators/performance/io-threads/src/io-threads.h @@ -42,14 +42,6 @@ struct iot_conf;  #define IOT_THREAD_STACK_SIZE   ((size_t)(1024*1024)) -typedef enum { -        IOT_PRI_HI = 0, /* low latency */ -        IOT_PRI_NORMAL, /* normal */ -        IOT_PRI_LO,     /* bulk */ -        IOT_PRI_LEAST,  /* least */ -        IOT_PRI_MAX, -} iot_pri_t; -  #define IOT_LEAST_THROTTLE_DELAY 1	/* sample interval in seconds */  struct iot_least_throttle {  	struct timeval	sample_time;	/* timestamp of current sample */  | 
