summaryrefslogtreecommitdiffstats
path: root/xlators/features/utime/src/utime-helpers.c
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-09-03 09:07:58 -0400
committerAmar Tumballi <amarts@redhat.com>2018-09-25 17:20:47 +0000
commit89636be4c73b12de2e11c75d8e59527bb243f147 (patch)
treeafae0f98352fc524054f9e6fae438c1e3faa80f1 /xlators/features/utime/src/utime-helpers.c
parentc006434c4f6d5762e826bd2ecc414b6d332d66c9 (diff)
ctime: Provide noatime option
Most of the applications are {c|m}time dependant and very few are atime dependant. So provide noatime option to not update atime when ctime feature is enabled. Also this option has to be enabled with ctime feature to avoid unnecessary self heal. Since AFR/EC reads data from single subvolume, atime is only updated in one subvolume triggering self heal. updates: bz#1593538 Change-Id: I085fb33c882296545345f5df194cde7b6cbc337e Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/features/utime/src/utime-helpers.c')
-rw-r--r--xlators/features/utime/src/utime-helpers.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/xlators/features/utime/src/utime-helpers.c b/xlators/features/utime/src/utime-helpers.c
index 2d74bc76e07..c79e12badfa 100644
--- a/xlators/features/utime/src/utime-helpers.c
+++ b/xlators/features/utime/src/utime-helpers.c
@@ -9,6 +9,7 @@
*/
#include "utime-helpers.h"
+#include "utime.h"
void
gl_timespec_get(struct timespec *ts)
@@ -21,12 +22,17 @@ gl_timespec_get(struct timespec *ts)
}
void
-utime_update_attribute_flags(call_frame_t *frame, glusterfs_fop_t fop)
+utime_update_attribute_flags(call_frame_t *frame, xlator_t *this,
+ glusterfs_fop_t fop)
{
- if (!frame) {
+ utime_priv_t *utime_priv = NULL;
+
+ if (!frame || !this) {
goto out;
}
+ utime_priv = this->private;
+
switch (fop) {
case GF_FOP_SETXATTR:
case GF_FOP_FSETXATTR:
@@ -42,9 +48,10 @@ utime_update_attribute_flags(call_frame_t *frame, glusterfs_fop_t fop)
case GF_FOP_OPENDIR:
case GF_FOP_OPEN:
case GF_FOP_READ:
- frame->root->flags |= MDATA_ATIME;
+ if (!utime_priv->noatime) {
+ frame->root->flags |= MDATA_ATIME;
+ }
break;
-
case GF_FOP_MKNOD:
case GF_FOP_MKDIR:
case GF_FOP_SYMLINK: