[Pvfs2-cvs] commit by bligon in pvfs2/src/proto:
PINT-le-bytefield.c pvfs2-attr.h pvfs2-req-proto.h
CVS commit program
cvs at parl.clemson.edu
Fri Jul 10 17:16:23 EDT 2009
Update of /projects/cvsroot/pvfs2/src/proto
In directory parlweb1:/tmp/cvs-serv30788/src/proto
Modified Files:
Tag: Orange-FailOver-Becky
PINT-le-bytefield.c pvfs2-attr.h pvfs2-req-proto.h
Log Message:
Completed changes to PVFS_object_attr. Changes to get-attr.sm are still underday
Index: PINT-le-bytefield.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/PINT-le-bytefield.c,v
diff -p -u -r1.58.10.1.6.2 -r1.58.10.1.6.3
--- PINT-le-bytefield.c 7 Jul 2009 16:17:28 -0000 1.58.10.1.6.2
+++ PINT-le-bytefield.c 10 Jul 2009 21:16:23 -0000 1.58.10.1.6.3
@@ -268,7 +268,8 @@ static void lebf_initialize(void)
}
/* since these take the max size when mallocing in the encode,
* give them a huge number, then later fix it. */
- max_size_array[op_type].req = max_size_array[op_type].resp = init_big_size;
+ max_size_array[op_type].req =
+ max_size_array[op_type].resp = init_big_size;
if (noreq)
reqsize = 0;
@@ -942,7 +943,10 @@ static void lebf_decode_rel(struct PINT_
if (resp->u.getattr.attr.mask & PVFS_ATTR_META_DIST)
decode_free(resp->u.getattr.attr.u.meta.dist);
if (resp->u.getattr.attr.mask & PVFS_ATTR_META_DFILES)
- decode_free(resp->u.getattr.attr.u.meta.dfile_array);
+ {
+ decode_free(resp->u.getattr.attr.u.meta.dfile_array);
+ decode_free(resp->u.getattr.attr.u.meta.mirror_dfile_array);
+ }
break;
case PVFS_SERV_UNSTUFF:
Index: pvfs2-attr.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-attr.h,v
diff -p -u -r1.43 -r1.43.20.1
--- pvfs2-attr.h 26 Jan 2009 22:37:17 -0000 1.43
+++ pvfs2-attr.h 10 Jul 2009 21:16:23 -0000 1.43.20.1
@@ -42,6 +42,8 @@
#define PVFS_ATTR_META_UNSTUFFED (1 << 12)
+#define PVFS_ATTR_META_MIRROR_DFILES (1 << 13)
+
/* internal attribute masks for datafile objects */
#define PVFS_ATTR_DATA_SIZE (1 << 15)
#define PVFS_ATTR_DATA_ALL PVFS_ATTR_DATA_SIZE
@@ -82,6 +84,10 @@ struct PVFS_metafile_attr_s
PVFS_handle *dfile_array;
uint32_t dfile_count;
+ /* list of mirrored datafiles */
+ PVFS_handle *mirror_dfile_array;
+ uint32_t mirror_copies_count;
+
int32_t stuffed_size;
PVFS_metafile_hint hint;
@@ -95,21 +101,44 @@ typedef struct PVFS_metafile_attr_s PVFS
decode_PINT_dist(pptr, &(x)->dist); \
(x)->dist_size = PINT_DIST_PACK_SIZE((x)->dist); \
} while (0)
-#define encode_PVFS_metafile_attr_dfiles(pptr,x) do { int dfiles_i; \
- encode_uint32_t(pptr, &(x)->dfile_count); \
- encode_skip4(pptr,); \
- for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++) \
- encode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]); \
- encode_PVFS_metafile_hint(pptr, &(x)->hint); \
-} while (0)
-#define decode_PVFS_metafile_attr_dfiles(pptr,x) do { int dfiles_i; \
- decode_uint32_t(pptr, &(x)->dfile_count); \
- decode_skip4(pptr,); \
- (x)->dfile_array = decode_malloc((x)->dfile_count \
- * sizeof(*(x)->dfile_array)); \
- for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++) \
- decode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]); \
- decode_PVFS_metafile_hint(pptr, &(x)->hint); \
+#define encode_PVFS_metafile_attr_dfiles(pptr,x) do { \
+ int dfiles_i; \
+ int copy_i; \
+ int handle_i; \
+ encode_uint32_t(pptr, &(x)->dfile_count); \
+ encode_skip4(pptr,); \
+ for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++) \
+ encode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]); \
+ encode_uint32_t(pptr, &(x)->mirror_copies_count); \
+ encode_skip4(pptr,); \
+ for (copy_i=0; copy_i < (x)->mirror_copies_count; copy_i++) \
+ for (dfiles_i=0; dfiles_i < (x)->dfile_count; dfiles_i++) \
+ { handle_i = (copy_i * (x)->dfile_count) + dfiles_i; \
+ encode_PVFS_handle(pptr, &(x)->mirror_dfile_array[handle_i]); \
+ } \
+ encode_PVFS_metafile_hint(pptr, &(x)->hint); \
+} while (0)
+#define decode_PVFS_metafile_attr_dfiles(pptr,x) do { \
+ int dfiles_i; \
+ int copy_i; \
+ int handle_i; \
+ decode_uint32_t(pptr, &(x)->dfile_count); \
+ decode_skip4(pptr,); \
+ (x)->dfile_array = decode_malloc((x)->dfile_count \
+ * sizeof(*(x)->dfile_array)); \
+ for (dfiles_i=0; dfiles_i<(x)->dfile_count; dfiles_i++) \
+ decode_PVFS_handle(pptr, &(x)->dfile_array[dfiles_i]); \
+ decode_uint32_t(pptr, &(x)->mirror_copies_count); \
+ decode_skip4(pptr,); \
+ (x)->mirror_dfile_array = decode_malloc((x)->dfile_count * \
+ (x)->mirror_copies_count * \
+ sizeof(PVFS_handle)); \
+ for (copy_i=0; copy_i < (x)->mirror_copies_count; copy_i++) \
+ for (dfiles_i=0; dfiles_i < (x)->dfile_count; dfiles_i++) \
+ { handle_i = (copy_i * (x)->dfile_count) + dfiles_i; \
+ decode_PVFS_handle(pptr, &(x)->mirror_dfile_array[handle_i]); \
+ } \
+ decode_PVFS_metafile_hint(pptr, &(x)->hint); \
} while (0)
#endif
@@ -255,15 +284,18 @@ typedef struct PVFS_object_attr PVFS_obj
decode_PVFS_directory_attr(pptr, &(x)->u.dir); \
} while (0)
#endif
-/* attr buffer needs room for larger of symlink path, meta fields or dir hints: an attrib
- * structure can never hold information for not more than a symlink or a metafile or a dir object */
+/* attr buffer needs room for larger of symlink path, meta fields or
+ * dir hints: an attrib structure can never hold information for not more
+ * than a symlink or a metafile or a dir object
+*/
#define extra_size_PVFS_object_attr_dir (PVFS_REQ_LIMIT_DIST_BYTES + \
PVFS_REQ_LIMIT_DIST_NAME + roundup8(sizeof(PVFS_directory_attr)))
-/* room for distribution, stuffed_size, and dfile array */
+/* room for distribution, stuffed_size, dfile array, and mirror_dfile_array */
#define extra_size_PVFS_object_attr_meta (PVFS_REQ_LIMIT_DIST_BYTES + \
- sizeof(int32_t) + \
- PVFS_REQ_LIMIT_DFILE_COUNT * sizeof(PVFS_handle))
+ sizeof(int32_t) + \
+ (PVFS_REQ_LIMIT_DFILE_COUNT * sizeof(PVFS_handle)) + \
+ (PVFS_REQ_LIMIT_MIRROR_DFILE_COUNT * sizeof(PVFS_handle)))
#define extra_size_PVFS_object_attr_symlink (PVFS_REQ_LIMIT_PATH_NAME_BYTES)
Index: pvfs2-req-proto.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/proto/pvfs2-req-proto.h,v
diff -p -u -r1.159.8.1 -r1.159.8.1.6.1
--- pvfs2-req-proto.h 30 Apr 2009 15:03:01 -0000 1.159.8.1
+++ pvfs2-req-proto.h 10 Jul 2009 21:16:23 -0000 1.159.8.1.6.1
@@ -122,6 +122,7 @@ enum PVFS_server_op
#define PVFS_REQ_LIMIT_DFILE_COUNT 1024
#define PVFS_REQ_LIMIT_DFILE_COUNT_IS_VALID(dfile_count) \
((dfile_count > 0) && (dfile_count < PVFS_REQ_LIMIT_DFILE_COUNT))
+#define PVFS_REQ_LIMIT_MIRROR_DFILE_COUNT 1024
/* max count of directory entries per readdir request */
#define PVFS_REQ_LIMIT_DIRENT_COUNT 512
/* max number of perf metrics returned by mgmt perf mon op */
@@ -149,7 +150,7 @@ enum PVFS_server_op
/* max number of key/value pairs to set or get in a list operation */
#define PVFS_REQ_LIMIT_KEYVAL_LIST 32
/* max number of handles for which we return attributes */
-#define PVFS_REQ_LIMIT_LISTATTR 113
+#define PVFS_REQ_LIMIT_LISTATTR 60
/* create *********************************************************/
/* - used to create an object. This creates a metadata handle,
More information about the Pvfs2-cvs
mailing list