summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2012-08-23 18:34:09 +0530
committerVijay Bellur <vbellur@redhat.com>2012-08-27 08:08:45 -0700
commit10617e6cbc73329f259b471327d88375352042b0 (patch)
tree8fd7b0a1a17763730f11208908263baa8897df6f /xlators/storage/posix/src/posix.c
parentd0c52c8064a4097d97180240b36c53bfe98cac22 (diff)
storage/posix: implement native linux AIO support
Configurable via cli with "storage.linux-aio" settable option Backported Avati's patch http://review.gluster.org/#change,3627 BUG: 837495 Change-Id: Ia7c26f5734d34d341debd422a5c59bba31eef844 Signed-off-by: shishir gowda <sgowda@redhat.com> Reviewed-on: http://review.gluster.org/3849 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index cedf9538b..9082b4007 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -59,6 +59,7 @@
#include "timer.h"
#include "glusterfs3-xdr.h"
#include "hashfn.h"
+#include "posix-aio.h"
extern char *marker_xattrs[];
@@ -3960,6 +3961,29 @@ mem_acct_init (xlator_t *this)
return ret;
}
+
+int
+reconfigure (xlator_t *this, dict_t *options)
+{
+ int ret = -1;
+ struct posix_private *priv = NULL;
+
+ priv = this->private;
+
+ GF_OPTION_RECONF ("linux-aio", priv->aio_configured,
+ options, bool, out);
+
+ if (priv->aio_configured)
+ posix_aio_on (this);
+ else
+ posix_aio_off (this);
+
+ ret = 0;
+out:
+ return ret;
+}
+
+
/**
* init -
*/
@@ -4300,7 +4324,23 @@ init (xlator_t *this)
"Posix handle setup failed");
ret = -1;
goto out;
- }
+ }
+
+ _private->aio_init_done = _gf_false;
+ _private->aio_capable = _gf_false;
+
+ GF_OPTION_INIT ("linux-aio", _private->aio_configured, bool, out);
+
+ if (_private->aio_configured) {
+ op_ret = posix_aio_on (this);
+
+ if (op_ret == -1) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Posix AIO init failed");
+ ret = -1;
+ goto out;
+ }
+ }
pthread_mutex_init (&_private->janitor_lock, NULL);
pthread_cond_init (&_private->janitor_cond, NULL);
@@ -4399,5 +4439,11 @@ struct volume_options options[] = {
.type = GF_OPTION_TYPE_ANY },
{ .key = {"glusterd-uuid"},
.type = GF_OPTION_TYPE_STR },
+ {
+ .key = {"linux-aio"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "off",
+ .description = "Support for native Linux AIO"
+ },
{ .key = {NULL} }
};