/*
Copyright (c) 2013 Red Hat, Inc. <http://www.redhat.com>
This file is part of GlusterFS.
This file is licensed to you under your choice of the GNU Lesser
General Public License, version 3 or any later version (LGPLv3 or
later), or the GNU General Public License, version 2 (GPLv2), in all
cases as published by the Free Software Foundation.
*/
#include <glusterfs/syscall.h>
#include "glusterd-volgen.h"
#include "glusterd-utils.h"
static int
validate_cache_max_min_size(glusterd_volinfo_t *volinfo, dict_t *dict,
char *key, char *value, char **op_errstr)
{
char *current_max_value = NULL;
char *current_min_value = NULL;
char errstr[2048] = "";
glusterd_conf_t *priv = NULL;
int ret = 0;
uint64_t max_value = 0;
uint64_t min_value = 0;
xlator_t *this = NULL;
this = THIS;
GF_ASSERT(this);
priv = this->private;
GF_ASSERT(priv);
if ((!strcmp(key, "performance.cache-min-file-size")) ||
(!strcmp(key, "cache-min-file-size"))) {
glusterd_volinfo_get(volinfo, "performance.cache-max-file-size",
¤t_max_value);
if (current_max_value) {
gf_string2byte
|