summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/upcall/src/upcall.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c
index 9b724928010..3d0669b305e 100644
--- a/xlators/features/upcall/src/upcall.c
+++ b/xlators/features/upcall/src/upcall.c
@@ -1522,6 +1522,62 @@ err:
return 0;
}
+
+int32_t
+up_seek_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, off_t offset, dict_t *xdata)
+{
+ client_t *client = NULL;
+ uint32_t flags = 0;
+ upcall_local_t *local = NULL;
+
+ EXIT_IF_UPCALL_OFF (this, out);
+
+ client = frame->root->client;
+ local = frame->local;
+
+ if ((op_ret < 0) || !local) {
+ goto out;
+ }
+ flags = UP_UPDATE_CLIENT;
+ upcall_cache_invalidate (frame, this, client, local->inode, flags,
+ NULL, NULL, NULL);
+
+out:
+ UPCALL_STACK_UNWIND (seek, frame, op_ret, op_errno, offset, xdata);
+
+ return 0;
+}
+
+
+int32_t
+up_seek (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
+ gf_seek_what_t what, dict_t *xdata)
+{
+ int32_t op_errno = -1;
+ upcall_local_t *local = NULL;
+
+ EXIT_IF_UPCALL_OFF (this, out);
+
+ local = upcall_local_init (frame, this, fd->inode);
+ if (!local) {
+ op_errno = ENOMEM;
+ goto err;
+ }
+
+out:
+ STACK_WIND (frame, up_seek_cbk, FIRST_CHILD(this),
+ FIRST_CHILD(this)->fops->seek, fd, offset, what, xdata);
+
+ return 0;
+
+err:
+ UPCALL_STACK_UNWIND (seek, frame, -1, op_errno, 0, NULL);
+
+ return 0;
+}
+
+
int32_t
mem_acct_init (xlator_t *this)
{
@@ -1758,6 +1814,7 @@ struct xlator_fops fops = {
.readlink = up_readlink,
.readv = up_readv,
.lk = up_lk,
+ .seek = up_seek,
/* fops doing write */
.truncate = up_truncate,