From b222ce817f5f324fe20d4d3614001ed2f177afb8 Mon Sep 17 00:00:00 2001 From: "M. Mohan Kumar" Date: Wed, 13 Nov 2013 22:44:42 +0530 Subject: bd: Add aio support to BD xlator Volume option bd-aio controls AIO feature for BD xlator. Code taken from posix-aio.c Change-Id: Ib049bd59c9d3f9101d33939838322cfa808de053 BUG: 1028672 Signed-off-by: M. Mohan Kumar Reviewed-on: http://review.gluster.org/5748 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/storage/bd/src/bd-helper.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'xlators/storage/bd/src/bd-helper.c') diff --git a/xlators/storage/bd/src/bd-helper.c b/xlators/storage/bd/src/bd-helper.c index 2c1b77a9b..8781f9fdf 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 +#ifdef HAVE_LIBAIO +#include +#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; + } +} -- cgit