summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-10-01 06:59:05 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-01 07:23:54 -0700
commit709d46bcdbd006fa92c9d15e7c02ba7bff86685b (patch)
treeb99ad97fd32331738b853de2e11608bc3c4f35cc /libglusterfsclient
parent25217d43f9786b71de4d86cae122403f2cbaf1e5 (diff)
libglusterfsclient: Support setattr 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-xlibglusterfsclient/src/libglusterfsclient.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 96154e4..dd75115 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -5124,6 +5124,46 @@ out:
}
int
+libgf_client_setattr_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_setattr_cbk_stub (frame, NULL,
+ op_ret, op_errno,
+ preop, postop);
+
+ LIBGF_REPLY_NOTIFY (local);
+ return 0;
+}
+
+int
+libgf_client_setattr (libglusterfs_client_ctx_t *ctx, loc_t * loc,
+ 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, setattr, local, loc,
+ stbuf, valid);
+
+ op_ret = stub->args.setattr_cbk.op_ret;
+ errno = stub->args.setattr_cbk.op_errno;
+
+ if (op_ret == -1)
+ goto out;
+
+ libgf_transform_devnum (ctx, &stub->args.setattr_cbk.statpost);
+ libgf_update_iattr_cache (loc->inode, LIBGF_UPDATE_STAT,
+ &stub->args.setattr_cbk.statpost);
+out:
+ call_stub_destroy (stub);
+ return op_ret;
+}
+
+int
libgf_client_chmod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct stat *buf)
{