summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota/src/quotad.c
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2013-07-31 12:26:51 +0530
committerVijay Bellur <vbellur@redhat.com>2013-08-07 12:59:50 +0530
commit47d58c392998e05d7ef20b17c0089c17d7921e5e (patch)
tree8fb869c5eecf7bca7f87e3faa0d926078a34289b /xlators/features/quota/src/quotad.c
parentdcbd9152a67b06ddaff012a9042b50dc7b76cd0d (diff)
features/quota: Read the limit from the xattrs
Old approach: This is based on the path. So, the config file stored as limit-set key value pair in the volfile was the source of truth for any directory to be enforced the quota limit. So, we were storing it in a list and everypath is compared with the list. This hinders scaling with the order of kilos of quota directories. This approach is different from the XFS where the below method of inode based limit is employed this adds the admins to learn new stuff. New approach: This is based on the inode. After the path is set with the quota limit. The limit sticks with the inode. So, we need not to store the paths in the xlator context/options, instead get the xattrs in the lookup. Set the hard and soft limits of context from there. The additional change in the glusterd to set the xattrs when limit-usage command issued will be submitted as a separate patch. This patch also does: * Move the logging from the quotad to quota-enforcer. * Save the soft limit in the context. * Some clean up in quota-enforcer Change-Id: I2840f9377a4a1f76630741550873fe74758fa100 Signed-off-by: Varun Shastry <vshastry@redhat.com>
Diffstat (limited to 'xlators/features/quota/src/quotad.c')
-rw-r--r--xlators/features/quota/src/quotad.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/features/quota/src/quotad.c b/xlators/features/quota/src/quotad.c
index a5e51add..b1194870 100644
--- a/xlators/features/quota/src/quotad.c
+++ b/xlators/features/quota/src/quotad.c
@@ -560,10 +560,10 @@ qd_iterator (qd_vols_conf_t *conf, xlator_t *subvol)
{
limits_t *entry = NULL;
limits_t *next = NULL;
- int32_t ret;
+ int32_t ret = -1;
dict_t *dict_req = NULL;
- struct timeval now;
- struct timeval next_expire = {0,};
+ struct timeval now = {0,};
+ struct timeval next_expire = {0,};
GF_VALIDATE_OR_GOTO ("qd-iterator", conf, out);
GF_VALIDATE_OR_GOTO ("qd-iterator", subvol, out);