summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorVarsha Rao <varao@redhat.com>2018-02-06 18:56:45 +0530
committerJeff Darcy <jeff@pl.atyp.us>2018-02-08 17:01:12 +0000
commitaa4372bf427152f671de52fc6e02b93ca09f22c7 (patch)
tree8c07cb7c3a9ad8122be3b7db403726dd7749c2ed /libglusterfs
parent5e751b4c05375aa8b0f217ca73629d7d43faccf6 (diff)
performance/io-threads: expose io-thread queue depths
The following release-3.8-fb branch patch is upstreamed: > io-stats: Expose io-thread queue depths > Commit ID: 69509ee7d2 > https://review.gluster.org/#/c/18143/ > By Shreyas Siravara <sshreyas@fb.com> Changes in this patch: - Replace iot_pri_t with gf_fop_pri_t - Replace IOT_PRI_{HI, LO, NORMAL, MAX, LEAST} with GF_FOP_PRI_{HI, LO, NORMAL, MAX, LEAST} - Use dict_unref() instead of dict_destroy() This patch is required to forward port io-threads namespace patch. Updates: #401 Change-Id: I1b47a63185a441a30fbc423ca1015df7b36c2518 Signed-off-by: Varsha Rao <varao@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/dict.h4
-rw-r--r--libglusterfs/src/glusterfs.h37
2 files changed, 40 insertions, 1 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index ab8a8a56352..1ce055a5940 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -62,6 +62,8 @@ typedef struct _data_pair data_pair_t;
#define DICT_KEY_VALUE_MAX_SIZE 1048576
+#define dict_for_each(d, c) for (c = d->members_list; c; c = c->next)
+
struct _data {
unsigned char is_static:1;
unsigned char is_const:1;
@@ -160,8 +162,8 @@ data_t *data_from_uint16 (uint16_t value);
char *data_to_str (data_t *data);
void *data_to_bin (data_t *data);
void *data_to_ptr (data_t *data);
-
data_t * data_copy (data_t *old);
+
int dict_foreach (dict_t *this,
int (*fn)(dict_t *this,
char *key,
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 438ce059fad..d702a5fa9ba 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -85,6 +85,7 @@
#define ZR_STRICT_VOLFILE_CHECK "strict-volfile-check"
#define ZR_DUMP_FUSE "dump-fuse"
#define ZR_FUSE_MOUNTOPTS "fuse-mountopts"
+#define IO_THREADS_QUEUE_SIZE_KEY "io-thread-queue-size"
#define GF_XATTR_CLRLK_CMD "glusterfs.clrlk"
#define GF_XATTR_PATHINFO_KEY "trusted.glusterfs.pathinfo"
@@ -308,6 +309,42 @@
#define GF_LK_MANDATORY 1 /* maps to GLFS_LK_MANDATORY from libgfapi*/
#define GF_LOCK_MODE "glusterfs.lk.lkmode"
+#define GF_CHECK_XATTR_KEY_AND_GOTO(key, cmpkey, errval, lbl) \
+ do { \
+ if (key && strcmp (key, cmpkey) == 0) { \
+ errval = -EINVAL; \
+ goto lbl; \
+ } \
+ } while (0) \
+
+
+typedef enum {
+ GF_FOP_PRI_UNSPEC = -1, /* Priority not specified */
+ GF_FOP_PRI_HI = 0, /* low latency */
+ GF_FOP_PRI_NORMAL, /* normal */
+ GF_FOP_PRI_LO, /* bulk */
+ GF_FOP_PRI_LEAST, /* least */
+ GF_FOP_PRI_MAX, /* Highest */
+} gf_fop_pri_t;
+
+static const char * const FOP_PRI_STRINGS[] = {
+ "HIGH",
+ "NORMAL",
+ "LOW",
+ "LEAST"
+};
+
+static inline const char *fop_pri_to_string (gf_fop_pri_t pri)
+{
+ if (pri < 0)
+ return "UNSPEC";
+
+ if (pri >= GF_FOP_PRI_MAX)
+ return "INVALID";
+
+ return FOP_PRI_STRINGS[pri];
+}
+
const char *fop_enum_to_pri_string (glusterfs_fop_t fop);
#define GF_SET_IF_NOT_PRESENT 0x1 /* default behaviour */