diff options
Diffstat (limited to 'xlators/performance')
-rw-r--r-- | xlators/performance/io-cache/src/io-cache.c | 7 | ||||
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index ec45b61aed8..87b63429ace 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1832,7 +1832,6 @@ __ioc_cache_dump (ioc_inode_t *ioc_inode, char *prefix) ioc_table_t *table = NULL; ioc_page_t *page = NULL; int i = 0; - struct tm *tm = NULL; char key[GF_DUMP_MAX_BUF_LEN] = {0, }; char timestr[256] = {0, }; @@ -1843,9 +1842,9 @@ __ioc_cache_dump (ioc_inode_t *ioc_inode, char *prefix) table = ioc_inode->table; if (ioc_inode->cache.tv.tv_sec) { - tm = localtime (&ioc_inode->cache.tv.tv_sec); - strftime (timestr, 256, "%Y-%m-%d %H:%M:%S", tm); - snprintf (timestr + strlen (timestr), 256 - strlen (timestr), + gf_time_fmt (timestr, sizeof timestr, + ioc_inode->cache.tv.tv_sec, gf_timefmt_FT); + snprintf (timestr + strlen (timestr), sizeof timestr - strlen (timestr), ".%"GF_PRI_SUSECONDS, ioc_inode->cache.tv.tv_usec); gf_proc_dump_write ("last-cache-validation-time", "%s", diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 71fd2abfb54..66d6fb92ae9 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -3435,7 +3435,6 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode) int32_t ret = -1; char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, }; char buf[256] = {0, }; - struct tm *tm = NULL; ret = inode_ctx_get (inode, this, &value); if (ret != 0) { @@ -3454,9 +3453,9 @@ qr_inodectx_dump (xlator_t *this, inode_t *inode) gf_proc_dump_write ("entire-file-cached", "%s", qr_inode->xattr ? "yes" : "no"); if (qr_inode->tv.tv_sec) { - tm = localtime (&qr_inode->tv.tv_sec); - strftime (buf, 256, "%Y-%m-%d %H:%M:%S", tm); - snprintf (buf + strlen (buf), 256 - strlen (buf), + gf_time_fmt (buf, sizeof buf, qr_inode->tv.tv_sec, + gf_timefmt_FT); + snprintf (buf + strlen (buf), sizeof buf - strlen (buf), ".%"GF_PRI_SUSECONDS, qr_inode->tv.tv_usec); gf_proc_dump_write ("last-cache-validation-time", "%s", buf); |