summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.h
diff options
context:
space:
mode:
authorSanoj Unnikrishnan <sunnikri@redhat.com>2018-02-23 15:26:20 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-03-28 04:07:12 +0000
commit04ede2e1635d664ea18e266544bffc569ae69bb8 (patch)
tree32a8846a0614421f40c22ddc9af88c638a2cb2bb /libglusterfs/src/dict.h
parent7d95a6ff7182e67be8a49f59dbedb892da4a6ae8 (diff)
Quota: heal directory on newly added bricks when quota limit is reached
Problem: if a lookup is done on a newly added brick for a path on which limit has been reached, the lookup fails to heal the directory tree due to quota. Solution: Tag the lookup as an internal fop and ignore it in quota. Since marking internal fop does not usually give enough contextual information. Introducing new flags to pass the contextual info. Adding dict_check_flag and dict_set_flag to aid flag operations. A flag is a single bit in a bit array (currently limited to 256 bits). Change-Id: Ifb6a68bcaffedd425dd0f01f7db24edd5394c095 fixes: bz#1505355 BUG: 1505355 Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
Diffstat (limited to 'libglusterfs/src/dict.h')
-rw-r--r--libglusterfs/src/dict.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index e481330d6b5..d0b05172c2e 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -60,10 +60,13 @@ typedef struct _data_pair data_pair_t;
\
} while (0)
-#define DICT_KEY_VALUE_MAX_SIZE 1048576
-
#define dict_foreach_inline(d, c) for (c = d->members_list; c; c = c->next)
+#define DICT_KEY_VALUE_MAX_SIZE 1048576
+#define DICT_MAX_FLAGS 256
+#define DICT_FLAG_SET 1
+#define DICT_FLAG_CLEAR 0
+
struct _data {
unsigned char is_static:1;
unsigned char is_const:1;
@@ -227,6 +230,10 @@ GF_MUST_CHECK int dict_set_uint32 (dict_t *this, char *key, uint32_t val);
GF_MUST_CHECK int dict_get_uint64 (dict_t *this, char *key, uint64_t *val);
GF_MUST_CHECK int dict_set_uint64 (dict_t *this, char *key, uint64_t val);
+GF_MUST_CHECK int dict_check_flag (dict_t *this, char *key, int flag);
+GF_MUST_CHECK int dict_set_flag (dict_t *this, char *key, int flag);
+GF_MUST_CHECK int dict_clear_flag (dict_t *this, char *key, int flag);
+
GF_MUST_CHECK int dict_get_double (dict_t *this, char *key, double *val);
GF_MUST_CHECK int dict_set_double (dict_t *this, char *key, double val);