summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-helpers.c
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-05-05 00:05:09 -0400
committerAmar Tumballi <amarts@redhat.com>2018-05-06 07:09:19 +0530
commit17e3f617086da785a3678d7cfa8f68ebd1497023 (patch)
tree8694053a2076c9445b113ff48c57ffb4578b2ef0 /xlators/storage/posix/src/posix-helpers.c
parent99cba93daadd29967d26621d1deee842d94483a8 (diff)
glusterd/ctime: Provide option to enable/disable ctime feature
Updates: #208 Change-Id: If6f52b9b1b5b823ad64faeed662e96ceb848c54c Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 75fb045590b..0ca9169e2f4 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -644,6 +644,9 @@ posix_fdstat (xlator_t *this, inode_t *inode, int fd, struct iatt *stbuf_p)
int ret = 0;
struct stat fstatbuf = {0, };
struct iatt stbuf = {0, };
+ struct posix_private *priv = NULL;
+
+ priv = this->private;
ret = sys_fstat (fd, &fstatbuf);
if (ret == -1)
@@ -654,7 +657,7 @@ posix_fdstat (xlator_t *this, inode_t *inode, int fd, struct iatt *stbuf_p)
iatt_from_stat (&stbuf, &fstatbuf);
- if (inode && is_ctime_enabled()) {
+ if (inode && priv->ctime) {
ret = posix_get_mdata_xattr (this, NULL, fd, inode, &stbuf);
if (ret) {
gf_msg (this->name, GF_LOG_WARNING, errno,
@@ -736,7 +739,7 @@ posix_istat (xlator_t *this, inode_t *inode, uuid_t gfid, const char *basename,
iatt_from_stat (&stbuf, &lstatbuf);
- if (inode && is_ctime_enabled()) {
+ if (inode && priv->ctime) {
ret = posix_get_mdata_xattr (this, real_path, -1, inode,
&stbuf);
if (ret) {
@@ -804,7 +807,7 @@ posix_pstat (xlator_t *this, inode_t *inode, uuid_t gfid, const char *path,
iatt_from_stat (&stbuf, &lstatbuf);
- if (inode && is_ctime_enabled()) {
+ if (inode && priv->ctime) {
if (!inode_locked) {
ret = posix_get_mdata_xattr (this, path, -1, inode, &stbuf);
} else {