diff options
author | Niels de Vos <ndevos@redhat.com> | 2014-02-26 17:41:52 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-03-01 15:16:56 +0000 |
commit | 0cb4b4e44ded39edde2d26f9669f416effeb856a (patch) | |
tree | 3debaf4b341d9f3236a303ae95047f300b3d3ef2 /epan/dissectors/packet-glusterfs.c | |
parent | 104a6edd1fb703c5c2319c893720df86f8c9a9e7 (diff) |
GlusterFS: add support for ZEROFILL fop
Implementation details in http://review.gluster.org/5327
BUG: 9812
Change-Id: Ib1650fb7ca8221def4e9c6a323008847dc7b5f62
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: https://code.wireshark.org/review/429
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-glusterfs.c')
-rw-r--r-- | epan/dissectors/packet-glusterfs.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/epan/dissectors/packet-glusterfs.c b/epan/dissectors/packet-glusterfs.c index b152465e64..97eaf6adf8 100644 --- a/epan/dissectors/packet-glusterfs.c +++ b/epan/dissectors/packet-glusterfs.c @@ -68,6 +68,7 @@ static gint hf_glusterfs_dict = -1; static gint hf_glusterfs_fd = -1; static gint hf_glusterfs_offset = -1; static gint hf_glusterfs_size = -1; +static gint hf_glusterfs_size64 = -1; static gint hf_glusterfs_volume = -1; static gint hf_glusterfs_cmd = -1; static gint hf_glusterfs_type = -1; @@ -1693,6 +1694,18 @@ glusterfs_gfs3_3_op_fallocate_call(tvbuff_t *tvb, int offset, return offset; } +static int +glusterfs_gfs3_3_op_zerofill_call(tvbuff_t *tvb, int offset, + packet_info *pinfo _U_, proto_tree *tree, void* data _U_) +{ + offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset); + offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset); + offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset); + offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_size64, offset); + + return offset; +} + /* This function is for common replay. RELEASE , RELEASEDIR and some other function use this method */ int @@ -1800,7 +1813,7 @@ static const vsff glusterfs3_1_fop_proc[] = { static const vsff glusterfs3_3_fop_proc[] = { { GFS3_OP_NULL, "NULL", NULL, NULL }, { - GFS3_OP_STAT, "STAT", + GFS3_OP_STAT, "STAT", glusterfs_gfs3_3_op_stat_call, glusterfs_gfs3_3_op_stat_reply }, { @@ -1823,7 +1836,8 @@ static const vsff glusterfs3_3_fop_proc[] = { GFS3_OP_RMDIR, "RMDIR", glusterfs_gfs3_3_op_rmdir_call, glusterfs_gfs3_3_op_unlink_reply }, - { GFS3_OP_SYMLINK, "SYMLINK", + { + GFS3_OP_SYMLINK, "SYMLINK", glusterfs_gfs3_3_op_symlink_call, glusterfs_gfs3_3_op_mknod_reply }, { @@ -1963,19 +1977,23 @@ static const vsff glusterfs3_3_fop_proc[] = { }, { GFS3_OP_RELEASEDIR, "RELEASEDIR", - glusterfs_gfs3_3_op_releasedir_call, glusterfs_gfs3_3_op_common_reply + glusterfs_gfs3_3_op_releasedir_call, glusterfs_gfs3_3_op_common_reply }, { GFS3_OP_FREMOVEXATTR, "FREMOVEXATTR", - glusterfs_gfs3_3_op_fremovexattr_call, glusterfs_gfs3_3_op_common_reply + glusterfs_gfs3_3_op_fremovexattr_call, glusterfs_gfs3_3_op_common_reply }, { GFS3_OP_FALLOCATE, "FALLOCATE", - glusterfs_gfs3_3_op_fallocate_call, glusterfs_gfs3_3_op_setattr_reply + glusterfs_gfs3_3_op_fallocate_call, glusterfs_gfs3_3_op_setattr_reply }, { GFS3_OP_DISCARD, "DISCARD", - glusterfs_gfs3_3_op_readdirp_call, glusterfs_gfs3_3_op_setattr_reply + glusterfs_gfs3_3_op_readdirp_call, glusterfs_gfs3_3_op_setattr_reply + }, + { + GFS3_OP_ZEROFILL, "ZEROFILL", + glusterfs_gfs3_3_op_zerofill_call, glusterfs_gfs3_3_op_setattr_reply }, { 0, NULL, NULL, NULL } }; @@ -2028,6 +2046,7 @@ static const value_string glusterfs3_1_fop_proc_vals[] = { { GFS3_OP_FREMOVEXATTR, "FREMOVEXATTR" }, { GFS3_OP_FALLOCATE, "FALLOCATE" }, { GFS3_OP_DISCARD, "DISCARD" }, + { GFS3_OP_ZEROFILL, "ZEROFILL" }, { 0, NULL } }; static value_string_ext glusterfs3_1_fop_proc_vals_ext = VALUE_STRING_EXT_INIT(glusterfs3_1_fop_proc_vals); @@ -2138,6 +2157,10 @@ proto_register_glusterfs(void) { "Size", "glusterfs.size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } }, + { &hf_glusterfs_size64, + { "Size", "glusterfs.size64", FT_UINT64, BASE_DEC, + NULL, 0, NULL, HFILL } + }, { &hf_glusterfs_type, { "Type", "glusterfs.type", FT_INT32, BASE_DEC, VALS(glusterfs_lk_type_names), 0, NULL, HFILL } |