summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-11-28 10:05:39 +0530
committerAmar Tumballi <amarts@redhat.com>2018-12-06 07:54:28 +0000
commit340e58f9b3bcdfe4314da65e592dcd5c2daf6fd9 (patch)
treee5e403711221b488ed6c4ee72322e2657d9065f8 /xlators/storage/posix
parent7ea5f438f60df9aa16027030f2b24f31bc07524b (diff)
all: add xlator_api to many translators
Fixes: #164 Change-Id: I93ad6f0232a1dc534df099059f69951e1339086f Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r--xlators/storage/posix/src/posix-common.c5
-rw-r--r--xlators/storage/posix/src/posix.c31
2 files changed, 27 insertions, 9 deletions
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
index 573f2e0103b..fd7c9fe779b 100644
--- a/xlators/storage/posix/src/posix-common.c
+++ b/xlators/storage/posix/src/posix-common.c
@@ -1109,7 +1109,7 @@ posix_fini(xlator_t *this)
return;
}
-struct volume_options options[] = {
+struct volume_options posix_options[] = {
{.key = {"o-direct"}, .type = GF_OPTION_TYPE_BOOL},
{.key = {"directory"},
.type = GF_OPTION_TYPE_PATH,
@@ -1336,4 +1336,5 @@ struct volume_options options[] = {
"are stored in xattr to keep it consistent across replica and "
"distribute set. The time attributes stored at the backend are "
"not considered "},
- {.key = {NULL}}};
+ {.key = {NULL}},
+};
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 7aa9d5026ba..d6a20135f96 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -17,10 +17,10 @@
#include <glusterfs/xlator.h>
#include "posix.h"
-class_methods_t class_methods = {.init = posix_init,
- .fini = posix_fini,
- .reconfigure = posix_reconfigure,
- .notify = posix_notify};
+int32_t
+mem_acct_init(xlator_t *this);
+
+extern struct volume_options posix_options[];
struct xlator_dumpops dumpops = {
.priv = posix_priv,
@@ -78,6 +78,23 @@ struct xlator_fops fops = {
.put = posix_put,
};
-struct xlator_cbks cbks = {.release = posix_release,
- .releasedir = posix_releasedir,
- .forget = posix_forget};
+struct xlator_cbks cbks = {
+ .release = posix_release,
+ .releasedir = posix_releasedir,
+ .forget = posix_forget,
+};
+
+xlator_api_t xlator_api = {
+ .init = posix_init,
+ .fini = posix_fini,
+ .notify = posix_notify,
+ .reconfigure = posix_reconfigure,
+ .mem_acct_init = mem_acct_init,
+ .op_version = {1}, /* Present from the initial version */
+ .dumpops = &dumpops,
+ .fops = &fops,
+ .cbks = &cbks,
+ .options = posix_options,
+ .identifier = "posix",
+ .category = GF_MAINTAINED,
+};