summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/logging.h2
-rw-r--r--xlators/features/trash/src/trash.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
index 1f0c4ac7d..3c197c015 100644
--- a/libglusterfs/src/logging.h
+++ b/libglusterfs/src/logging.h
@@ -32,7 +32,7 @@
#define GF_PRI_FSBLK PRId64
#define GF_PRI_BLKSIZE PRId32
-#define GF_PRI_SIZET PRId64
+#define GF_PRI_SIZET "zu"
#define GF_PRI_NLINK PRId32
#define GF_PRI_DEV PRId64
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index 3d41ab798..5ee3da2c8 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -295,7 +295,7 @@ trash_unlink_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (buf->ia_size > priv->max_trash_file_size) {
gf_log (this->name, GF_LOG_DEBUG,
- "%s: file size too big (%"GF_PRI_SIZET") to "
+ "%s: file size too big (%"PRId64") to "
"move into trash directory",
local->loc.path, buf->ia_size);
}
@@ -470,7 +470,7 @@ trash_rename_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (buf->ia_size > priv->max_trash_file_size) {
gf_log (this->name, GF_LOG_DEBUG,
- "%s: file size too big (%"GF_PRI_SIZET") to "
+ "%s: file size too big (%"PRId64") to "
"move into trash directory",
local->newloc.path, buf->ia_size);
}
@@ -1424,6 +1424,7 @@ init (xlator_t *this)
char *strtokptr = NULL;
char *component = NULL;
char trash_dir[PATH_MAX] = {0,};
+ uint64_t max_trash_file_size64 = 0;
/* Create .trashcan directory in init */
if (!this->children || this->children->next) {
@@ -1497,13 +1498,14 @@ init (xlator_t *this)
_priv->max_trash_file_size = GF_DEFAULT_MAX_FILE_SIZE;
} else {
ret = gf_string2bytesize (data->data,
- &_priv->max_trash_file_size);
- if( _priv->max_trash_file_size > GF_ALLOWED_MAX_FILE_SIZE ) {
+ &max_trash_file_size64);
+ if( max_trash_file_size64 > GF_ALLOWED_MAX_FILE_SIZE ) {
gf_log (this->name, GF_LOG_DEBUG,
"Size specified for max-size(in MB) is too "
"large so using 1GB as max-size (NOT IDEAL)");
_priv->max_trash_file_size = GF_ALLOWED_MAX_FILE_SIZE;
- }
+ } else
+ _priv->max_trash_file_size = max_trash_file_size64;
gf_log (this->name, GF_LOG_DEBUG, "%"GF_PRI_SIZET" max-size",
_priv->max_trash_file_size);
}