diff options
Diffstat (limited to 'xlators/features/quiesce/src/quiesce.c')
| -rw-r--r-- | xlators/features/quiesce/src/quiesce.c | 64 |
1 files changed, 51 insertions, 13 deletions
diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c index 41912b7e882..0e5eb60a16f 100644 --- a/xlators/features/quiesce/src/quiesce.c +++ b/xlators/features/quiesce/src/quiesce.c @@ -8,8 +8,8 @@ cases as published by the Free Software Foundation. */ #include "quiesce.h" -#include "defaults.h" -#include "call-stub.h" +#include <glusterfs/defaults.h> +#include <glusterfs/call-stub.h> /* TODO: */ /* Think about 'writev/_*_lk/setattr/xattrop/' fops to do re-transmittion */ @@ -89,13 +89,14 @@ gf_quiesce_populate_failover_hosts(xlator_t *this, quiesce_priv_t *priv, if (!dup_val) goto out; + addr_tok = strtok_r(dup_val, ",", &save_ptr); LOCK(&priv->lock); { if (!list_empty(&priv->failover_list)) __gf_quiesce_cleanup_failover_hosts(this, priv); - addr_tok = strtok_r(dup_val, ",", &save_ptr); + while (addr_tok) { - if (!valid_internet_address(addr_tok, _gf_true)) { + if (!valid_internet_address(addr_tok, _gf_true, _gf_false)) { gf_msg(this->name, GF_LOG_INFO, 0, QUIESCE_MSG_INVAL_HOST, "Specified " "invalid internet address:%s", @@ -1192,6 +1193,33 @@ quiesce_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, } int32_t +quiesce_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, + const char *name, dict_t *xdata) +{ + quiesce_priv_t *priv = NULL; + call_stub_t *stub = NULL; + + priv = this->private; + + if (priv->pass_through) { + STACK_WIND(frame, default_fremovexattr_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->fremovexattr, fd, name, xdata); + return 0; + } + + stub = fop_fremovexattr_stub(frame, default_fremovexattr_resume, fd, name, + xdata); + if (!stub) { + STACK_UNWIND_STRICT(fremovexattr, frame, -1, ENOMEM, NULL); + return 0; + } + + gf_quiesce_enqueue(this, stub); + + return 0; +} + +int32_t quiesce_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset, dict_t *xdata) { @@ -2364,19 +2392,10 @@ quiesce_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode, { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; - quiesce_local_t *local = NULL; priv = this->private; if (priv && priv->pass_through) { - local = mem_get0(priv->local_pool); - local->fd = fd_ref(fd); - local->offset = offset; - local->len = len; - local->flag = mode; - - frame->local = local; - STACK_WIND(frame, default_fallocate_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fallocate, fd, mode, offset, len, xdata); @@ -2536,6 +2555,7 @@ fini(xlator_t *this) this->private = NULL; mem_pool_destroy(priv->local_pool); + priv->local_pool = NULL; LOCK_DESTROY(&priv->lock); GF_FREE(priv); out: @@ -2592,7 +2612,9 @@ struct xlator_fops fops = { .truncate = quiesce_truncate, .ftruncate = quiesce_ftruncate, .setxattr = quiesce_setxattr, + .fsetxattr = quiesce_fsetxattr, .removexattr = quiesce_removexattr, + .fremovexattr = quiesce_fremovexattr, .symlink = quiesce_symlink, .unlink = quiesce_unlink, .link = quiesce_link, @@ -2625,6 +2647,7 @@ struct xlator_fops fops = { .access = quiesce_access, .readlink = quiesce_readlink, .getxattr = quiesce_getxattr, + .fgetxattr = quiesce_fgetxattr, .open = quiesce_open, .readv = quiesce_readv, .flush = quiesce_flush, @@ -2664,3 +2687,18 @@ struct volume_options options[] = { "the thin clients can failover to."}, {.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_3_12_0}, + .dumpops = &dumpops, + .fops = &fops, + .cbks = &cbks, + .options = options, + .identifier = "quiesce", + .category = GF_TECH_PREVIEW, +}; |
