diff options
| author | Amar Tumballi <amar@gluster.com> | 2010-06-21 04:24:40 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-06-21 20:21:05 -0700 | 
| commit | b9b8734a9496ccf5f8ed5527dc7714930a59948b (patch) | |
| tree | ffcf9187c315b30e23cfa7f68f1d360e246d94c2 /xlators/protocol/legacy/client/src/saved-frames.h | |
| parent | 2a5fada7546032e1fc1b106ddd40e42cc45349e1 (diff) | |
renamed xlator/protocol to xlator/protocol/legacy
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875
Diffstat (limited to 'xlators/protocol/legacy/client/src/saved-frames.h')
| -rw-r--r-- | xlators/protocol/legacy/client/src/saved-frames.h | 79 | 
1 files changed, 79 insertions, 0 deletions
diff --git a/xlators/protocol/legacy/client/src/saved-frames.h b/xlators/protocol/legacy/client/src/saved-frames.h new file mode 100644 index 00000000000..5c18abbcc9e --- /dev/null +++ b/xlators/protocol/legacy/client/src/saved-frames.h @@ -0,0 +1,79 @@ +/* +  Copyright (c) 2008-2009 Gluster, Inc. <http://www.gluster.com> +  This file is part of GlusterFS. + +  GlusterFS is free software; you can redistribute it and/or modify +  it under the terms of the GNU General Public License as published +  by the Free Software Foundation; either version 3 of the License, +  or (at your option) any later version. + +  GlusterFS is distributed in the hope that it will be useful, but +  WITHOUT ANY WARRANTY; without even the implied warranty of +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU +  General Public License for more details. + +  You should have received a copy of the GNU General Public License +  along with this program.  If not, see +  <http://www.gnu.org/licenses/>. +*/ + +#ifndef _SAVED_FRAMES_H +#define _SAVED_FRAMES_H + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include <stdint.h> +#include <sys/time.h> +#include "stack.h" +#include "list.h" +#include "protocol.h" + +/* UGLY: have common typedef b/w saved-frames.c and protocol-client.c */ +typedef int32_t (*gf_op_t) (call_frame_t *frame, +                            gf_hdr_common_t *hdr, size_t hdrlen, +                            struct iobuf *iobuf); + + +struct saved_frame { +	union { +		struct list_head list; +		struct { +			struct saved_frame *frame_next; +			struct saved_frame *frame_prev; +		}; +	}; + +	struct timeval  saved_at; +	call_frame_t   *frame; +	int32_t         op; +	int8_t          type; +	uint64_t        callid; +}; + + +struct saved_frames { +	int64_t            count; +	struct saved_frame fops; +	struct saved_frame mops; +	struct saved_frame cbks; +}; + + +struct saved_frames *saved_frames_new (); +int saved_frames_put (struct saved_frames *frames, call_frame_t *frame, +		      int32_t op, int8_t type, int64_t callid); +call_frame_t *saved_frames_get (struct saved_frames *frames, int32_t op, +				int8_t type, int64_t callid); + +struct saved_frame * +saved_frames_get_timedout (struct saved_frames *frames, int8_t type,  +			   uint32_t timeout, struct timeval *current); + +void saved_frames_destroy (xlator_t *this, struct saved_frames *frames, +			   gf_op_t gf_fops[], gf_op_t gf_mops[], +			   gf_op_t gf_cbks[]); + +#endif /* _SAVED_FRAMES_H */  | 
