~ubuntu-branches/debian/sid/glusterfs/sid

« back to all changes in this revision

Viewing changes to xlators/protocol/client/src/client-rpc-fops.c

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2014-04-22 10:00:41 UTC
  • mfrom: (1.3.25)
  • Revision ID: package-import@ubuntu.com-20140422100041-6mur2ttyvb8zzpfq
Tags: 3.5.0-1
* New upstream release.
  - Rewrite patch 01-spelling-error.
  - Adjust lintian overrides.
  - Install new files.
  - The offical tarball is not properly generated, hack it around.
  - Add symlink from fusermount-glusterfs manpage to mount.glusterfs.
  - Move gsync-sync-gfid from /usr/share to /usr/lib.
  - Add benchmarking directory.
* Remove old versioned build dependencies and build depend on libglib2.0-dev.
* Add lintian override for possible-gpl-code-linked-with-openssl. It is the
  same false positive like with the gluster-server package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
                gf_log (this->name, GF_LOG_WARNING,
186
186
                        "remote operation failed: %s. Path: (%s to %s)",
187
187
                        strerror (gf_error_to_errno (rsp.op_errno)),
188
 
                        (local) ? local->loc.path : "--",
189
 
                        (local) ? local->loc2.path: "--");
 
188
                        local->loc.path, local->loc2.path);
190
189
        }
191
190
 
192
191
        CLIENT_STACK_UNWIND (symlink, frame, rsp.op_ret,
252
251
out:
253
252
        if (rsp.op_ret == -1) {
254
253
                gf_log (this->name, GF_LOG_WARNING,
255
 
                        "remote operation failed: %s. Path: %s (%s)",
 
254
                        "remote operation failed: %s. Path: %s",
256
255
                        strerror (gf_error_to_errno (rsp.op_errno)),
257
 
                        (local) ? local->loc.path : "--",
258
 
                        (local && local->loc.inode) ?
259
 
                        uuid_utoa (local->loc.inode->gfid) : "--");
 
256
                        local->loc.path);
260
257
        }
261
258
 
262
259
        CLIENT_STACK_UNWIND (mknod, frame, rsp.op_ret,
320
317
out:
321
318
        if (rsp.op_ret == -1) {
322
319
                gf_log (this->name, GF_LOG_WARNING,
323
 
                        "remote operation failed: %s. Path: %s (%s)",
 
320
                        "remote operation failed: %s. Path: %s",
324
321
                        strerror (gf_error_to_errno (rsp.op_errno)),
325
 
                        (local) ? local->loc.path : "--",
326
 
                        (local && local->loc.inode) ?
327
 
                        uuid_utoa (local->loc.inode->gfid) : "--");
 
322
                        local->loc.path);
328
323
        }
329
324
 
330
325
        CLIENT_STACK_UNWIND (mkdir, frame, rsp.op_ret,
466
461
                gf_log (this->name, GF_LOG_WARNING,
467
462
                        "remote operation failed: %s. Path: %s (%s)",
468
463
                        strerror (gf_error_to_errno (rsp.op_errno)),
469
 
                        (local) ? local->loc.path : "--",
470
 
                        (local && local->loc.inode) ?
471
 
                        uuid_utoa (local->loc.inode->gfid) : "--");
 
464
                        local->loc.path, loc_gfid_utoa (&local->loc));
472
465
        }
473
466
 
474
467
        CLIENT_STACK_UNWIND (open, frame, rsp.op_ret,
1106
1099
                                     GF_LOG_DEBUG : GF_LOG_WARNING),
1107
1100
                        "remote operation failed: %s. Path: %s (%s). Key: %s",
1108
1101
                        strerror (op_errno),
1109
 
                        (local) ? local->loc.path : "--",
1110
 
                        (local && local->loc.inode) ?
1111
 
                        uuid_utoa (local->loc.inode->gfid) : "--",
1112
 
                        (local) ? local->name : "(null)");
 
1102
                        local->loc.path, loc_gfid_utoa (&local->loc),
 
1103
                        (local->name) ? local->name : "(null)");
1113
1104
        }
1114
1105
 
1115
1106
        CLIENT_STACK_UNWIND (getxattr, frame, rsp.op_ret, op_errno, dict, xdata);
1750
1741
                gf_log (this->name, GF_LOG_WARNING,
1751
1742
                        "remote operation failed: %s. Path: %s (%s)",
1752
1743
                        strerror (gf_error_to_errno (rsp.op_errno)),
1753
 
                        (local) ? local->loc.path : "--",
1754
 
                        (local && local->loc.inode) ?
1755
 
                        uuid_utoa (local->loc.inode->gfid) : "--");
 
1744
                        local->loc.path, loc_gfid_utoa (&local->loc));
1756
1745
        }
1757
1746
 
1758
1747
        CLIENT_STACK_UNWIND (xattrop, frame, rsp.op_ret,
1947
1936
        return 0;
1948
1937
}
1949
1938
 
 
1939
int
 
1940
client3_3_fallocate_cbk (struct rpc_req *req, struct iovec *iov, int count,
 
1941
                        void *myframe)
 
1942
{
 
1943
        call_frame_t    *frame      = NULL;
 
1944
        gfs3_fallocate_rsp rsp      = {0,};
 
1945
        struct iatt      prestat    = {0,};
 
1946
        struct iatt      poststat   = {0,};
 
1947
        int              ret        = 0;
 
1948
        xlator_t *this       = NULL;
 
1949
        dict_t  *xdata       = NULL;
 
1950
 
 
1951
 
 
1952
        this = THIS;
 
1953
 
 
1954
        frame = myframe;
 
1955
 
 
1956
        if (-1 == req->rpc_status) {
 
1957
                rsp.op_ret   = -1;
 
1958
                rsp.op_errno = ENOTCONN;
 
1959
                goto out;
 
1960
        }
 
1961
        ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fallocate_rsp);
 
1962
        if (ret < 0) {
 
1963
                gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
 
1964
                rsp.op_ret   = -1;
 
1965
                rsp.op_errno = EINVAL;
 
1966
                goto out;
 
1967
        }
 
1968
 
 
1969
        if (-1 != rsp.op_ret) {
 
1970
                gf_stat_to_iatt (&rsp.statpre, &prestat);
 
1971
                gf_stat_to_iatt (&rsp.statpost, &poststat);
 
1972
        }
 
1973
 
 
1974
        GF_PROTOCOL_DICT_UNSERIALIZE (this, xdata, (rsp.xdata.xdata_val),
 
1975
                                      (rsp.xdata.xdata_len), ret,
 
1976
                                      rsp.op_errno, out);
 
1977
 
 
1978
out:
 
1979
        if (rsp.op_ret == -1) {
 
1980
                gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
 
1981
                        strerror (gf_error_to_errno (rsp.op_errno)));
 
1982
        }
 
1983
        CLIENT_STACK_UNWIND (fallocate, frame, rsp.op_ret,
 
1984
                             gf_error_to_errno (rsp.op_errno), &prestat,
 
1985
                             &poststat, xdata);
 
1986
 
 
1987
        free (rsp.xdata.xdata_val);
 
1988
 
 
1989
        if (xdata)
 
1990
                dict_unref (xdata);
 
1991
 
 
1992
        return 0;
 
1993
}
 
1994
 
 
1995
int
 
1996
client3_3_discard_cbk(struct rpc_req *req, struct iovec *iov, int count,
 
1997
                      void *myframe)
 
1998
{
 
1999
        call_frame_t    *frame      = NULL;
 
2000
        gfs3_discard_rsp rsp      = {0,};
 
2001
        struct iatt      prestat    = {0,};
 
2002
        struct iatt      poststat   = {0,};
 
2003
        int              ret        = 0;
 
2004
        xlator_t *this       = NULL;
 
2005
        dict_t  *xdata       = NULL;
 
2006
 
 
2007
        this = THIS;
 
2008
 
 
2009
        frame = myframe;
 
2010
 
 
2011
        if (-1 == req->rpc_status) {
 
2012
                rsp.op_ret   = -1;
 
2013
                rsp.op_errno = ENOTCONN;
 
2014
                goto out;
 
2015
        }
 
2016
        ret = xdr_to_generic(*iov, &rsp, (xdrproc_t) xdr_gfs3_discard_rsp);
 
2017
        if (ret < 0) {
 
2018
                gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
 
2019
                rsp.op_ret   = -1;
 
2020
                rsp.op_errno = EINVAL;
 
2021
                goto out;
 
2022
        }
 
2023
 
 
2024
        if (-1 != rsp.op_ret) {
 
2025
                gf_stat_to_iatt (&rsp.statpre, &prestat);
 
2026
                gf_stat_to_iatt (&rsp.statpost, &poststat);
 
2027
        }
 
2028
 
 
2029
        GF_PROTOCOL_DICT_UNSERIALIZE (this, xdata, (rsp.xdata.xdata_val),
 
2030
                                      (rsp.xdata.xdata_len), ret,
 
2031
                                      rsp.op_errno, out);
 
2032
 
 
2033
out:
 
2034
        if (rsp.op_ret == -1) {
 
2035
                gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
 
2036
                        strerror (gf_error_to_errno (rsp.op_errno)));
 
2037
        }
 
2038
        CLIENT_STACK_UNWIND (discard, frame, rsp.op_ret,
 
2039
                             gf_error_to_errno (rsp.op_errno), &prestat,
 
2040
                             &poststat, xdata);
 
2041
 
 
2042
        free (rsp.xdata.xdata_val);
 
2043
 
 
2044
        if (xdata)
 
2045
                dict_unref (xdata);
 
2046
 
 
2047
        return 0;
 
2048
}
 
2049
 
 
2050
int
 
2051
client3_3_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count,
 
2052
                      void *myframe)
 
2053
{
 
2054
        call_frame_t    *frame         = NULL;
 
2055
        gfs3_zerofill_rsp rsp          = {0,};
 
2056
        struct iatt      prestat       = {0,};
 
2057
        struct iatt      poststat      = {0,};
 
2058
        int              ret           = 0;
 
2059
        xlator_t *this                 = NULL;
 
2060
        dict_t  *xdata                 = NULL;
 
2061
 
 
2062
        this = THIS;
 
2063
 
 
2064
        frame = myframe;
 
2065
 
 
2066
        if (-1 == req->rpc_status) {
 
2067
                rsp.op_ret   = -1;
 
2068
                rsp.op_errno = ENOTCONN;
 
2069
                goto out;
 
2070
        }
 
2071
        ret = xdr_to_generic(*iov, &rsp, (xdrproc_t) xdr_gfs3_zerofill_rsp);
 
2072
        if (ret < 0) {
 
2073
                gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
 
2074
                rsp.op_ret   = -1;
 
2075
                rsp.op_errno = EINVAL;
 
2076
                goto out;
 
2077
        }
 
2078
 
 
2079
        if (-1 != rsp.op_ret) {
 
2080
                gf_stat_to_iatt (&rsp.statpre, &prestat);
 
2081
                gf_stat_to_iatt (&rsp.statpost, &poststat);
 
2082
        }
 
2083
 
 
2084
        GF_PROTOCOL_DICT_UNSERIALIZE (this, xdata, (rsp.xdata.xdata_val),
 
2085
                                      (rsp.xdata.xdata_len), ret,
 
2086
                                      rsp.op_errno, out);
 
2087
 
 
2088
out:
 
2089
        if (rsp.op_ret == -1) {
 
2090
                gf_log (this->name, GF_LOG_WARNING,
 
2091
                        "remote operation failed: %s",
 
2092
                        strerror (gf_error_to_errno (rsp.op_errno)));
 
2093
        }
 
2094
        CLIENT_STACK_UNWIND (zerofill, frame, rsp.op_ret,
 
2095
                             gf_error_to_errno (rsp.op_errno), &prestat,
 
2096
                             &poststat, xdata);
 
2097
 
 
2098
        free (rsp.xdata.xdata_val);
 
2099
 
 
2100
        if (xdata)
 
2101
                dict_unref (xdata);
 
2102
 
 
2103
        return 0;
 
2104
}
1950
2105
 
1951
2106
int
1952
2107
client3_3_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
2064
2219
out:
2065
2220
        if (rsp.op_ret == -1) {
2066
2221
                gf_log (this->name, GF_LOG_WARNING,
2067
 
                        "remote operation failed: %s. Path: %s (%s)",
 
2222
                        "remote operation failed: %s. Path: %s",
2068
2223
                        strerror (gf_error_to_errno (rsp.op_errno)),
2069
 
                        (local) ? local->loc.path : "--",
2070
 
                        (local && local->loc.inode) ?
2071
 
                        uuid_utoa (local->loc.inode->gfid) : "--");
 
2224
                        local->loc.path);
2072
2225
        }
2073
2226
 
2074
2227
        CLIENT_STACK_UNWIND (create, frame, rsp.op_ret,
2463
2616
                gf_log (this->name, GF_LOG_WARNING,
2464
2617
                        "remote operation failed: %s (%s -> %s)",
2465
2618
                        strerror (gf_error_to_errno (rsp.op_errno)),
2466
 
                        (local) ? ((local->loc.path)? local->loc.path :
2467
 
                                   uuid_utoa (local->loc.inode->gfid)) : "--",
2468
 
                        (local) ? ((local->loc2.path)? local->loc2.path :
2469
 
                                   local->loc2.name) : "--");
 
2619
                        local->loc.path, local->loc2.path);
2470
2620
        }
2471
2621
 
2472
2622
        CLIENT_STACK_UNWIND (link, frame, rsp.op_ret,
2536
2686
                gf_log (this->name, GF_LOG_WARNING,
2537
2687
                        "remote operation failed: %s. Path: %s (%s)",
2538
2688
                        strerror (gf_error_to_errno (rsp.op_errno)),
2539
 
                        (local) ? local->loc.path : "--",
2540
 
                        (local && local->loc.inode) ?
2541
 
                        uuid_utoa (local->loc.inode->gfid) : "--");
 
2689
                        local->loc.path, loc_gfid_utoa (&local->loc));
2542
2690
        }
2543
2691
        CLIENT_STACK_UNWIND (opendir, frame, rsp.op_ret,
2544
2692
                             gf_error_to_errno (rsp.op_errno), fd, xdata);
2615
2763
        rsp.op_errno = op_errno;
2616
2764
        if (rsp.op_ret == -1) {
2617
2765
                /* any error other than ENOENT */
2618
 
                if (rsp.op_errno != ENOENT)
 
2766
                if (!(local->loc.name && rsp.op_errno == ENOENT) &&
 
2767
                    !(rsp.op_errno == ESTALE))
2619
2768
                        gf_log (this->name, GF_LOG_WARNING,
2620
2769
                                "remote operation failed: %s. Path: %s (%s)",
2621
 
                                strerror (rsp.op_errno),
2622
 
                                (local) ? local->loc.path : "--",
2623
 
                                (local && local->loc.inode) ?
2624
 
                                uuid_utoa (local->loc.inode->gfid) : "--");
 
2770
                                strerror (rsp.op_errno), local->loc.path,
 
2771
                                loc_gfid_utoa (&local->loc));
2625
2772
                else
2626
2773
                        gf_log (this->name, GF_LOG_TRACE, "not found on remote node");
2627
2774
 
2777
2924
        if (fdctx->is_dir) {
2778
2925
                gfs3_releasedir_req  req = {{0,},};
2779
2926
                req.fd = fdctx->remote_fd;
2780
 
                gf_log (this->name, GF_LOG_DEBUG, "sending releasedir on fd");
 
2927
                gf_log (this->name, GF_LOG_TRACE, "sending releasedir on fd");
2781
2928
                client_submit_request (this, &req, fr, &clnt3_3_fop_prog,
2782
2929
                                       GFS3_OP_RELEASEDIR,
2783
2930
                                       client3_3_releasedir_cbk,
2786
2933
        } else {
2787
2934
                gfs3_release_req  req = {{0,},};
2788
2935
                req.fd = fdctx->remote_fd;
2789
 
                gf_log (this->name, GF_LOG_DEBUG, "sending release on fd");
 
2936
                gf_log (this->name, GF_LOG_TRACE, "sending release on fd");
2790
2937
                client_submit_request (this, &req, fr, &clnt3_3_fop_prog,
2791
2938
                                       GFS3_OP_RELEASE,
2792
2939
                                       client3_3_release_cbk, NULL,
2926
3073
                goto unwind;
2927
3074
 
2928
3075
        loc_copy (&local->loc, args->loc);
 
3076
        loc_path (&local->loc, NULL);
2929
3077
        frame->local = local;
2930
3078
 
2931
3079
        if (args->loc->parent) {
3442
3590
                goto unwind;
3443
3591
 
3444
3592
        loc_copy (&local->loc, args->loc);
 
3593
        loc_path (&local->loc, NULL);
3445
3594
 
3446
3595
        if (!uuid_is_null (args->loc->parent->gfid))
3447
3596
                memcpy (req.pargfid,  args->loc->parent->gfid, 16);
3591
3740
        }
3592
3741
 
3593
3742
        loc_copy (&local->loc, args->oldloc);
 
3743
        loc_path (&local->loc, NULL);
3594
3744
        loc_copy (&local->loc2, args->newloc);
 
3745
        loc_path (&local->loc2, NULL);
3595
3746
        frame->local = local;
3596
3747
 
3597
3748
        req.newbname = (char *)args->newloc->name;
3646
3797
                goto unwind;
3647
3798
 
3648
3799
        loc_copy (&local->loc, args->loc);
 
3800
        loc_path (&local->loc, NULL);
3649
3801
        frame->local = local;
3650
3802
 
3651
3803
        if (!uuid_is_null (args->loc->parent->gfid))
3713
3865
                goto unwind;
3714
3866
 
3715
3867
        loc_copy (&local->loc, args->loc);
 
3868
        loc_path (&local->loc, NULL);
3716
3869
        frame->local = local;
3717
3870
 
3718
3871
        if (!uuid_is_null (args->loc->parent->gfid))
3781
3934
        local->flags = args->flags;
3782
3935
 
3783
3936
        loc_copy (&local->loc, args->loc);
 
3937
        loc_path (&local->loc, NULL);
3784
3938
        frame->local = local;
3785
3939
 
3786
3940
        if (!uuid_is_null (args->loc->parent->gfid))
3850
4004
        local->fd = fd_ref (args->fd);
3851
4005
        local->flags = args->flags;
3852
4006
        loc_copy (&local->loc, args->loc);
 
4007
        loc_path (&local->loc, NULL);
3853
4008
        frame->local = local;
3854
4009
 
3855
4010
        if (!uuid_is_null (args->loc->inode->gfid))
4238
4393
 
4239
4394
        local->fd = fd_ref (args->fd);
4240
4395
        loc_copy (&local->loc, args->loc);
 
4396
        loc_path (&local->loc, NULL);
4241
4397
        frame->local = local;
4242
4398
 
4243
4399
        if (!uuid_is_null (args->loc->inode->gfid))
4644
4800
        }
4645
4801
 
4646
4802
        loc_copy (&local->loc, args->loc);
 
4803
        loc_path (&local->loc, NULL);
4647
4804
        if (args->name)
4648
4805
                local->name = gf_strdup (args->name);
4649
4806
 
4808
4965
        else
4809
4966
                memcpy (req.gfid, args->loc->gfid, 16);
4810
4967
 
 
4968
        loc_copy (&local->loc, args->loc);
 
4969
        loc_path (&local->loc, NULL);
4811
4970
        GF_ASSERT_AND_GOTO_WITH_ERROR (this->name,
4812
4971
                                       !uuid_is_null (*((uuid_t*)req.gfid)),
4813
4972
                                       unwind, op_errno, EINVAL);
5794
5953
        return 0;
5795
5954
}
5796
5955
 
5797
 
 
 
5956
int32_t
 
5957
client3_3_fallocate(call_frame_t *frame, xlator_t *this, void *data)
 
5958
{
 
5959
        clnt_args_t       *args     = NULL;
 
5960
        int64_t            remote_fd = -1;
 
5961
        clnt_conf_t       *conf     = NULL;
 
5962
        gfs3_fallocate_req req      = {{0},};
 
5963
        int                op_errno = ESTALE;
 
5964
        int                ret        = 0;
 
5965
 
 
5966
        if (!frame || !this || !data)
 
5967
                goto unwind;
 
5968
 
 
5969
        args = data;
 
5970
        conf = this->private;
 
5971
 
 
5972
        CLIENT_GET_REMOTE_FD (this, args->fd, DEFAULT_REMOTE_FD,
 
5973
                              remote_fd, op_errno, unwind);
 
5974
 
 
5975
        req.fd = remote_fd;
 
5976
        req.flags = args->flags;
 
5977
        req.offset = args->offset;
 
5978
        req.size = args->size;
 
5979
        memcpy(req.gfid, args->fd->inode->gfid, 16);
 
5980
 
 
5981
        GF_PROTOCOL_DICT_SERIALIZE (this, args->xdata, (&req.xdata.xdata_val),
 
5982
                                    req.xdata.xdata_len, op_errno, unwind);
 
5983
 
 
5984
        ret = client_submit_request (this, &req, frame, conf->fops,
 
5985
                                     GFS3_OP_FALLOCATE,
 
5986
                                     client3_3_fallocate_cbk, NULL,
 
5987
                                     NULL, 0, NULL, 0,
 
5988
                                     NULL, (xdrproc_t)xdr_gfs3_fallocate_req);
 
5989
        if (ret) {
 
5990
                gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
 
5991
        }
 
5992
 
 
5993
        GF_FREE (req.xdata.xdata_val);
 
5994
 
 
5995
        return 0;
 
5996
unwind:
 
5997
        CLIENT_STACK_UNWIND (fallocate, frame, -1, op_errno, NULL, NULL, NULL);
 
5998
        GF_FREE (req.xdata.xdata_val);
 
5999
 
 
6000
        return 0;
 
6001
}
 
6002
 
 
6003
int32_t
 
6004
client3_3_discard(call_frame_t *frame, xlator_t *this, void *data)
 
6005
{
 
6006
        clnt_args_t       *args     = NULL;
 
6007
        int64_t            remote_fd = -1;
 
6008
        clnt_conf_t       *conf     = NULL;
 
6009
        gfs3_discard_req   req      = {{0},};
 
6010
        int                op_errno = ESTALE;
 
6011
        int                ret        = 0;
 
6012
 
 
6013
        if (!frame || !this || !data)
 
6014
                goto unwind;
 
6015
 
 
6016
        args = data;
 
6017
        conf = this->private;
 
6018
 
 
6019
        CLIENT_GET_REMOTE_FD (this, args->fd, DEFAULT_REMOTE_FD,
 
6020
                              remote_fd, op_errno, unwind);
 
6021
 
 
6022
        req.fd = remote_fd;
 
6023
        req.offset = args->offset;
 
6024
        req.size = args->size;
 
6025
        memcpy(req.gfid, args->fd->inode->gfid, 16);
 
6026
 
 
6027
        GF_PROTOCOL_DICT_SERIALIZE (this, args->xdata, (&req.xdata.xdata_val),
 
6028
                                    req.xdata.xdata_len, op_errno, unwind);
 
6029
 
 
6030
        ret = client_submit_request(this, &req, frame, conf->fops,
 
6031
                                    GFS3_OP_DISCARD, client3_3_discard_cbk,
 
6032
                                    NULL, NULL, 0, NULL, 0, NULL,
 
6033
                                    (xdrproc_t) xdr_gfs3_discard_req);
 
6034
        if (ret)
 
6035
                gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
 
6036
 
 
6037
        GF_FREE (req.xdata.xdata_val);
 
6038
 
 
6039
        return 0;
 
6040
unwind:
 
6041
        CLIENT_STACK_UNWIND(discard, frame, -1, op_errno, NULL, NULL, NULL);
 
6042
        GF_FREE (req.xdata.xdata_val);
 
6043
 
 
6044
        return 0;
 
6045
}
 
6046
 
 
6047
int32_t
 
6048
client3_3_zerofill(call_frame_t *frame, xlator_t *this, void *data)
 
6049
{
 
6050
        clnt_args_t       *args        = NULL;
 
6051
        int64_t            remote_fd   = -1;
 
6052
        clnt_conf_t       *conf        = NULL;
 
6053
        gfs3_zerofill_req   req        = {{0},};
 
6054
        int                op_errno    = ESTALE;
 
6055
        int                ret         = 0;
 
6056
 
 
6057
        GF_ASSERT (frame);
 
6058
 
 
6059
        if (!this || !data)
 
6060
                goto unwind;
 
6061
 
 
6062
        args = data;
 
6063
        conf = this->private;
 
6064
 
 
6065
        CLIENT_GET_REMOTE_FD (this, args->fd, DEFAULT_REMOTE_FD,
 
6066
                              remote_fd, op_errno, unwind);
 
6067
 
 
6068
        req.fd = remote_fd;
 
6069
        req.offset = args->offset;
 
6070
        req.size = args->size;
 
6071
        memcpy(req.gfid, args->fd->inode->gfid, 16);
 
6072
 
 
6073
        GF_PROTOCOL_DICT_SERIALIZE (this, args->xdata, (&req.xdata.xdata_val),
 
6074
                                    req.xdata.xdata_len, op_errno, unwind);
 
6075
 
 
6076
        ret = client_submit_request(this, &req, frame, conf->fops,
 
6077
                                    GFS3_OP_ZEROFILL, client3_3_zerofill_cbk,
 
6078
                                    NULL, NULL, 0, NULL, 0, NULL,
 
6079
                                    (xdrproc_t) xdr_gfs3_zerofill_req);
 
6080
        if (ret)
 
6081
                gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
 
6082
 
 
6083
        GF_FREE (req.xdata.xdata_val);
 
6084
 
 
6085
        return 0;
 
6086
unwind:
 
6087
        CLIENT_STACK_UNWIND(zerofill, frame, -1, op_errno, NULL, NULL, NULL);
 
6088
        GF_FREE (req.xdata.xdata_val);
 
6089
 
 
6090
        return 0;
 
6091
}
5798
6092
 
5799
6093
/* Table Specific to FOPS */
5800
6094
 
5841
6135
        [GF_FOP_SETATTR]     = { "SETATTR",     client3_3_setattr },
5842
6136
        [GF_FOP_FSETATTR]    = { "FSETATTR",    client3_3_fsetattr },
5843
6137
        [GF_FOP_READDIRP]    = { "READDIRP",    client3_3_readdirp },
 
6138
        [GF_FOP_FALLOCATE]   = { "FALLOCATE",   client3_3_fallocate },
 
6139
        [GF_FOP_DISCARD]     = { "DISCARD",     client3_3_discard },
 
6140
        [GF_FOP_ZEROFILL]    = { "ZEROFILL",    client3_3_zerofill},
5844
6141
        [GF_FOP_RELEASE]     = { "RELEASE",     client3_3_release },
5845
6142
        [GF_FOP_RELEASEDIR]  = { "RELEASEDIR",  client3_3_releasedir },
5846
6143
        [GF_FOP_GETSPEC]     = { "GETSPEC",     client3_getspec },
5893
6190
        [GFS3_OP_RELEASE]     = "RELEASE",
5894
6191
        [GFS3_OP_RELEASEDIR]  = "RELEASEDIR",
5895
6192
        [GFS3_OP_FREMOVEXATTR] = "FREMOVEXATTR",
 
6193
        [GFS3_OP_FALLOCATE]   = "FALLOCATE",
 
6194
        [GFS3_OP_DISCARD]     = "DISCARD",
 
6195
        [GFS3_OP_ZEROFILL]    = "ZEROFILL",
 
6196
 
5896
6197
};
5897
6198
 
5898
6199
rpc_clnt_prog_t clnt3_3_fop_prog = {