diff options
Diffstat (limited to 'xlators/storage/bd/src/bd-helper.c')
-rw-r--r-- | xlators/storage/bd/src/bd-helper.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/storage/bd/src/bd-helper.c b/xlators/storage/bd/src/bd-helper.c index 2c1b77a9b3e..8781f9fdfb4 100644 --- a/xlators/storage/bd/src/bd-helper.c +++ b/xlators/storage/bd/src/bd-helper.c @@ -3,6 +3,9 @@ #include "config.h" #endif #include <lvm2app.h> +#ifdef HAVE_LIBAIO +#include <libaio.h> +#endif #include "bd.h" #include "run.h" @@ -560,3 +563,19 @@ out: return ret; } + +inline void +bd_update_amtime(struct iatt *iatt, int flag) +{ + struct timespec ts = {0, }; + + clock_gettime (CLOCK_REALTIME, &ts); + if (flag & GF_SET_ATTR_ATIME) { + iatt->ia_atime = ts.tv_sec; + iatt->ia_atime_nsec = ts.tv_nsec; + } + if (flag & GF_SET_ATTR_MTIME) { + iatt->ia_mtime = ts.tv_sec; + iatt->ia_mtime_nsec = ts.tv_nsec; + } +} |