summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/quota-common-utils.h
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-04-15 17:35:07 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-04 03:46:08 -0700
commit821b1fdc893c0dd603d4c43a0b31f1ea495a46c9 (patch)
treea8593c6bc0b1ecbd58350b071b7ae4b5658ea57d /libglusterfs/src/quota-common-utils.h
parent40df2ed4d098d4cd2c6abbed23e497ac3e2e5804 (diff)
quota: support for inode quota in quota.conf
Currently when quota limit is set, corresponding gfid is set in quota.conf. This patch supports storing inode-quota limits in quota.conf and also stores additional byte for each gfid to differentiate between usage quota limit and inode quota limit. Change-Id: I444d7399407594edd280e640681679a784d4c46a BUG: 1202244 Signed-off-by: vmallika <vmallika@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/10069 Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/quota-common-utils.h')
-rw-r--r--libglusterfs/src/quota-common-utils.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libglusterfs/src/quota-common-utils.h b/libglusterfs/src/quota-common-utils.h
index eff86850dd5..e80c74cba72 100644
--- a/libglusterfs/src/quota-common-utils.h
+++ b/libglusterfs/src/quota-common-utils.h
@@ -13,6 +13,15 @@
#include "iatt.h"
+#define GF_QUOTA_CONF_VERSION 1.2
+#define QUOTA_CONF_HEADER \
+ "GlusterFS Quota conf | version: v1.2\n"
+
+typedef enum {
+ GF_QUOTA_CONF_TYPE_USAGE = 1,
+ GF_QUOTA_CONF_TYPE_OBJECTS
+} gf_quota_conf_type_t;
+
struct _quota_limits {
int64_t hl;
int64_t sl;
@@ -36,4 +45,22 @@ int32_t
quota_dict_set_meta (dict_t *dict, char *key, const quota_meta_t *meta,
ia_type_t ia_type);
+int32_t
+quota_conf_read_header (int fd, char *buf);
+
+int32_t
+quota_conf_read_version (int fd, float *version);
+
+int32_t
+quota_conf_write_header (int fd);
+
+int32_t
+quota_conf_write_gfid (int fd, void *buf, char type);
+
+int32_t
+quota_conf_read_gfid (int fd, void *buf, char *type, float version);
+
+int32_t
+quota_conf_skip_header (int fd);
+
#endif /* _QUOTA_COMMON_UTILS_H */