diff options
| author | Niels de Vos <ndevos@redhat.com> | 2015-06-21 17:04:29 +0200 | 
|---|---|---|
| committer | Jeff Darcy <jdarcy@redhat.com> | 2016-02-04 09:31:32 -0800 | 
| commit | 9b71092f3d6cea1cca4804b0588152c79bd34e1d (patch) | |
| tree | 26aaedcb1081ccf35347a5b77f4286bec5caa226 /xlators/protocol/client/src/client.c | |
| parent | 41beab5444969f235c665042965a650b5a2866e6 (diff) | |
protocol: implement seek() FOP
Network protocol extensions for the seek() FOP. The format is based on
the SEEK procedure in NFSv4.2.
Change-Id: I060768a8a4b9b1c80f4a24c0f17d630f7f028690
BUG: 1220173
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11482
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client.c')
| -rw-r--r-- | xlators/protocol/client/src/client.c | 30 | 
1 files changed, 30 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 39ac7c379da..29fe44c4974 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1894,6 +1894,35 @@ out:  int32_t +client_seek (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, +             gf_seek_what_t what, dict_t *xdata) +{ +        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.fd = fd; +        args.offset = offset; +        args.what = what; +        args.xdata = xdata; + +        proc = &conf->fops->proctable[GF_FOP_SEEK]; +        if (proc->fn) +                ret = proc->fn (frame, this, &args); +out: +        if (ret) +                STACK_UNWIND_STRICT(seek, frame, -1, ENOTCONN, 0, NULL); + +        return 0; +} + + +int32_t  client_getspec (call_frame_t *frame, xlator_t *this, const char *key,                  int32_t flags)  { @@ -2688,6 +2717,7 @@ struct xlator_fops fops = {          .zerofill    = client_zerofill,          .getspec     = client_getspec,          .ipc         = client_ipc, +        .seek        = client_seek,  };  | 
