[pnfs] [PATCH 2/2] more nfs4.1 draft-19 updates for layout{get, commit, return}

J. Bruce Fields bfields at fieldses.org
Mon Feb 11 12:39:58 EST 2008


On Mon, Feb 11, 2008 at 05:38:29PM +0200, Benny Halevy wrote:
> Signed-off-by: Benny Halevy <bhalevy at panasas.com>

Thanks.  Both applied, rebased onto the latest wireshark svn, and pushed
out to

	git://linux-nfs.org/~bfields/wireshark.git master

--b.

> ---
>  epan/dissectors/packet-nfs.c |   40 +++++++++++++++++++++++++++++++++-------
>  1 files changed, 33 insertions(+), 7 deletions(-)
> 
> diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
> index 1d7f9f0..ffaef77 100644
> --- a/epan/dissectors/packet-nfs.c
> +++ b/epan/dissectors/packet-nfs.c
> @@ -407,7 +407,7 @@ static int hf_nfs_first_stripe_idx4 = -1;
>  static int hf_nfs_layout_count = -1;
>  static int hf_nfs_pattern_offset = -1;
>  static int hf_nfs_notification_bitmap4 = -1;
> -
> +static int hf_nfs_lrs_present = -1;
>  
>  /* Hidden field for v2, v3, and v4 status */
>  int hf_nfs_nfsstat = -1;
> @@ -7718,6 +7718,23 @@ dissect_nfs_layoutreturn4(tvbuff_t *tvb, int offset, proto_tree *tree)
>  	if (returntype == 1) { /* RETURN_FILE */
>  		offset = dissect_rpc_uint64(tvb, tree, hf_nfs_offset4, offset);
>  		offset = dissect_rpc_uint64(tvb, tree, hf_nfs_length4, offset);
> +		offset = dissect_nfs_stateid4(tvb, offset, tree);
> +		offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_data);
> +	}
> +
> +	return offset;
> +}
> +
> +static int
> +dissect_nfs_layoutreturn_stateid(tvbuff_t *tvb, proto_tree *tree, int offset)
> +{
> +	guint lrs_present;
> +
> +	lrs_present = tvb_get_ntohl(tvb, offset);
> +	offset = dissect_rpc_bool(tvb, tree, hf_nfs_lrs_present, offset);
> +
> +	if (lrs_present) {
> +		offset = dissect_nfs_stateid4(tvb, offset, tree);
>  	}
>  
>  	return offset;
> @@ -8304,6 +8321,7 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
>  			offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
>  			offset = dissect_rpc_uint64(tvb, newftree,
>  										hf_nfs_length4_minlength, offset);
> +			offset = dissect_nfs_stateid4(tvb, offset, newftree);
>  			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_count4_maxcount,
>  										offset);
>  			break;
> @@ -8312,9 +8330,9 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
>  			offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
>  			offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
>  			offset = dissect_rpc_bool(tvb, newftree, hf_nfs_reclaim4, offset);
> +			offset = dissect_nfs_stateid4(tvb, offset, newftree);
>  			offset = dissect_nfs_newoffset4(tvb, offset, newftree);
>  			offset = dissect_nfs_newtime4(tvb, offset, newftree);
> -			offset = dissect_nfs_newtime4(tvb, offset, newftree);
>  			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_layouttype4,
>  										offset);
>  			offset = dissect_nfsdata(tvb, offset, newftree,
> @@ -8433,7 +8451,7 @@ static int
>  dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
>  	proto_tree *tree)
>  {
> -	guint32 ops, ops_counter;
> +	guint32 ops, ops_counter, count;
>  	guint32 opcode;
>  	proto_item *fitem;
>  	proto_tree *ftree = NULL;
> @@ -8646,11 +8664,14 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
>  			offset = dissect_rpc_bool(tvb, newftree, hf_nfs_return_on_close4,
>  									  offset);
>  			offset = dissect_nfs_stateid4(tvb, offset, newftree);
> +			count = tvb_get_ntohl(tvb, offset);
>  			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_layout_count, offset);
> -			offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
> -			offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
> -			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_iomode4, offset);
> -			offset = dissect_nfs_layout(tvb, offset, pinfo, newftree);
> +			while (count-- > 0) {
> +				offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
> +				offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
> +				offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_iomode4, offset);
> +				offset = dissect_nfs_layout(tvb, offset, pinfo, newftree);
> +			}
>  			break;
>  
>  		case NFS4_OP_LAYOUTCOMMIT:
> @@ -8658,6 +8679,7 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
>  			break;
>  
>  		case NFS4_OP_LAYOUTRETURN:
> +			offset = dissect_nfs_layoutreturn_stateid(tvb, newftree, offset);
>  			break;
>  
>  		case NFS4_OP_GETDEVINFO:
> @@ -10259,6 +10281,10 @@ proto_register_nfs(void)
>  			"Cache this?", "nfs.cachethis4", FT_BOOLEAN, BASE_NONE,
>  			TFS(&tfs_yes_no), 0, NULL, HFILL }},
>  
> +		{ &hf_nfs_lrs_present, {
> +			"Stateid present?", "nfs.lrs_present", FT_BOOLEAN, BASE_NONE,
> +			TFS(&tfs_yes_no), 0, NULL, HFILL }},
> +
>  	/* Hidden field for v2, v3, and v4 status */
>  		{ &hf_nfs_nfsstat, {
>  			"Status", "nfs.status", FT_UINT32, BASE_DEC,
> -- 
> 1.5.3.3
> 


More information about the pNFS mailing list