diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-10-01 06:59:13 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-01 07:24:23 -0700 |
commit | 507a4aa75d295f6fa7db04885b65aec0f497b21e (patch) | |
tree | 546f0ea8885273606024ebd51a9761b47b3d530a /libglusterfsclient | |
parent | 3dc513b108df276b974c0ddc47f7ac9bff907448 (diff) |
libglusterfsclient: Support fsetattr fop
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 146 (Add setattr FOP)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 2b01b4b5662..d751a2e7bbc 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5472,6 +5472,47 @@ out: return op_ret; } + +int +libgf_client_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, + struct stat *preop, struct stat *postop) +{ + libgf_client_local_t *local = frame->local; + + local->reply_stub = fop_fsetattr_cbk_stub (frame, NULL, + op_ret, op_errno, + preop, postop); + LIBGF_REPLY_NOTIFY (local); + return 0; +} + + +int +libgf_client_fsetattr (libglusterfs_client_ctx_t *ctx, fd_t *fd, + struct stat *stbuf, int32_t valid) +{ + int op_ret = -1; + libgf_client_local_t *local = NULL; + call_stub_t *stub = NULL; + + LIBGF_CLIENT_FOP (ctx, stub, fsetattr, local, fd, stbuf, valid); + + op_ret = stub->args.fsetattr_cbk.op_ret; + errno = stub->args.fsetattr_cbk.op_errno; + + if (op_ret == -1) + goto out; + + libgf_transform_devnum (ctx, &stub->args.fsetattr_cbk.statpost); + libgf_update_iattr_cache (fd->inode, LIBGF_UPDATE_STAT, + &stub->args.fsetattr_cbk.statpost); +out: + call_stub_destroy (stub); + return op_ret; +} + + int libgf_client_fchmod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, |