From d7ecaaa1ed0f88869812ea17cb64a102a74c8c1c Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 17 Jan 2012 05:57:24 +0530 Subject: core: add 'fremovexattr()' fop so operations can be done on fd for extended attribute removal Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6 Signed-off-by: Amar Tumballi BUG: 766571 Reviewed-on: http://review.gluster.com/778 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/protocol/client/src/client.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'xlators/protocol/client/src/client.c') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 8e823bec4e8..5f11987034d 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1421,6 +1421,38 @@ out: return 0; } +int32_t +client_fremovexattr (call_frame_t *frame, xlator_t *this, fd_t *fd, + const char *name) +{ + int ret = -1; + clnt_conf_t *conf = NULL; + rpc_clnt_procedure_t *proc = NULL; + clnt_args_t args = {0,}; + + conf = this->private; + if (!conf || !conf->fops) + goto out; + + args.name = name; + args.fd = fd; + + proc = &conf->fops->proctable[GF_FOP_FREMOVEXATTR]; + if (!proc) { + gf_log (this->name, GF_LOG_ERROR, + "rpc procedure not found for %s", + gf_fop_list[GF_FOP_FREMOVEXATTR]); + goto out; + } + if (proc->fn) + ret = proc->fn (frame, this, &args); +out: + if (ret) + STACK_UNWIND_STRICT (fremovexattr, frame, -1, ENOTCONN); + + return 0; +} + int32_t client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, @@ -2303,6 +2335,7 @@ struct xlator_fops fops = { .fsetxattr = client_fsetxattr, .fgetxattr = client_fgetxattr, .removexattr = client_removexattr, + .fremovexattr = client_fremovexattr, .opendir = client_opendir, .readdir = client_readdir, .readdirp = client_readdirp, -- cgit