diff options
| author | vmallika <vmallika@redhat.com> | 2015-04-15 17:35:07 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-07 23:54:33 -0700 | 
| commit | ffbe47e0ec8411313b666a8705f31a67d3862763 (patch) | |
| tree | a161fdbec2678aea5329fae1dcb932cefe4d8395 /libglusterfs/src/common-utils.c | |
| parent | 753a603ce3259f3c6667a48ff4001512941f9128 (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: 1218170
Signed-off-by: vmallika <vmallika@redhat.com>
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/10069
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/10524
Diffstat (limited to 'libglusterfs/src/common-utils.c')
| -rw-r--r-- | libglusterfs/src/common-utils.c | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index b57066d41da..fc4ae123916 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -3939,3 +3939,48 @@ glusterfs_is_local_pathinfo (char *pathinfo, gf_boolean_t *is_local)  out:          return ret;  } + +ssize_t +gf_nread (int fd, void *buf, size_t count) +{ +        ssize_t  ret           = 0; +        ssize_t  read_bytes    = 0; + +        for (read_bytes = 0; read_bytes < count; read_bytes += ret) { +                ret = read (fd, buf + read_bytes, count - read_bytes); +                if (ret == 0) { +                        break; +                } else if (ret < 0) { +                        if (errno == EINTR) +                                ret = 0; +                        else +                                goto out; +                } +        } + +        ret = read_bytes; +out: +        return ret; +} + +ssize_t +gf_nwrite (int fd, const void *buf, size_t count) +{ +        ssize_t  ret        = 0; +        ssize_t  written    = 0; + +        for (written = 0; written != count; written += ret) { +                ret = write (fd, buf + written, count - written); +                if (ret < 0) { +                        if (errno == EINTR) +                                ret = 0; +                        else +                                goto out; +                } +        } + +        ret = written; +out: +        return ret; +} +  | 
