diff options
author | Amar Tumballi <amar@gluster.com> | 2012-01-17 05:57:24 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2012-01-25 02:24:20 -0800 |
commit | d7ecaaa1ed0f88869812ea17cb64a102a74c8c1c (patch) | |
tree | 4293106362bf9dec2e6260a4062239a9b7340cc0 /libglusterfs/src/call-stub.c | |
parent | 6c54022f1b1c7f5f458f6a7e783203d11e7f89b5 (diff) |
core: add 'fremovexattr()' fop
so operations can be done on fd for extended attribute removal
Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 766571
Reviewed-on: http://review.gluster.com/778
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'libglusterfs/src/call-stub.c')
-rw-r--r-- | libglusterfs/src/call-stub.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c index 8b28dc9bec6..24ca3825b0d 100644 --- a/libglusterfs/src/call-stub.c +++ b/libglusterfs/src/call-stub.c @@ -1463,6 +1463,48 @@ out: return stub; } +call_stub_t * +fop_fremovexattr_stub (call_frame_t *frame, + fop_fremovexattr_t fn, + fd_t *fd, + const char *name) +{ + call_stub_t *stub = NULL; + + GF_VALIDATE_OR_GOTO ("call-stub", frame, out); + GF_VALIDATE_OR_GOTO ("call-stub", fd, out); + GF_VALIDATE_OR_GOTO ("call-stub", name, out); + + stub = stub_new (frame, 1, GF_FOP_FREMOVEXATTR); + GF_VALIDATE_OR_GOTO ("call-stub", stub, out); + + stub->args.fremovexattr.fn = fn; + stub->args.fremovexattr.fd = fd_ref (fd); + stub->args.fremovexattr.name = gf_strdup (name); +out: + return stub; +} + + +call_stub_t * +fop_fremovexattr_cbk_stub (call_frame_t *frame, + fop_fremovexattr_cbk_t fn, + int32_t op_ret, + int32_t op_errno) +{ + call_stub_t *stub = NULL; + + GF_VALIDATE_OR_GOTO ("call-stub", frame, out); + + stub = stub_new (frame, 0, GF_FOP_FREMOVEXATTR); + GF_VALIDATE_OR_GOTO ("call-stub", stub, out); + + stub->args.fremovexattr_cbk.fn = fn; + stub->args.fremovexattr_cbk.op_ret = op_ret; + stub->args.fremovexattr_cbk.op_errno = op_errno; +out: + return stub; +} call_stub_t * fop_lk_stub (call_frame_t *frame, @@ -2303,6 +2345,15 @@ call_resume_wind (call_stub_t *stub) break; } + case GF_FOP_FREMOVEXATTR: + { + stub->args.fremovexattr.fn (stub->frame, + stub->frame->this, + stub->args.fremovexattr.fd, + stub->args.fremovexattr.name); + break; + } + case GF_FOP_OPENDIR: { stub->args.opendir.fn (stub->frame, @@ -2939,6 +2990,22 @@ call_resume_unwind (call_stub_t *stub) break; } + case GF_FOP_FREMOVEXATTR: + { + if (!stub->args.fremovexattr_cbk.fn) + STACK_UNWIND (stub->frame, + stub->args.fremovexattr_cbk.op_ret, + stub->args.fremovexattr_cbk.op_errno); + else + stub->args.fremovexattr_cbk.fn (stub->frame, + stub->frame->cookie, + stub->frame->this, + stub->args.fremovexattr_cbk.op_ret, + stub->args.fremovexattr_cbk.op_errno); + + break; + } + case GF_FOP_OPENDIR: { if (!stub->args.opendir_cbk.fn) @@ -3454,6 +3521,13 @@ call_stub_destroy_wind (call_stub_t *stub) break; } + case GF_FOP_FREMOVEXATTR: + { + fd_unref (stub->args.fremovexattr.fd); + GF_FREE ((char *)stub->args.fremovexattr.name); + break; + } + case GF_FOP_OPENDIR: { loc_wipe (&stub->args.opendir.loc); @@ -3718,6 +3792,8 @@ call_stub_destroy_unwind (call_stub_t *stub) case GF_FOP_REMOVEXATTR: break; + case GF_FOP_FREMOVEXATTR: + break; case GF_FOP_OPENDIR: { |