all: add xlator_api to many translators

Fixes: #164
Change-Id: I93ad6f0232a1dc534df099059f69951e1339086f
Signed-off-by: Amar Tumballi <amarts@redhat.com>
This commit is contained in:
Amar Tumballi 2018-11-28 10:05:39 +05:30
parent 7ea5f438f6
commit 340e58f9b3
33 changed files with 472 additions and 28 deletions

View File

@ -579,7 +579,7 @@ out:
return ret; return ret;
} }
int void
fini(xlator_t *this) fini(xlator_t *this)
{ {
afr_private_t *priv = NULL; afr_private_t *priv = NULL;
@ -595,7 +595,7 @@ fini(xlator_t *this)
afr_priv_destroy(priv); afr_priv_destroy(priv);
// if (this->itable);//I don't see any destroy func // if (this->itable);//I don't see any destroy func
return 0; return;
} }
struct xlator_fops fops = { struct xlator_fops fops = {
@ -1166,3 +1166,18 @@ struct volume_options options[] = {
"and configuring it doesn't have any effect"}, "and configuring it doesn't have any effect"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "replicate",
.category = GF_MAINTAINED,
};

View File

@ -4406,3 +4406,18 @@ struct volume_options options[] = {
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "io-stats",
.category = GF_MAINTAINED,
};

View File

@ -365,3 +365,16 @@ struct xlator_cbks cbks = {
struct volume_options options[] = { struct volume_options options[] = {
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "arbiter",
.category = GF_MAINTAINED,
};

View File

@ -809,3 +809,18 @@ struct volume_options options[] = {
"blocked acknowledgements are sent to the application"}, "blocked acknowledgements are sent to the application"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "barrier",
.category = GF_MAINTAINED,
};

View File

@ -2212,3 +2212,17 @@ struct volume_options options[] = {
}, },
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "bit-rot server",
.category = GF_MAINTAINED,
};

View File

@ -3481,3 +3481,17 @@ struct volume_options options[] = {
.default_value = "{{ brick.path }}"}, .default_value = "{{ brick.path }}"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "bitrot-stub",
.category = GF_MAINTAINED,
};

View File

@ -2910,3 +2910,17 @@ struct volume_options options[] = {
.tags = {"journal", "glusterfind"}}, .tags = {"journal", "glusterfind"}},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "changelog",
.category = GF_MAINTAINED,
};

View File

@ -2661,3 +2661,17 @@ struct volume_options options[] = {
.default_value = "trusted.afr.{{ volume.name }}"}, .default_value = "trusted.afr.{{ volume.name }}"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "index",
.category = GF_MAINTAINED,
};

View File

@ -1000,14 +1000,14 @@ out:
return ret; return ret;
} }
int void
fini(xlator_t *this) fini(xlator_t *this)
{ {
leases_private_t *priv = NULL; leases_private_t *priv = NULL;
priv = this->private; priv = this->private;
if (!priv) { if (!priv) {
return 0; return;
} }
this->private = NULL; this->private = NULL;
@ -1024,7 +1024,7 @@ fini(xlator_t *this)
glusterfs_ctx_tw_put(this->ctx); glusterfs_ctx_tw_put(this->ctx);
this->ctx->tw = NULL; this->ctx->tw = NULL;
} }
return 0; return;
} }
static int static int
@ -1135,3 +1135,16 @@ struct volume_options options[] = {
" will be forcefully purged by the server."}, " will be forcefully purged by the server."},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "leases",
.category = GF_MAINTAINED,
};

View File

@ -3741,19 +3741,19 @@ out:
return ret; return ret;
} }
int void
fini(xlator_t *this) fini(xlator_t *this)
{ {
posix_locks_private_t *priv = NULL; posix_locks_private_t *priv = NULL;
priv = this->private; priv = this->private;
if (!priv) if (!priv)
return 0; return;
this->private = NULL; this->private = NULL;
GF_FREE(priv->brickname); GF_FREE(priv->brickname);
GF_FREE(priv); GF_FREE(priv);
return 0; return;
} }
int int
@ -4490,3 +4490,17 @@ struct volume_options options[] = {
"be sent."}, "be sent."},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "locks",
.category = GF_MAINTAINED,
};

View File

@ -3564,3 +3564,16 @@ struct volume_options options[] = {
.flags = OPT_FLAG_NONE, .flags = OPT_FLAG_NONE,
}, },
{.key = {NULL}}}; {.key = {NULL}}};
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "marker",
.category = GF_MAINTAINED,
};

View File

@ -5292,3 +5292,16 @@ struct volume_options options[] = {
.tags = {}, .tags = {},
}, },
{.key = {NULL}}}; {.key = {NULL}}};
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "quota",
.category = GF_MAINTAINED,
};

View File

@ -130,3 +130,16 @@ struct volume_options options[] = {
"\"off\" by default."}, "\"off\" by default."},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "read-only",
.category = GF_TECH_PREVIEW,
};

View File

@ -634,3 +634,16 @@ struct volume_options options[] = {
.description = "Auto commit period for the files."}, .description = "Auto commit period for the files."},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "worm",
.category = GF_TECH_PREVIEW,
};

View File

@ -310,3 +310,16 @@ struct volume_options options[] = {
{ {
.key = {NULL}, .key = {NULL},
}}; }};
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "selinux",
.category = GF_MAINTAINED,
};

View File

@ -6862,3 +6862,17 @@ struct volume_options options[] = {
}, },
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "shard",
.category = GF_MAINTAINED,
};

View File

@ -646,3 +646,16 @@ struct xlator_cbks cbks = {};
struct volume_options options[] = { struct volume_options options[] = {
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {GD_OP_VERSION_6_0},
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "thin-arbiter",
.category = GF_MAINTAINED,
};

View File

@ -2636,3 +2636,17 @@ struct volume_options options[] = {
.default_value = "{{ brick.path }}"}, .default_value = "{{ brick.path }}"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "trash",
.category = GF_TECH_PREVIEW,
};

View File

@ -2335,14 +2335,14 @@ out:
return ret; return ret;
} }
int void
fini(xlator_t *this) fini(xlator_t *this)
{ {
upcall_private_t *priv = NULL; upcall_private_t *priv = NULL;
priv = this->private; priv = this->private;
if (!priv) { if (!priv) {
return 0; return;
} }
this->private = NULL; this->private = NULL;
@ -2367,7 +2367,7 @@ fini(xlator_t *this)
this->local_pool = NULL; this->local_pool = NULL;
} }
return 0; return;
} }
int int
@ -2527,3 +2527,17 @@ struct volume_options options[] = {
.tags = {"cache", "cachetimeout", "upcall"}}, .tags = {"cache", "cachetimeout", "upcall"}},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "upcall",
.category = GF_MAINTAINED,
};

View File

@ -230,3 +230,18 @@ struct volume_options options[] = {
"enabled. When noatime is on, atime is not updated with " "enabled. When noatime is on, atime is not updated with "
"ctime feature enabled and vice versa."}, "ctime feature enabled and vice versa."},
{.key = {NULL}}}; {.key = {NULL}}};
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {GD_OP_VERSION_5_0},
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "utime",
.category = GF_MAINTAINED,
};

View File

@ -226,11 +226,11 @@ out:
return ret; return ret;
} }
int void
fini(xlator_t *this) fini(xlator_t *this)
{ {
GF_FREE(this->private); GF_FREE(this->private);
return 0; return;
} }
struct xlator_fops fops = {.lookup = meta_lookup, struct xlator_fops fops = {.lookup = meta_lookup,
@ -262,3 +262,15 @@ struct volume_options options[] = {
.description = "Name of default meta directory."}, .description = "Name of default meta directory."},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "meta",
.category = GF_TECH_PREVIEW,
};

View File

@ -6668,3 +6668,17 @@ struct volume_options options[] = {
}, },
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.dumpops = &dumpops,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "fuse",
.category = GF_MAINTAINED,
};

View File

@ -819,15 +819,27 @@ out:
return ret; return ret;
} }
int32_t void
fini(xlator_t *this) fini(xlator_t *this)
{ {
if (!this) if (!this)
return 0; return;
if (this->local_pool) { if (this->local_pool) {
mem_pool_destroy(this->local_pool); mem_pool_destroy(this->local_pool);
this->local_pool = NULL; this->local_pool = NULL;
} }
return 0; return;
} }
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "decompounder",
.category = GF_TECH_PREVIEW,
};

View File

@ -2176,3 +2176,17 @@ struct volume_options options[] = {
.description = "Enable/Disable io cache translator"}, .description = "Enable/Disable io cache translator"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "io-cache",
.category = GF_MAINTAINED,
};

View File

@ -1560,3 +1560,18 @@ struct volume_options options[] = {
.key = {NULL}, .key = {NULL},
}, },
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "io-threads",
.category = GF_MAINTAINED,
};

View File

@ -1349,3 +1349,17 @@ struct volume_options options[] = {
{.key = {NULL}} {.key = {NULL}}
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "open-behind",
.category = GF_MAINTAINED,
};

View File

@ -1253,3 +1253,17 @@ struct volume_options options[] = {
.description = "Enable/Disable read ahead translator"}, .description = "Enable/Disable read ahead translator"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "read-ahead",
.category = GF_MAINTAINED,
};

View File

@ -1285,3 +1285,16 @@ struct volume_options options[] = {
.description = "Enable/Disable readdir ahead translator"}, .description = "Enable/Disable readdir ahead translator"},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "readdir-ahead",
.category = GF_MAINTAINED,
};

View File

@ -3236,3 +3236,17 @@ struct volume_options options[] = {
}, },
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "write-ahead",
.category = GF_MAINTAINED,
};

View File

@ -2981,3 +2981,18 @@ struct volume_options options[] = {
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC}, .flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC},
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.notify = notify,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "client",
.category = GF_MAINTAINED,
};

View File

@ -1109,7 +1109,7 @@ posix_fini(xlator_t *this)
return; return;
} }
struct volume_options options[] = { struct volume_options posix_options[] = {
{.key = {"o-direct"}, .type = GF_OPTION_TYPE_BOOL}, {.key = {"o-direct"}, .type = GF_OPTION_TYPE_BOOL},
{.key = {"directory"}, {.key = {"directory"},
.type = GF_OPTION_TYPE_PATH, .type = GF_OPTION_TYPE_PATH,
@ -1336,4 +1336,5 @@ struct volume_options options[] = {
"are stored in xattr to keep it consistent across replica and " "are stored in xattr to keep it consistent across replica and "
"distribute set. The time attributes stored at the backend are " "distribute set. The time attributes stored at the backend are "
"not considered "}, "not considered "},
{.key = {NULL}}}; {.key = {NULL}},
};

View File

@ -17,10 +17,10 @@
#include <glusterfs/xlator.h> #include <glusterfs/xlator.h>
#include "posix.h" #include "posix.h"
class_methods_t class_methods = {.init = posix_init, int32_t
.fini = posix_fini, mem_acct_init(xlator_t *this);
.reconfigure = posix_reconfigure,
.notify = posix_notify}; extern struct volume_options posix_options[];
struct xlator_dumpops dumpops = { struct xlator_dumpops dumpops = {
.priv = posix_priv, .priv = posix_priv,
@ -78,6 +78,23 @@ struct xlator_fops fops = {
.put = posix_put, .put = posix_put,
}; };
struct xlator_cbks cbks = {.release = posix_release, struct xlator_cbks cbks = {
.releasedir = posix_releasedir, .release = posix_release,
.forget = posix_forget}; .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,
};

View File

@ -2303,7 +2303,7 @@ err:
return -1; return -1;
} }
int void
fini(xlator_t *this) fini(xlator_t *this)
{ {
struct posix_acl_conf *conf = NULL; struct posix_acl_conf *conf = NULL;
@ -2311,7 +2311,7 @@ fini(xlator_t *this)
conf = this->private; conf = this->private;
if (!conf) if (!conf)
return 0; return;
this->private = NULL; this->private = NULL;
minacl = conf->minimal_acl; minacl = conf->minimal_acl;
@ -2328,7 +2328,7 @@ fini(xlator_t *this)
GF_FREE(conf); GF_FREE(conf);
return 0; return;
} }
struct xlator_fops fops = { struct xlator_fops fops = {
@ -2372,3 +2372,16 @@ struct volume_options options[] = {
}, },
{.key = {NULL}}, {.key = {NULL}},
}; };
xlator_api_t xlator_api = {
.init = init,
.fini = fini,
.reconfigure = reconfigure,
.mem_acct_init = mem_acct_init,
.op_version = {1}, /* Present from the initial version */
.fops = &fops,
.cbks = &cbks,
.options = options,
.identifier = "access-control",
.category = GF_MAINTAINED,
};