diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2013-09-04 12:29:30 +0530 |
---|---|---|
committer | Krutika Dhananjay <kdhananj@redhat.com> | 2013-09-06 14:57:09 +0530 |
commit | 51a02dc600bf4711e291247d271e87bd9f319fba (patch) | |
tree | 6fdb8edd0bfd5c6f0ea499c3b3f53168b75c72e3 /libglusterfs/src/common-utils.c | |
parent | 08c555680d4aa0ec800ce617fdb119e83f9cd1f8 (diff) |
glusterd: Add cksum file (quota.cksum) for quota.conf file
.. and use quota checksum and version to validate one's own quota store
config
cli: cleanup quota-list-all implementation
Also,
change the format in which we store the directory quota configurations.
We store the list of gfids as 16 byte unsigned chars, in binary mode.
Original-author: Krishnan Parthasarathi <kparthas@redhat.com>
glusterd: Store quota checksum and version in quota.cksum
Quota version is incremented AND quota checksum is computed everytime
quota.conf is modified.
The checksum and versions are also retrieved
from store into memory whenever glusterd is restarted.
glusterd: Unlink quota.conf and quota.cksum on quota disable
Also destroy volinfo->quota_conf_shandle and reset it to NULL,
and reset volinfo->quota_conf_version to 0 in memory.
Change-Id: Ie71da3a75bc80e1ffddf4f2e38a99a48ad4de164
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 061162f7..46fe6388 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -2940,3 +2940,19 @@ out: fclose (file); return running; } + +int +gf_skip_header_section (int fd, int header_len) +{ + int ret = -1; + + ret = lseek (fd, header_len, SEEK_SET); + if (ret == (off_t) -1) { + gf_log ("", GF_LOG_ERROR, "Failed to skip header " + "section"); + } else { + ret = 0; + } + + return ret; +} |